Commit e7f269e2 authored by Al Viro's avatar Al Viro Committed by Jiri Slaby

fold __d_shrink() into its only remaining caller

commit b61625d2 upstream.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 346c766f
No related merge requests found
...@@ -480,27 +480,6 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent) ...@@ -480,27 +480,6 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent)
return parent; return parent;
} }
/*
* Unhash a dentry without inserting an RCU walk barrier or checking that
* dentry->d_lock is locked. The caller must take care of that, if
* appropriate.
*/
static void __d_shrink(struct dentry *dentry)
{
if (!d_unhashed(dentry)) {
struct hlist_bl_head *b;
if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED))
b = &dentry->d_sb->s_anon;
else
b = d_hash(dentry->d_parent, dentry->d_name.hash);
hlist_bl_lock(b);
__hlist_bl_del(&dentry->d_hash);
dentry->d_hash.pprev = NULL;
hlist_bl_unlock(b);
}
}
/** /**
* d_drop - drop a dentry * d_drop - drop a dentry
* @dentry: dentry to drop * @dentry: dentry to drop
...@@ -519,7 +498,16 @@ static void __d_shrink(struct dentry *dentry) ...@@ -519,7 +498,16 @@ static void __d_shrink(struct dentry *dentry)
void __d_drop(struct dentry *dentry) void __d_drop(struct dentry *dentry)
{ {
if (!d_unhashed(dentry)) { if (!d_unhashed(dentry)) {
__d_shrink(dentry); struct hlist_bl_head *b;
if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED))
b = &dentry->d_sb->s_anon;
else
b = d_hash(dentry->d_parent, dentry->d_name.hash);
hlist_bl_lock(b);
__hlist_bl_del(&dentry->d_hash);
dentry->d_hash.pprev = NULL;
hlist_bl_unlock(b);
dentry_rcuwalk_barrier(dentry); dentry_rcuwalk_barrier(dentry);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment