aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-06-11 15:44:20 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-15 18:10:54 -0400
commitfc0f684c21b5d4b41dc2ec76f7c0897ac98f5b6e (patch)
tree686ee2a2d7b4f04d5812c76485c18c048c5366d2 /fs
parentfc81af535e462764e17f638d542973fbef13b026 (diff)
NFS: Remove BKL from NFS lookup code
All dentry-related operations are already BKL-safe, since they are protected by the VFS locking. No extra locks should be needed in the NFS code. In the case of nfs_revalidate_inode(), we're only doing an attribute update (protected by the inode->i_lock). In the case of nfs_lookup(), we're instantiating a new dentry, so there should be no contention possible until after we call d_materialise_unique. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/dir.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 5ae8ee6b298f..60da7550133c 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -777,7 +777,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
777 struct nfs_fattr fattr; 777 struct nfs_fattr fattr;
778 778
779 parent = dget_parent(dentry); 779 parent = dget_parent(dentry);
780 lock_kernel();
781 dir = parent->d_inode; 780 dir = parent->d_inode;
782 nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); 781 nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE);
783 inode = dentry->d_inode; 782 inode = dentry->d_inode;
@@ -815,7 +814,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd)
815 814
816 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 815 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
817 out_valid: 816 out_valid:
818 unlock_kernel();
819 dput(parent); 817 dput(parent);
820 dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is valid\n", 818 dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is valid\n",
821 __func__, dentry->d_parent->d_name.name, 819 __func__, dentry->d_parent->d_name.name,
@@ -834,7 +832,6 @@ out_zap_parent:
834 shrink_dcache_parent(dentry); 832 shrink_dcache_parent(dentry);
835 } 833 }
836 d_drop(dentry); 834 d_drop(dentry);
837 unlock_kernel();
838 dput(parent); 835 dput(parent);
839 dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n", 836 dfprintk(LOOKUPCACHE, "NFS: %s(%s/%s) is invalid\n",
840 __func__, dentry->d_parent->d_name.name, 837 __func__, dentry->d_parent->d_name.name,
@@ -921,8 +918,6 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
921 res = ERR_PTR(-ENOMEM); 918 res = ERR_PTR(-ENOMEM);
922 dentry->d_op = NFS_PROTO(dir)->dentry_ops; 919 dentry->d_op = NFS_PROTO(dir)->dentry_ops;
923 920
924 lock_kernel();
925
926 /* 921 /*
927 * If we're doing an exclusive create, optimize away the lookup 922 * If we're doing an exclusive create, optimize away the lookup
928 * but don't hash the dentry. 923 * but don't hash the dentry.
@@ -930,7 +925,7 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
930 if (nfs_is_exclusive_create(dir, nd)) { 925 if (nfs_is_exclusive_create(dir, nd)) {
931 d_instantiate(dentry, NULL); 926 d_instantiate(dentry, NULL);
932 res = NULL; 927 res = NULL;
933 goto out_unlock; 928 goto out;
934 } 929 }
935 930
936 parent = dentry->d_parent; 931 parent = dentry->d_parent;
@@ -958,8 +953,6 @@ no_entry:
958 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 953 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
959out_unblock_sillyrename: 954out_unblock_sillyrename:
960 nfs_unblock_sillyrename(parent); 955 nfs_unblock_sillyrename(parent);
961out_unlock:
962 unlock_kernel();
963out: 956out:
964 return res; 957 return res;
965} 958}