aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/super.c
diff options
context:
space:
mode:
authorJan Blunck <jblunck@infradead.org>2010-08-15 16:52:36 -0400
committerArnd Bergmann <arnd@arndb.de>2010-10-04 15:10:34 -0400
commit74c41429ae5889933a2b9b9d0d2f687baa410766 (patch)
treee102d92f2708bc8a1cf9ade061053621e90d7ff4 /fs/affs/super.c
parentdb71922217a214e5c9268448e537b54fc1f301ea (diff)
BKL: Remove BKL from Amiga FFS
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/affs/super.c')
-rw-r--r--fs/affs/super.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 3a6d1dee4a51..a167f96d79f7 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -16,7 +16,6 @@
16#include <linux/parser.h> 16#include <linux/parser.h>
17#include <linux/magic.h> 17#include <linux/magic.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <linux/smp_lock.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
21#include "affs.h" 20#include "affs.h"
22 21
@@ -46,8 +45,6 @@ affs_put_super(struct super_block *sb)
46 struct affs_sb_info *sbi = AFFS_SB(sb); 45 struct affs_sb_info *sbi = AFFS_SB(sb);
47 pr_debug("AFFS: put_super()\n"); 46 pr_debug("AFFS: put_super()\n");
48 47
49 lock_kernel();
50
51 if (!(sb->s_flags & MS_RDONLY) && sb->s_dirt) 48 if (!(sb->s_flags & MS_RDONLY) && sb->s_dirt)
52 affs_commit_super(sb, 1, 1); 49 affs_commit_super(sb, 1, 1);
53 50
@@ -56,8 +53,6 @@ affs_put_super(struct super_block *sb)
56 affs_brelse(sbi->s_root_bh); 53 affs_brelse(sbi->s_root_bh);
57 kfree(sbi); 54 kfree(sbi);
58 sb->s_fs_info = NULL; 55 sb->s_fs_info = NULL;
59
60 unlock_kernel();
61} 56}
62 57
63static void 58static void
@@ -291,8 +286,6 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
291 u8 sig[4]; 286 u8 sig[4];
292 int ret = -EINVAL; 287 int ret = -EINVAL;
293 288
294 lock_kernel();
295
296 save_mount_options(sb, data); 289 save_mount_options(sb, data);
297 290
298 pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options"); 291 pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
@@ -302,10 +295,9 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
302 sb->s_flags |= MS_NODIRATIME; 295 sb->s_flags |= MS_NODIRATIME;
303 296
304 sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL); 297 sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL);
305 if (!sbi) { 298 if (!sbi)
306 unlock_kernel();
307 return -ENOMEM; 299 return -ENOMEM;
308 } 300
309 sb->s_fs_info = sbi; 301 sb->s_fs_info = sbi;
310 mutex_init(&sbi->s_bmlock); 302 mutex_init(&sbi->s_bmlock);
311 spin_lock_init(&sbi->symlink_lock); 303 spin_lock_init(&sbi->symlink_lock);
@@ -316,7 +308,6 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
316 printk(KERN_ERR "AFFS: Error parsing options\n"); 308 printk(KERN_ERR "AFFS: Error parsing options\n");
317 kfree(sbi->s_prefix); 309 kfree(sbi->s_prefix);
318 kfree(sbi); 310 kfree(sbi);
319 unlock_kernel();
320 return -EINVAL; 311 return -EINVAL;
321 } 312 }
322 /* N.B. after this point s_prefix must be released */ 313 /* N.B. after this point s_prefix must be released */
@@ -487,7 +478,6 @@ got_root:
487 sb->s_root->d_op = &affs_dentry_operations; 478 sb->s_root->d_op = &affs_dentry_operations;
488 479
489 pr_debug("AFFS: s_flags=%lX\n",sb->s_flags); 480 pr_debug("AFFS: s_flags=%lX\n",sb->s_flags);
490 unlock_kernel();
491 return 0; 481 return 0;
492 482
493 /* 483 /*
@@ -502,7 +492,6 @@ out_error_noinode:
502 kfree(sbi->s_prefix); 492 kfree(sbi->s_prefix);
503 kfree(sbi); 493 kfree(sbi);
504 sb->s_fs_info = NULL; 494 sb->s_fs_info = NULL;
505 unlock_kernel();
506 return ret; 495 return ret;
507} 496}
508 497
@@ -534,7 +523,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
534 kfree(new_opts); 523 kfree(new_opts);
535 return -EINVAL; 524 return -EINVAL;
536 } 525 }
537 lock_kernel(); 526
538 replace_mount_options(sb, new_opts); 527 replace_mount_options(sb, new_opts);
539 528
540 sbi->s_flags = mount_flags; 529 sbi->s_flags = mount_flags;
@@ -550,17 +539,15 @@ affs_remount(struct super_block *sb, int *flags, char *data)
550 memcpy(sbi->s_volume, volume, 32); 539 memcpy(sbi->s_volume, volume, 32);
551 spin_unlock(&sbi->symlink_lock); 540 spin_unlock(&sbi->symlink_lock);
552 541
553 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) { 542 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
554 unlock_kernel();
555 return 0; 543 return 0;
556 } 544
557 if (*flags & MS_RDONLY) { 545 if (*flags & MS_RDONLY) {
558 affs_write_super(sb); 546 affs_write_super(sb);
559 affs_free_bitmap(sb); 547 affs_free_bitmap(sb);
560 } else 548 } else
561 res = affs_init_bitmap(sb, flags); 549 res = affs_init_bitmap(sb, flags);
562 550
563 unlock_kernel();
564 return res; 551 return res;
565} 552}
566 553