Skip to content

Commit

Permalink
BKL: Remove BKL from BFS
Browse files Browse the repository at this point in the history
The BKL is only used in put_super and fill_super that are both protected by
the superblocks s_umount rw_semaphore. Therefore it is safe to remove the BKL
entirely.

Signed-off-by: Jan Blunck <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
jblunck authored and arndb committed Oct 4, 2010
1 parent 74c4142 commit ba13d59
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fs/bfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/smp_lock.h>
#include <linux/buffer_head.h>
#include <linux/vfs.h>
#include <linux/writeback.h>
Expand Down Expand Up @@ -215,14 +214,10 @@ static void bfs_put_super(struct super_block *s)
if (!info)
return;

lock_kernel();

mutex_destroy(&info->bfs_lock);
kfree(info->si_imap);
kfree(info);
s->s_fs_info = NULL;

unlock_kernel();
}

static int bfs_statfs(struct dentry *dentry, struct kstatfs *buf)
Expand Down Expand Up @@ -322,13 +317,9 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
int ret = -EINVAL;
unsigned long i_sblock, i_eblock, i_eoff, s_size;

lock_kernel();

info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) {
unlock_kernel();
if (!info)
return -ENOMEM;
}
mutex_init(&info->bfs_lock);
s->s_fs_info = info;

Expand Down Expand Up @@ -443,7 +434,6 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
brelse(bh);
brelse(sbh);
dump_imap("read_super", s);
unlock_kernel();
return 0;

out3:
Expand All @@ -457,7 +447,6 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
mutex_destroy(&info->bfs_lock);
kfree(info);
s->s_fs_info = NULL;
unlock_kernel();
return ret;
}

Expand Down

0 comments on commit ba13d59

Please sign in to comment.