push BKL down into ->put_super
[pandora-kernel.git] / fs / squashfs / super.c
index ffa6edc..3b52770 100644 (file)
@@ -157,6 +157,16 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
        if (msblk->block_size > SQUASHFS_FILE_MAX_SIZE)
                goto failed_mount;
 
+       /*
+        * Check the system page size is not larger than the filesystem
+        * block size (by default 128K).  This is currently not supported.
+        */
+       if (PAGE_CACHE_SIZE > msblk->block_size) {
+               ERROR("Page size > filesystem block size (%d).  This is "
+                       "currently not supported!\n", msblk->block_size);
+               goto failed_mount;
+       }
+
        msblk->block_log = le16_to_cpu(sblk->block_log);
        if (msblk->block_log > SQUASHFS_FILE_MAX_LOG)
                goto failed_mount;
@@ -328,6 +338,8 @@ static int squashfs_remount(struct super_block *sb, int *flags, char *data)
 
 static void squashfs_put_super(struct super_block *sb)
 {
+       lock_kernel();
+
        if (sb->s_fs_info) {
                struct squashfs_sb_info *sbi = sb->s_fs_info;
                squashfs_cache_delete(sbi->block_cache);
@@ -340,6 +352,8 @@ static void squashfs_put_super(struct super_block *sb)
                kfree(sb->s_fs_info);
                sb->s_fs_info = NULL;
        }
+
+       unlock_kernel();
 }