simple_fill_super is used in following filesystems that don't use the BKL otherwise: - security/selinux/selinuxfs.c - security/inode.c - security/smack/smackfs.c - drivers/infiniband/hw/ipath/ipath_fs.c - drivers/xen/xenfs/super.c - fs/debugfs/inode.c It is used in following filesystems that make use of the BKL: - fs/fuse/control.c - fs/binfmt_misc.c - fs/nfsd/nfsctl.c All three filesystems protect the call to simple_fill_super() by the BKL themself. Therefore it is safe to remove the BKL from simpe_fill_super(). Signed-off-by: Jan Blunck <jblunck@xxxxxxx> --- fs/libfs.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index 3484040..4a70729 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -11,7 +11,6 @@ #include <linux/exportfs.h> #include <linux/writeback.h> #include <linux/buffer_head.h> -#include <linux/smp_lock.h> /* Only for lock_kernel() */ #include <asm/uaccess.h> @@ -423,8 +422,6 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files struct dentry *dentry; int i; - lock_kernel(); - s->s_blocksize = PAGE_CACHE_SIZE; s->s_blocksize_bits = PAGE_CACHE_SHIFT; s->s_magic = magic; @@ -432,10 +429,9 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files s->s_time_gran = 1; inode = new_inode(s); - if (!inode) { - unlock_kernel(); + if (!inode) return -ENOMEM; - } + /* * because the root inode is 1, the files array must not contain an * entry at index 1 @@ -449,7 +445,6 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files root = d_alloc_root(inode); if (!root) { iput(inode); - unlock_kernel(); return -ENOMEM; } for (i = 0; !files->name || files->name[0]; i++, files++) { @@ -475,12 +470,10 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files d_add(dentry, inode); } s->s_root = root; - unlock_kernel(); return 0; out: d_genocide(root); dput(root); - unlock_kernel(); return -ENOMEM; } -- 1.6.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html