diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-10-10 05:36:22 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-25 21:26:12 -0400 |
commit | 9c82ab9c9e16cb9edf17bd0d31f3d6904afce04f (patch) | |
tree | 82701029a920b1550f1234a8630ff0243ac3651c /fs | |
parent | be148247cfbe2422f5709e77d9c3e10b8a6394da (diff) | |
download | linux-9c82ab9c9e16cb9edf17bd0d31f3d6904afce04f.tar.bz2 |
fs: simplify __d_free
Remove d_callback and always call __d_free with a RCU head.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dcache.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 54f93f5e6b0f..028753951e95 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -67,20 +67,16 @@ struct dentry_stat_t dentry_stat = { .age_limit = 45, }; -static void __d_free(struct dentry *dentry) +static void __d_free(struct rcu_head *head) { + struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu); + WARN_ON(!list_empty(&dentry->d_alias)); if (dname_external(dentry)) kfree(dentry->d_name.name); kmem_cache_free(dentry_cache, dentry); } -static void d_callback(struct rcu_head *head) -{ - struct dentry * dentry = container_of(head, struct dentry, d_u.d_rcu); - __d_free(dentry); -} - /* * no dcache_lock, please. The caller must decrement dentry_stat.nr_dentry * inside dcache_lock. @@ -91,9 +87,9 @@ static void d_free(struct dentry *dentry) dentry->d_op->d_release(dentry); /* if dentry was never inserted into hash, immediate free is OK */ if (hlist_unhashed(&dentry->d_hash)) - __d_free(dentry); + __d_free(&dentry->d_u.d_rcu); else - call_rcu(&dentry->d_u.d_rcu, d_callback); + call_rcu(&dentry->d_u.d_rcu, __d_free); } /* |