aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2
diff options
context:
space:
mode:
authorJan Blunck <jblunck@infradead.org>2010-02-24 07:25:32 -0500
committerArnd Bergmann <arnd@arndb.de>2010-10-04 15:10:41 -0400
commitd6d4c19c5f9ac5972e30e89b3c81ad1fd6e11fee (patch)
treee2f2e8204e0ff1f7af40aacbf50ee5fbbaa14030 /fs/nilfs2
parent22b26db6f82bfa9a7f2b44443af3b5541927a130 (diff)
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>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/ioctl.c1
-rw-r--r--fs/nilfs2/super.c18
2 files changed, 1 insertions, 18 deletions
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index f90a33d9a5b0..0442ee3b394f 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -22,7 +22,6 @@
22 22
23#include <linux/fs.h> 23#include <linux/fs.h>
24#include <linux/wait.h> 24#include <linux/wait.h>
25#include <linux/smp_lock.h> /* lock_kernel(), unlock_kernel() */
26#include <linux/slab.h> 25#include <linux/slab.h>
27#include <linux/capability.h> /* capable() */ 26#include <linux/capability.h> /* capable() */
28#include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */ 27#include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 0d573c2a6860..9f4913f78408 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -45,7 +45,6 @@
45#include <linux/parser.h> 45#include <linux/parser.h>
46#include <linux/random.h> 46#include <linux/random.h>
47#include <linux/crc32.h> 47#include <linux/crc32.h>
48#include <linux/smp_lock.h>
49#include <linux/vfs.h> 48#include <linux/vfs.h>
50#include <linux/writeback.h> 49#include <linux/writeback.h>
51#include <linux/kobject.h> 50#include <linux/kobject.h>
@@ -342,8 +341,6 @@ static void nilfs_put_super(struct super_block *sb)
342 struct nilfs_sb_info *sbi = NILFS_SB(sb); 341 struct nilfs_sb_info *sbi = NILFS_SB(sb);
343 struct the_nilfs *nilfs = sbi->s_nilfs; 342 struct the_nilfs *nilfs = sbi->s_nilfs;
344 343
345 lock_kernel();
346
347 nilfs_detach_segment_constructor(sbi); 344 nilfs_detach_segment_constructor(sbi);
348 345
349 if (!(sb->s_flags & MS_RDONLY)) { 346 if (!(sb->s_flags & MS_RDONLY)) {
@@ -361,8 +358,6 @@ static void nilfs_put_super(struct super_block *sb)
361 sbi->s_super = NULL; 358 sbi->s_super = NULL;
362 sb->s_fs_info = NULL; 359 sb->s_fs_info = NULL;
363 nilfs_put_sbinfo(sbi); 360 nilfs_put_sbinfo(sbi);
364
365 unlock_kernel();
366} 361}
367 362
368static int nilfs_sync_fs(struct super_block *sb, int wait) 363static 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)
949 struct nilfs_mount_options old_opts; 944 struct nilfs_mount_options old_opts;
950 int was_snapshot, err; 945 int was_snapshot, err;
951 946
952 lock_kernel();
953
954 down_write(&nilfs->ns_super_sem); 947 down_write(&nilfs->ns_super_sem);
955 old_sb_flags = sb->s_flags; 948 old_sb_flags = sb->s_flags;
956 old_opts.mount_opt = sbi->s_mount_opt; 949 old_opts.mount_opt = sbi->s_mount_opt;
@@ -1024,7 +1017,6 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)
1024 } 1017 }
1025 out: 1018 out:
1026 up_write(&nilfs->ns_super_sem); 1019 up_write(&nilfs->ns_super_sem);
1027 unlock_kernel();
1028 return 0; 1020 return 0;
1029 1021
1030 restore_opts: 1022 restore_opts:
@@ -1032,7 +1024,6 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)
1032 sbi->s_mount_opt = old_opts.mount_opt; 1024 sbi->s_mount_opt = old_opts.mount_opt;
1033 sbi->s_snapshot_cno = old_opts.snapshot_cno; 1025 sbi->s_snapshot_cno = old_opts.snapshot_cno;
1034 up_write(&nilfs->ns_super_sem); 1026 up_write(&nilfs->ns_super_sem);
1035 unlock_kernel();
1036 return err; 1027 return err;
1037} 1028}
1038 1029
@@ -1113,12 +1104,9 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
1113 if (!(flags & MS_RDONLY)) 1104 if (!(flags & MS_RDONLY))
1114 mode |= FMODE_WRITE; 1105 mode |= FMODE_WRITE;
1115 1106
1116 lock_kernel();
1117 sd.bdev = open_bdev_exclusive(dev_name, mode, fs_type); 1107 sd.bdev = open_bdev_exclusive(dev_name, mode, fs_type);
1118 if (IS_ERR(sd.bdev)) { 1108 if (IS_ERR(sd.bdev))
1119 unlock_kernel();
1120 return PTR_ERR(sd.bdev); 1109 return PTR_ERR(sd.bdev);
1121 }
1122 1110
1123 /* 1111 /*
1124 * To get mount instance using sget() vfs-routine, NILFS needs 1112 * 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,
1201 if (need_to_close) 1189 if (need_to_close)
1202 close_bdev_exclusive(sd.bdev, mode); 1190 close_bdev_exclusive(sd.bdev, mode);
1203 simple_set_mnt(mnt, s); 1191 simple_set_mnt(mnt, s);
1204 unlock_kernel();
1205 return 0; 1192 return 0;
1206 1193
1207 failed_unlock: 1194 failed_unlock:
@@ -1209,8 +1196,6 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
1209 put_nilfs(nilfs); 1196 put_nilfs(nilfs);
1210 failed: 1197 failed:
1211 close_bdev_exclusive(sd.bdev, mode); 1198 close_bdev_exclusive(sd.bdev, mode);
1212
1213 unlock_kernel();
1214 return err; 1199 return err;
1215 1200
1216 cancel_new: 1201 cancel_new:
@@ -1223,7 +1208,6 @@ nilfs_get_sb(struct file_system_type *fs_type, int flags,
1223 * We must finish all post-cleaning before this call; 1208 * We must finish all post-cleaning before this call;
1224 * put_nilfs() needs the block device. 1209 * put_nilfs() needs the block device.
1225 */ 1210 */
1226 unlock_kernel();
1227 return err; 1211 return err;
1228} 1212}
1229 1213