提交 f1e2eda2 编写于 作者: T Trond Myklebust

NFS: Remove the BKL from the inode creation operations

nfs_instantiate() does not require the BKL, neither do the attribute
updates or the RPC code.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 bba67e0e
...@@ -1232,14 +1232,11 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode, ...@@ -1232,14 +1232,11 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
if ((nd->flags & LOOKUP_CREATE) != 0) if ((nd->flags & LOOKUP_CREATE) != 0)
open_flags = nd->intent.open.flags; open_flags = nd->intent.open.flags;
lock_kernel();
error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags, nd); error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags, nd);
if (error != 0) if (error != 0)
goto out_err; goto out_err;
unlock_kernel();
return 0; return 0;
out_err: out_err:
unlock_kernel();
d_drop(dentry); d_drop(dentry);
return error; return error;
} }
...@@ -1262,14 +1259,11 @@ nfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) ...@@ -1262,14 +1259,11 @@ nfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
attr.ia_mode = mode; attr.ia_mode = mode;
attr.ia_valid = ATTR_MODE; attr.ia_valid = ATTR_MODE;
lock_kernel();
status = NFS_PROTO(dir)->mknod(dir, dentry, &attr, rdev); status = NFS_PROTO(dir)->mknod(dir, dentry, &attr, rdev);
if (status != 0) if (status != 0)
goto out_err; goto out_err;
unlock_kernel();
return 0; return 0;
out_err: out_err:
unlock_kernel();
d_drop(dentry); d_drop(dentry);
return status; return status;
} }
...@@ -1288,15 +1282,12 @@ static int nfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) ...@@ -1288,15 +1282,12 @@ static int nfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
attr.ia_valid = ATTR_MODE; attr.ia_valid = ATTR_MODE;
attr.ia_mode = mode | S_IFDIR; attr.ia_mode = mode | S_IFDIR;
lock_kernel();
error = NFS_PROTO(dir)->mkdir(dir, dentry, &attr); error = NFS_PROTO(dir)->mkdir(dir, dentry, &attr);
if (error != 0) if (error != 0)
goto out_err; goto out_err;
unlock_kernel();
return 0; return 0;
out_err: out_err:
d_drop(dentry); d_drop(dentry);
unlock_kernel();
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册