diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-29 23:40:14 -0400 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-10-30 22:17:32 +0100 |
commit | e2dab9fb82b262313ecd36454beea93adb73aea3 (patch) | |
tree | 79dbc6c245fa09d6b8e9ff773fd45fff9a0a91c9 /fs/dcache.c | |
parent | 84a43622f3c578b78663cc2742a27e4d2613c697 (diff) | |
download | lwn-e2dab9fb82b262313ecd36454beea93adb73aea3.tar.gz lwn-e2dab9fb82b262313ecd36454beea93adb73aea3.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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'fs/dcache.c')
-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 533a44b8e021..362aa79c90b3 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -274,6 +274,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 @@ -535,11 +544,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; } |