Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3dbc4b32 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
parent 1a028dd2
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -30,7 +30,6 @@
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/vfs.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/mutex.h>
#include <linux/mutex.h>
#include <linux/pagemap.h>
#include <linux/pagemap.h>
#include <linux/init.h>
#include <linux/init.h>
@@ -87,14 +86,11 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
	u64 lookup_table_start, xattr_id_table_start;
	u64 lookup_table_start, xattr_id_table_start;
	int err;
	int err;


	lock_kernel();

	TRACE("Entered squashfs_fill_superblock\n");
	TRACE("Entered squashfs_fill_superblock\n");


	sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL);
	sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL);
	if (sb->s_fs_info == NULL) {
	if (sb->s_fs_info == NULL) {
		ERROR("Failed to allocate squashfs_sb_info\n");
		ERROR("Failed to allocate squashfs_sb_info\n");
		unlock_kernel();
		return -ENOMEM;
		return -ENOMEM;
	}
	}
	msblk = sb->s_fs_info;
	msblk = sb->s_fs_info;
@@ -304,7 +300,6 @@ allocate_root:


	TRACE("Leaving squashfs_fill_super\n");
	TRACE("Leaving squashfs_fill_super\n");
	kfree(sblk);
	kfree(sblk);
	unlock_kernel();
	return 0;
	return 0;


failed_mount:
failed_mount:
@@ -319,13 +314,11 @@ failed_mount:
	kfree(sb->s_fs_info);
	kfree(sb->s_fs_info);
	sb->s_fs_info = NULL;
	sb->s_fs_info = NULL;
	kfree(sblk);
	kfree(sblk);
	unlock_kernel();
	return err;
	return err;


failure:
failure:
	kfree(sb->s_fs_info);
	kfree(sb->s_fs_info);
	sb->s_fs_info = NULL;
	sb->s_fs_info = NULL;
	unlock_kernel();
	return -ENOMEM;
	return -ENOMEM;
}
}


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


static void squashfs_put_super(struct super_block *sb)
static void squashfs_put_super(struct super_block *sb)
{
{
	lock_kernel();

	if (sb->s_fs_info) {
	if (sb->s_fs_info) {
		struct squashfs_sb_info *sbi = sb->s_fs_info;
		struct squashfs_sb_info *sbi = sb->s_fs_info;
		squashfs_cache_delete(sbi->block_cache);
		squashfs_cache_delete(sbi->block_cache);
@@ -376,8 +367,6 @@ static void squashfs_put_super(struct super_block *sb)
		kfree(sb->s_fs_info);
		kfree(sb->s_fs_info);
		sb->s_fs_info = NULL;
		sb->s_fs_info = NULL;
	}
	}

	unlock_kernel();
}
}