Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba812380 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Al Viro
Browse files

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: default avatarMiklos Szeredi <mszeredi@suse.cz>
CC: David Howells <dhowells@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent eed81007
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -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))
	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);