Skip to content

Commit 3dbc4b3

Browse files
committed
BKL: Remove BKL from squashfs
The BKL is only used in put_super and fill_super, which are both protected by the superblocks s_umount rw_semaphore. Therefore it is safe to remove the BKL entirely. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
1 parent 1a028dd commit 3dbc4b3

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

‎fs/squashfs/super.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <linux/fs.h>
3131
#include <linux/vfs.h>
3232
#include <linux/slab.h>
33-
#include <linux/smp_lock.h>
3433
#include <linux/mutex.h>
3534
#include <linux/pagemap.h>
3635
#include <linux/init.h>
@@ -87,14 +86,11 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
8786
u64 lookup_table_start, xattr_id_table_start;
8887
int err;
8988

90-
lock_kernel();
91-
9289
TRACE("Entered squashfs_fill_superblock\n");
9390

9491
sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL);
9592
if (sb->s_fs_info == NULL) {
9693
ERROR("Failed to allocate squashfs_sb_info\n");
97-
unlock_kernel();
9894
return -ENOMEM;
9995
}
10096
msblk = sb->s_fs_info;
@@ -304,7 +300,6 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
304300

305301
TRACE("Leaving squashfs_fill_super\n");
306302
kfree(sblk);
307-
unlock_kernel();
308303
return 0;
309304

310305
failed_mount:
@@ -319,13 +314,11 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
319314
kfree(sb->s_fs_info);
320315
sb->s_fs_info = NULL;
321316
kfree(sblk);
322-
unlock_kernel();
323317
return err;
324318

325319
failure:
326320
kfree(sb->s_fs_info);
327321
sb->s_fs_info = NULL;
328-
unlock_kernel();
329322
return -ENOMEM;
330323
}
331324

@@ -360,8 +353,6 @@ static int squashfs_remount(struct super_block *sb, int *flags, char *data)
360353

361354
static void squashfs_put_super(struct super_block *sb)
362355
{
363-
lock_kernel();
364-
365356
if (sb->s_fs_info) {
366357
struct squashfs_sb_info *sbi = sb->s_fs_info;
367358
squashfs_cache_delete(sbi->block_cache);
@@ -376,8 +367,6 @@ static void squashfs_put_super(struct super_block *sb)
376367
kfree(sb->s_fs_info);
377368
sb->s_fs_info = NULL;
378369
}
379-
380-
unlock_kernel();
381370
}
382371

383372

0 commit comments

Comments
 (0)