diff options
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 6dd58ced8236..982d97bbb72c 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -284,25 +284,23 @@ static inline int dname_external(const struct dentry *dentry) void take_dentry_name_snapshot(struct name_snapshot *name, struct dentry *dentry) { spin_lock(&dentry->d_lock); + name->name = dentry->d_name; if (unlikely(dname_external(dentry))) { - struct external_name *p = external_name(dentry); - atomic_inc(&p->u.count); - spin_unlock(&dentry->d_lock); - name->name = p->name; + atomic_inc(&external_name(dentry)->u.count); } else { memcpy(name->inline_name, dentry->d_iname, dentry->d_name.len + 1); - spin_unlock(&dentry->d_lock); - name->name = name->inline_name; + name->name.name = name->inline_name; } + spin_unlock(&dentry->d_lock); } EXPORT_SYMBOL(take_dentry_name_snapshot); void release_dentry_name_snapshot(struct name_snapshot *name) { - if (unlikely(name->name != name->inline_name)) { + if (unlikely(name->name.name != name->inline_name)) { struct external_name *p; - p = container_of(name->name, struct external_name, name[0]); + p = container_of(name->name.name, struct external_name, name[0]); if (unlikely(atomic_dec_and_test(&p->u.count))) kfree_rcu(p, u.head); } |