summaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index a9f995f6859e..95efb7b2bf84 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -90,6 +90,11 @@ EXPORT_SYMBOL(rename_lock);
90 90
91static struct kmem_cache *dentry_cache __read_mostly; 91static struct kmem_cache *dentry_cache __read_mostly;
92 92
93const struct qstr empty_name = QSTR_INIT("", 0);
94EXPORT_SYMBOL(empty_name);
95const struct qstr slash_name = QSTR_INIT("/", 1);
96EXPORT_SYMBOL(slash_name);
97
93/* 98/*
94 * This is the single most critical data structure when it comes 99 * This is the single most critical data structure when it comes
95 * to the dcache: the hashtable for lookups. Somebody should try 100 * to the dcache: the hashtable for lookups. Somebody should try
@@ -1578,8 +1583,7 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
1578 */ 1583 */
1579 dentry->d_iname[DNAME_INLINE_LEN-1] = 0; 1584 dentry->d_iname[DNAME_INLINE_LEN-1] = 0;
1580 if (unlikely(!name)) { 1585 if (unlikely(!name)) {
1581 static const struct qstr anon = QSTR_INIT("/", 1); 1586 name = &slash_name;
1582 name = &anon;
1583 dname = dentry->d_iname; 1587 dname = dentry->d_iname;
1584 } else if (name->len > DNAME_INLINE_LEN-1) { 1588 } else if (name->len > DNAME_INLINE_LEN-1) {
1585 size_t size = offsetof(struct external_name, name[1]); 1589 size_t size = offsetof(struct external_name, name[1]);