aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-10-04 11:09:01 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-11-09 00:16:21 -0500
commitb61625d24596ea44555943867d5a5c1efd81074c (patch)
tree2cfccb7343ffac47aaa3b95b7354b34cece811d2 /fs/dcache.c
parenteee5cc2702929fd41cce28058dc6d6717f723f87 (diff)
fold __d_shrink() into its only remaining caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index aafa2a146434..fb7bcf3ba5d6 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -483,27 +483,6 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent)
483 return parent; 483 return parent;
484} 484}
485 485
486/*
487 * Unhash a dentry without inserting an RCU walk barrier or checking that
488 * dentry->d_lock is locked. The caller must take care of that, if
489 * appropriate.
490 */
491static void __d_shrink(struct dentry *dentry)
492{
493 if (!d_unhashed(dentry)) {
494 struct hlist_bl_head *b;
495 if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED))
496 b = &dentry->d_sb->s_anon;
497 else
498 b = d_hash(dentry->d_parent, dentry->d_name.hash);
499
500 hlist_bl_lock(b);
501 __hlist_bl_del(&dentry->d_hash);
502 dentry->d_hash.pprev = NULL;
503 hlist_bl_unlock(b);
504 }
505}
506
507/** 486/**
508 * d_drop - drop a dentry 487 * d_drop - drop a dentry
509 * @dentry: dentry to drop 488 * @dentry: dentry to drop
@@ -522,7 +501,16 @@ static void __d_shrink(struct dentry *dentry)
522void __d_drop(struct dentry *dentry) 501void __d_drop(struct dentry *dentry)
523{ 502{
524 if (!d_unhashed(dentry)) { 503 if (!d_unhashed(dentry)) {
525 __d_shrink(dentry); 504 struct hlist_bl_head *b;
505 if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED))
506 b = &dentry->d_sb->s_anon;
507 else
508 b = d_hash(dentry->d_parent, dentry->d_name.hash);
509
510 hlist_bl_lock(b);
511 __hlist_bl_del(&dentry->d_hash);
512 dentry->d_hash.pprev = NULL;
513 hlist_bl_unlock(b);
526 dentry_rcuwalk_barrier(dentry); 514 dentry_rcuwalk_barrier(dentry);
527 } 515 }
528} 516}