mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
VFS: Provide empty name qstr
Provide an empty name (ie. "") qstr for general use. Signed-off-by: David Howells <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
ee416bcdba
commit
cdf01226b2
6 changed files with 15 additions and 10 deletions
|
|
@ -90,6 +90,11 @@ EXPORT_SYMBOL(rename_lock);
|
|||
|
||||
static struct kmem_cache *dentry_cache __read_mostly;
|
||||
|
||||
const struct qstr empty_name = QSTR_INIT("", 0);
|
||||
EXPORT_SYMBOL(empty_name);
|
||||
const struct qstr slash_name = QSTR_INIT("/", 1);
|
||||
EXPORT_SYMBOL(slash_name);
|
||||
|
||||
/*
|
||||
* This is the single most critical data structure when it comes
|
||||
* 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)
|
|||
*/
|
||||
dentry->d_iname[DNAME_INLINE_LEN-1] = 0;
|
||||
if (unlikely(!name)) {
|
||||
static const struct qstr anon = QSTR_INIT("/", 1);
|
||||
name = &anon;
|
||||
name = &slash_name;
|
||||
dname = dentry->d_iname;
|
||||
} else if (name->len > DNAME_INLINE_LEN-1) {
|
||||
size_t size = offsetof(struct external_name, name[1]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue