diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:32 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:21 -0500 |
commit | b7ab39f631f505edc2bbdb86620d5493f995c9da (patch) | |
tree | 62be97ebc7fc69ceb601f23312d335ebb8038ee7 /fs/nfsd | |
parent | 2304450783dfde7b0b94ae234edd0dbffa865073 (diff) |
fs: dcache scale dentry refcount
Make d_count non-atomic and protect it with d_lock. This allows us to ensure a
0 refcount dentry remains 0 without dcache_lock. It is also fairly natural when
we start protecting many other dentry members with d_lock.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/vfs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 184938fcff04..3a359023c9f7 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1756,8 +1756,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, | |||
1756 | goto out_dput_new; | 1756 | goto out_dput_new; |
1757 | 1757 | ||
1758 | if (svc_msnfs(ffhp) && | 1758 | if (svc_msnfs(ffhp) && |
1759 | ((atomic_read(&odentry->d_count) > 1) | 1759 | ((odentry->d_count > 1) || (ndentry->d_count > 1))) { |
1760 | || (atomic_read(&ndentry->d_count) > 1))) { | ||
1761 | host_err = -EPERM; | 1760 | host_err = -EPERM; |
1762 | goto out_dput_new; | 1761 | goto out_dput_new; |
1763 | } | 1762 | } |
@@ -1843,7 +1842,7 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
1843 | if (type != S_IFDIR) { /* It's UNLINK */ | 1842 | if (type != S_IFDIR) { /* It's UNLINK */ |
1844 | #ifdef MSNFS | 1843 | #ifdef MSNFS |
1845 | if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && | 1844 | if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && |
1846 | (atomic_read(&rdentry->d_count) > 1)) { | 1845 | (rdentry->d_count > 1)) { |
1847 | host_err = -EPERM; | 1846 | host_err = -EPERM; |
1848 | } else | 1847 | } else |
1849 | #endif | 1848 | #endif |