aboutsummaryrefslogtreecommitdiff
path: root/fs/squashfs/export.c
diff options
context:
space:
mode:
authorPhillip Lougher2011-05-20 02:26:43 +0100
committerPhillip Lougher2011-05-25 18:21:31 +0100
commit82de647e1f81fd89afc48608d889dd3b33cb8983 (patch)
tree847b7b40ed273eaa755c27bef6b1a20d201273c2 /fs/squashfs/export.c
parent117a91e0f25fd7698e20ac3dfa62086be3dc82a3 (diff)
Squashfs: move table allocation into squashfs_read_table()
This eliminates a lot of duplicate code. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Diffstat (limited to 'fs/squashfs/export.c')
-rw-r--r--fs/squashfs/export.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/fs/squashfs/export.c b/fs/squashfs/export.c
index 7f93d5a9ee05..cc6dd90cee6a 100644
--- a/fs/squashfs/export.c
+++ b/fs/squashfs/export.c
@@ -124,27 +124,10 @@ __le64 *squashfs_read_inode_lookup_table(struct super_block *sb,
u64 lookup_table_start, unsigned int inodes)
{
unsigned int length = SQUASHFS_LOOKUP_BLOCK_BYTES(inodes);
- __le64 *inode_lookup_table;
- int err;
TRACE("In read_inode_lookup_table, length %d\n", length);
- /* Allocate inode lookup table indexes */
- inode_lookup_table = kmalloc(length, GFP_KERNEL);
- if (inode_lookup_table == NULL) {
- ERROR("Failed to allocate inode lookup table\n");
- return ERR_PTR(-ENOMEM);
- }
-
- err = squashfs_read_table(sb, inode_lookup_table, lookup_table_start,
- length);
- if (err < 0) {
- ERROR("unable to read inode lookup table\n");
- kfree(inode_lookup_table);
- return ERR_PTR(err);
- }
-
- return inode_lookup_table;
+ return squashfs_read_table(sb, lookup_table_start, length);
}