Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217807
b: refs/heads/master
c: 9c82ab9
h: refs/heads/master
i:
  217805: 8020d6e
  217803: 863bdc7
  217799: c318acc
  217791: 0b2e44e
v: v3
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Oct 26, 2010
1 parent cb02c1d commit fb1b7a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be148247cfbe2422f5709e77d9c3e10b8a6394da
refs/heads/master: 9c82ab9c9e16cb9edf17bd0d31f3d6904afce04f
14 changes: 5 additions & 9 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
}

/*
Expand Down

0 comments on commit fb1b7a3

Please sign in to comment.