aboutsummaryrefslogtreecommitdiffstats
path: root/fs/autofs4/expire.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@kernel.dk>2011-01-07 01:49:32 -0500
committerNick Piggin <npiggin@kernel.dk>2011-01-07 01:50:21 -0500
commitb7ab39f631f505edc2bbdb86620d5493f995c9da (patch)
tree62be97ebc7fc69ceb601f23312d335ebb8038ee7 /fs/autofs4/expire.c
parent2304450783dfde7b0b94ae234edd0dbffa865073 (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/autofs4/expire.c')
-rw-r--r--fs/autofs4/expire.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index a796c9417fb1..413b5642e6cf 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -198,7 +198,7 @@ static int autofs4_tree_busy(struct vfsmount *mnt,
198 else 198 else
199 ino_count++; 199 ino_count++;
200 200
201 if (atomic_read(&p->d_count) > ino_count) { 201 if (p->d_count > ino_count) {
202 top_ino->last_used = jiffies; 202 top_ino->last_used = jiffies;
203 dput(p); 203 dput(p);
204 return 1; 204 return 1;
@@ -347,7 +347,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
347 347
348 /* Path walk currently on this dentry? */ 348 /* Path walk currently on this dentry? */
349 ino_count = atomic_read(&ino->count) + 2; 349 ino_count = atomic_read(&ino->count) + 2;
350 if (atomic_read(&dentry->d_count) > ino_count) 350 if (dentry->d_count > ino_count)
351 goto next; 351 goto next;
352 352
353 /* Can we umount this guy */ 353 /* Can we umount this guy */
@@ -369,7 +369,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
369 if (!exp_leaves) { 369 if (!exp_leaves) {
370 /* Path walk currently on this dentry? */ 370 /* Path walk currently on this dentry? */
371 ino_count = atomic_read(&ino->count) + 1; 371 ino_count = atomic_read(&ino->count) + 1;
372 if (atomic_read(&dentry->d_count) > ino_count) 372 if (dentry->d_count > ino_count)
373 goto next; 373 goto next;
374 374
375 if (!autofs4_tree_busy(mnt, dentry, timeout, do_now)) { 375 if (!autofs4_tree_busy(mnt, dentry, timeout, do_now)) {
@@ -383,7 +383,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
383 } else { 383 } else {
384 /* Path walk currently on this dentry? */ 384 /* Path walk currently on this dentry? */
385 ino_count = atomic_read(&ino->count) + 1; 385 ino_count = atomic_read(&ino->count) + 1;
386 if (atomic_read(&dentry->d_count) > ino_count) 386 if (dentry->d_count > ino_count)
387 goto next; 387 goto next;
388 388
389 expired = autofs4_check_leaves(mnt, dentry, timeout, do_now); 389 expired = autofs4_check_leaves(mnt, dentry, timeout, do_now);