diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-29 23:40:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-16 20:51:52 -0700 |
commit | 5d81116c6b24c3b594517d9d9b43b6a50f52deee (patch) | |
tree | d14ea422d486e2e942cceaf23b4c593377c0c9c0 | |
parent | a76c1ead571726cb327a63886de1d531f4b21de3 (diff) | |
download | lwn-5d81116c6b24c3b594517d9d9b43b6a50f52deee.tar.gz lwn-5d81116c6b24c3b594517d9d9b43b6a50f52deee.zip |
new helper: dentry_free()
commit b4f0354e968f5fabd39bc85b99fedae4a97589fe upstream.
The part of old d_free() that dealt with actual freeing of dentry.
Taken out of dentry_kill() into a separate function.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/dcache.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 1dc738a8815d..3a0f252cc1b8 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -244,6 +244,15 @@ static void __d_free(struct rcu_head *head) kmem_cache_free(dentry_cache, dentry); } +static void dentry_free(struct dentry *dentry) +{ + /* if dentry was never visible to RCU, immediate free is OK */ + if (!(dentry->d_flags & DCACHE_RCUACCESS)) + __d_free(&dentry->d_u.d_rcu); + else + call_rcu(&dentry->d_u.d_rcu, __d_free); +} + /** * dentry_rcuwalk_barrier - invalidate in-progress rcu-walk lookups * @dentry: the target dentry @@ -511,11 +520,7 @@ relock: if (dentry->d_op && dentry->d_op->d_release) dentry->d_op->d_release(dentry); - /* if dentry was never visible to RCU, immediate free is OK */ - if (!(dentry->d_flags & DCACHE_RCUACCESS)) - __d_free(&dentry->d_u.d_rcu); - else - call_rcu(&dentry->d_u.d_rcu, __d_free); + dentry_free(dentry); return parent; } |