Skip to content

Commit ec193cf

Browse files
author
Al Viro
committed
configfs: don't open-code d_alloc_name()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent d3db90b commit ec193cf

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

fs/configfs/dir.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -660,19 +660,15 @@ static int create_default_group(struct config_group *parent_group,
660660
struct config_group *group)
661661
{
662662
int ret;
663-
struct qstr name;
664663
struct configfs_dirent *sd;
665664
/* We trust the caller holds a reference to parent */
666665
struct dentry *child, *parent = parent_group->cg_item.ci_dentry;
667666

668667
if (!group->cg_item.ci_name)
669668
group->cg_item.ci_name = group->cg_item.ci_namebuf;
670-
name.name = group->cg_item.ci_name;
671-
name.len = strlen(name.name);
672-
name.hash = full_name_hash(name.name, name.len);
673669

674670
ret = -ENOMEM;
675-
child = d_alloc(parent, &name);
671+
child = d_alloc_name(parent, group->cg_item.ci_name);
676672
if (child) {
677673
d_add(child, NULL);
678674

@@ -1650,7 +1646,6 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)
16501646
{
16511647
int err;
16521648
struct config_group *group = &subsys->su_group;
1653-
struct qstr name;
16541649
struct dentry *dentry;
16551650
struct dentry *root;
16561651
struct configfs_dirent *sd;
@@ -1667,12 +1662,8 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)
16671662

16681663
mutex_lock_nested(&root->d_inode->i_mutex, I_MUTEX_PARENT);
16691664

1670-
name.name = group->cg_item.ci_name;
1671-
name.len = strlen(name.name);
1672-
name.hash = full_name_hash(name.name, name.len);
1673-
16741665
err = -ENOMEM;
1675-
dentry = d_alloc(root, &name);
1666+
dentry = d_alloc_name(root, group->cg_item.ci_name);
16761667
if (dentry) {
16771668
d_add(dentry, NULL);
16781669

0 commit comments

Comments
 (0)