--- zzzz-none-000/linux-2.6.39.4/fs/squashfs/dir.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/fs/squashfs/dir.c 2021-11-10 13:23:10.000000000 +0000 @@ -74,7 +74,7 @@ if (err < 0) break; - index = le32_to_cpu(dir_index.index); + index = sqsh32_to_cpu(dir_index.index); if (index > f_pos) /* * Found the index we're looking for. @@ -82,12 +82,12 @@ break; err = squashfs_read_metadata(sb, NULL, &index_start, - &index_offset, le32_to_cpu(dir_index.size) + 1); + &index_offset, sqsh32_to_cpu(dir_index.size) + 1); if (err < 0) break; length = index; - *next_block = le32_to_cpu(dir_index.start_block) + + *next_block = sqsh32_to_cpu(dir_index.start_block) + msblk->directory_table; } @@ -171,7 +171,7 @@ length += sizeof(dirh); - dir_count = le32_to_cpu(dirh.count) + 1; + dir_count = sqsh32_to_cpu(dirh.count) + 1; /* dir_count should never be larger than 256 */ if (dir_count > 256) @@ -186,7 +186,7 @@ if (err < 0) goto failed_read; - size = le16_to_cpu(dire->size) + 1; + size = sqsh16_to_cpu(dire->size) + 1; /* size should never be larger than SQUASHFS_NAME_LEN */ if (size > SQUASHFS_NAME_LEN) @@ -203,15 +203,15 @@ continue; dire->name[size] = '\0'; - inode_number = le32_to_cpu(dirh.inode_number) + - ((short) le16_to_cpu(dire->inode_number)); - type = le16_to_cpu(dire->type); + inode_number = sqsh32_to_cpu(dirh.inode_number) + + ((short) sqsh16_to_cpu(dire->inode_number)); + type = sqsh16_to_cpu(dire->type); TRACE("Calling filldir(%p, %s, %d, %lld, %x:%x, %d, %d)" "\n", dirent, dire->name, size, file->f_pos, - le32_to_cpu(dirh.start_block), - le16_to_cpu(dire->offset), + sqsh32_to_cpu(dirh.start_block), + sqsh16_to_cpu(dire->offset), inode_number, squashfs_filetype_table[type]);