Merge branch 'nfs-for-2.6.39' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
[pandora-kernel.git] / fs / squashfs / super.c
index 20700b9..5c8184c 100644 (file)
@@ -199,10 +199,6 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
 
        err = -ENOMEM;
 
-       msblk->stream = squashfs_decompressor_init(msblk);
-       if (msblk->stream == NULL)
-               goto failed_mount;
-
        msblk->block_cache = squashfs_cache_init("metadata",
                        SQUASHFS_CACHED_BLKS, SQUASHFS_METADATA_SIZE);
        if (msblk->block_cache == NULL)
@@ -215,6 +211,13 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
                goto failed_mount;
        }
 
+       msblk->stream = squashfs_decompressor_init(sb, flags);
+       if (IS_ERR(msblk->stream)) {
+               err = PTR_ERR(msblk->stream);
+               msblk->stream = NULL;
+               goto failed_mount;
+       }
+
        /* Allocate and read id index table */
        msblk->id_table = squashfs_read_id_index_table(sb,
                le64_to_cpu(sblk->id_table_start), le16_to_cpu(sblk->no_ids));
@@ -370,8 +373,8 @@ static void squashfs_put_super(struct super_block *sb)
 }
 
 
-static struct dentry *squashfs_mount(struct file_system_type *fs_type, int flags,
-                               const char *dev_name, void *data)
+static struct dentry *squashfs_mount(struct file_system_type *fs_type,
+                               int flags, const char *dev_name, void *data)
 {
        return mount_bdev(fs_type, flags, dev_name, data, squashfs_fill_super);
 }