mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 10:13:57 +08:00
BKL: Remove BKL from NILFS2
The BKL is only used in put_super, fill_super and remount_fs that are all three protected by the superblocks s_umount rw_semaphore. Therefore it is safe to remove the BKL entirely. Signed-off-by: Jan Blunck <jblunck@infradead.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
22b26db6f8
commit
d6d4c19c5f
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/wait.h>
|
#include <linux/wait.h>
|
||||||
#include <linux/smp_lock.h> /* lock_kernel(), unlock_kernel() */
|
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/capability.h> /* capable() */
|
#include <linux/capability.h> /* capable() */
|
||||||
#include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */
|
#include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
#include <linux/parser.h>
|
#include <linux/parser.h>
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
#include <linux/crc32.h>
|
#include <linux/crc32.h>
|
||||||
#include <linux/smp_lock.h>
|
|
||||||
#include <linux/vfs.h>
|
#include <linux/vfs.h>
|
||||||
#include <linux/writeback.h>
|
#include <linux/writeback.h>
|
||||||
#include <linux/kobject.h>
|
#include <linux/kobject.h>
|
||||||
@ -342,8 +341,6 @@ static void nilfs_put_super(struct super_block *sb)
|
|||||||
struct nilfs_sb_info *sbi = NILFS_SB(sb);
|
struct nilfs_sb_info *sbi = NILFS_SB(sb);
|
||||||
struct the_nilfs *nilfs = sbi->s_nilfs;
|
struct the_nilfs *nilfs = sbi->s_nilfs;
|
||||||
|
|
||||||
lock_kernel();
|
|
||||||
|
|
||||||
nilfs_detach_segment_constructor(sbi);
|
nilfs_detach_segment_constructor(sbi);
|
||||||
|
|
||||||
if (!(sb->s_flags & MS_RDONLY)) {
|
if (!(sb->s_flags & MS_RDONLY)) {
|
||||||
@ -361,8 +358,6 @@ static void nilfs_put_super(struct super_block *sb)
|
|||||||
sbi->s_super = NULL;
|
sbi->s_super = NULL;
|
||||||
sb->s_fs_info = NULL;
|
sb->s_fs_info = NULL;
|
||||||
nilfs_put_sbinfo(sbi);
|
nilfs_put_sbinfo(sbi);
|
||||||
|
|
||||||
unlock_kernel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nilfs_sync_fs(struct super_block *sb, int wait)
|
static int nilfs_sync_fs(struct super_block *sb, int wait)
|
||||||
@ -949,8 +944,6 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)
|
|||||||
struct nilfs_mount_options old_opts;
|
struct nilfs_mount_options old_opts;
|
||||||
int was_snapshot, err;
|
int was_snapshot, err;
|
||||||
|
|
||||||
lock_kernel();
|
|
||||||
|
|
||||||
down_write(&nilfs->ns_super_sem);
|
down_write(&nilfs->ns_super_sem);
|
||||||
old_sb_flags = sb->s_flags;
|
old_sb_flags = sb->s_flags;
|
||||||
old_opts.mount_opt = sbi->s_mount_opt;
|
old_opts.mount_opt = sbi->s_mount_opt;
|
||||||
@ -1024,7 +1017,6 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)
|
|||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
up_write(&nilfs->ns_super_sem);
|
up_write(&nilfs->ns_super_sem);
|
||||||
unlock_kernel();
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
restore_opts:
|
restore_opts:
|
||||||
@ -1032,7 +1024,6 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)
|
|||||||
sbi->s_mount_opt = old_opts.mount_opt;
|
sbi->s_mount_opt = old_opts.mount_opt;
|
||||||
sbi->s_snapshot_cno = old_opts.snapshot_cno;
|
sbi->s_snapshot_cno = old_opts.snapshot_cno;
|
||||||
up_write(&nilfs->ns_super_sem);
|
up_write(&nilfs->ns_super_sem);
|
||||||
unlock_kernel();
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1113,12 +1104,9 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
|
|||||||
if (!(flags & MS_RDONLY))
|
if (!(flags & MS_RDONLY))
|
||||||
mode |= FMODE_WRITE;
|
mode |= FMODE_WRITE;
|
||||||
|
|
||||||
lock_kernel();
|
|
||||||
sd.bdev = open_bdev_exclusive(dev_name, mode, fs_type);
|
sd.bdev = open_bdev_exclusive(dev_name, mode, fs_type);
|
||||||
if (IS_ERR(sd.bdev)) {
|
if (IS_ERR(sd.bdev))
|
||||||
unlock_kernel();
|
|
||||||
return PTR_ERR(sd.bdev);
|
return PTR_ERR(sd.bdev);
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To get mount instance using sget() vfs-routine, NILFS needs
|
* To get mount instance using sget() vfs-routine, NILFS needs
|
||||||
@ -1201,7 +1189,6 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
|
|||||||
if (need_to_close)
|
if (need_to_close)
|
||||||
close_bdev_exclusive(sd.bdev, mode);
|
close_bdev_exclusive(sd.bdev, mode);
|
||||||
simple_set_mnt(mnt, s);
|
simple_set_mnt(mnt, s);
|
||||||
unlock_kernel();
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
failed_unlock:
|
failed_unlock:
|
||||||
@ -1209,8 +1196,6 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
|
|||||||
put_nilfs(nilfs);
|
put_nilfs(nilfs);
|
||||||
failed:
|
failed:
|
||||||
close_bdev_exclusive(sd.bdev, mode);
|
close_bdev_exclusive(sd.bdev, mode);
|
||||||
|
|
||||||
unlock_kernel();
|
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
cancel_new:
|
cancel_new:
|
||||||
@ -1223,7 +1208,6 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
|
|||||||
* We must finish all post-cleaning before this call;
|
* We must finish all post-cleaning before this call;
|
||||||
* put_nilfs() needs the block device.
|
* put_nilfs() needs the block device.
|
||||||
*/
|
*/
|
||||||
unlock_kernel();
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user