summaryrefslogtreecommitdiff
path: root/fs/afs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-09-05 13:44:38 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-06 00:23:51 +0400
commitba81238076d368b9bb78a7fbf6c621b49d4d602f (patch)
treef7952e89e39cca6f4e4c68b4aea9a8d14ba2e3cc /fs/afs
parenteed810076685c77dc9a8c5c3593e641c93caed1c (diff)
downloadlinux-ba81238076d368b9bb78a7fbf6c621b49d4d602f.tar.xz
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>
Diffstat (limited to 'fs/afs')
-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:
spin_unlock(&dentry->d_lock);
out_bad:
- if (dentry->d_inode) {
- /* don't unhash if we have submounts */
- if (have_submounts(dentry))
- goto out_skip;
- }
+ /* don't unhash if we have submounts */
+ if (check_submounts_and_drop(dentry) != 0)
+ goto out_skip;
_debug("dropping dentry %s/%s",
parent->d_name.name, dentry->d_name.name);
- shrink_dcache_parent(dentry);
- d_drop(dentry);
dput(parent);
key_put(key);