aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-06-11 13:26:23 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-15 18:10:53 -0400
commitbba67e0e3f4caba2b2b90b48ed798fb0461bcb86 (patch)
treec13781f1265ccd73b4f71a33e9bb22931e954c1e /fs
parentb6a2e569e2157509951c9f3f58dfa18b44ce91b3 (diff)
NFS: Remove BKL usage from open()
All the NFSv4 stateful operations are already protected by other locks (in particular by the rpc_sequence locks. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/dir.c6
-rw-r--r--fs/nfs/file.c2
-rw-r--r--fs/nfs/nfs4proc.c2
3 files changed, 0 insertions, 10 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 73e0f9740dd1..c68ec447ace1 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -139,10 +139,8 @@ nfs_opendir(struct inode *inode, struct file *filp)
139 139
140 nfs_inc_stats(inode, NFSIOS_VFSOPEN); 140 nfs_inc_stats(inode, NFSIOS_VFSOPEN);
141 141
142 lock_kernel();
143 /* Call generic open code in order to cache credentials */ 142 /* Call generic open code in order to cache credentials */
144 res = nfs_open(inode, filp); 143 res = nfs_open(inode, filp);
145 unlock_kernel();
146 return res; 144 return res;
147} 145}
148 146
@@ -1019,9 +1017,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
1019 } 1017 }
1020 1018
1021 /* Open the file on the server */ 1019 /* Open the file on the server */
1022 lock_kernel();
1023 res = nfs4_atomic_open(dir, dentry, nd); 1020 res = nfs4_atomic_open(dir, dentry, nd);
1024 unlock_kernel();
1025 if (IS_ERR(res)) { 1021 if (IS_ERR(res)) {
1026 error = PTR_ERR(res); 1022 error = PTR_ERR(res);
1027 switch (error) { 1023 switch (error) {
@@ -1083,9 +1079,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
1083 * operations that change the directory. We therefore save the 1079 * operations that change the directory. We therefore save the
1084 * change attribute *before* we do the RPC call. 1080 * change attribute *before* we do the RPC call.
1085 */ 1081 */
1086 lock_kernel();
1087 ret = nfs4_open_revalidate(dir, dentry, openflags, nd); 1082 ret = nfs4_open_revalidate(dir, dentry, openflags, nd);
1088 unlock_kernel();
1089out: 1083out:
1090 dput(parent); 1084 dput(parent);
1091 if (!ret) 1085 if (!ret)
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index f919d9a01a27..9f1bed944b2e 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -128,9 +128,7 @@ nfs_file_open(struct inode *inode, struct file *filp)
128 return res; 128 return res;
129 129
130 nfs_inc_stats(inode, NFSIOS_VFSOPEN); 130 nfs_inc_stats(inode, NFSIOS_VFSOPEN);
131 lock_kernel();
132 res = nfs_open(inode, filp); 131 res = nfs_open(inode, filp);
133 unlock_kernel();
134 return res; 132 return res;
135} 133}
136 134
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4451287a81d1..c910413eaeca 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -451,9 +451,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata)
451 /* Save the delegation */ 451 /* Save the delegation */
452 memcpy(stateid.data, delegation->stateid.data, sizeof(stateid.data)); 452 memcpy(stateid.data, delegation->stateid.data, sizeof(stateid.data));
453 rcu_read_unlock(); 453 rcu_read_unlock();
454 lock_kernel();
455 ret = nfs_may_open(state->inode, state->owner->so_cred, open_mode); 454 ret = nfs_may_open(state->inode, state->owner->so_cred, open_mode);
456 unlock_kernel();
457 if (ret != 0) 455 if (ret != 0)
458 goto out; 456 goto out;
459 ret = -EAGAIN; 457 ret = -EAGAIN;