Skip to content

Commit

Permalink
BKL: Remove BKL from jffs2
Browse files Browse the repository at this point in the history
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: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Arnd Bergmann committed Oct 4, 2010
1 parent 18dfe89 commit 1a028dd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
4 changes: 0 additions & 4 deletions fs/jffs2/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/vmalloc.h>
#include <linux/vfs.h>
#include <linux/crc32.h>
#include <linux/smp_lock.h>
#include "nodelist.h"

static int jffs2_flash_setup(struct jffs2_sb_info *c);
Expand Down Expand Up @@ -391,7 +390,6 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
This also catches the case where it was stopped and this
is just a remount to restart it.
Flush the writebuffer, if neccecary, else we loose it */
lock_kernel();
if (!(sb->s_flags & MS_RDONLY)) {
jffs2_stop_garbage_collect_thread(c);
mutex_lock(&c->alloc_sem);
Expand All @@ -403,8 +401,6 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
jffs2_start_garbage_collect_thread(c);

*flags |= MS_NOATIME;

unlock_kernel();
return 0;
}

Expand Down
12 changes: 1 addition & 11 deletions fs/jffs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/fs.h>
Expand Down Expand Up @@ -148,17 +147,13 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
struct jffs2_sb_info *c;
int ret;

lock_kernel();

D1(printk(KERN_DEBUG "jffs2_get_sb_mtd():"
" New superblock for device %d (\"%s\")\n",
sb->s_mtd->index, sb->s_mtd->name));

c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c) {
unlock_kernel();
if (!c)
return -ENOMEM;
}

c->mtd = sb->s_mtd;
c->os_priv = sb;
Expand All @@ -181,7 +176,6 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
sb->s_flags |= MS_POSIXACL;
#endif
ret = jffs2_do_fill_super(sb, data, silent);
unlock_kernel();
return ret;
}

Expand All @@ -199,8 +193,6 @@ static void jffs2_put_super (struct super_block *sb)

D2(printk(KERN_DEBUG "jffs2: jffs2_put_super()\n"));

lock_kernel();

if (sb->s_dirt)
jffs2_write_super(sb);

Expand All @@ -222,8 +214,6 @@ static void jffs2_put_super (struct super_block *sb)
if (c->mtd->sync)
c->mtd->sync(c->mtd);

unlock_kernel();

D1(printk(KERN_DEBUG "jffs2_put_super returning\n"));
}

Expand Down

0 comments on commit 1a028dd

Please sign in to comment.