aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-09-05 05:44:38 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-05 16:23:51 -0400
commitba81238076d368b9bb78a7fbf6c621b49d4d602f (patch)
treef7952e89e39cca6f4e4c68b4aea9a8d14ba2e3cc
parenteed810076685c77dc9a8c5c3593e641c93caed1c (diff)
afs: use check_submounts_and_drop()
Do have_submounts(), shrink_dcache_parent() and d_drop() atomically. check_submounts_and_drop() can deal with negative dentries as well. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/afs/dir.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 34494fbead0a..0b74d3176ab7 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -685,16 +685,12 @@ not_found:
685 spin_unlock(&dentry->d_lock); 685 spin_unlock(&dentry->d_lock);
686 686
687out_bad: 687out_bad:
688 if (dentry->d_inode) { 688 /* don't unhash if we have submounts */
689 /* don't unhash if we have submounts */ 689 if (check_submounts_and_drop(dentry) != 0)
690 if (have_submounts(dentry)) 690 goto out_skip;
691 goto out_skip;
692 }
693 691
694 _debug("dropping dentry %s/%s", 692 _debug("dropping dentry %s/%s",
695 parent->d_name.name, dentry->d_name.name); 693 parent->d_name.name, dentry->d_name.name);
696 shrink_dcache_parent(dentry);
697 d_drop(dentry);
698 dput(parent); 694 dput(parent);
699 key_put(key); 695 key_put(key);
700 696