aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-07-14 09:16:52 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-07-14 09:16:52 -0400
commitec193cf5af0a8dc35c3975ca0aca8e7b7f3e3464 (patch)
treea55782c9ccf3c6458e70216c8b51e9facc9654f1
parentd3db90b0a448bfdf77ab3d887c9579fead656cc5 (diff)
configfs: don't open-code d_alloc_name()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/configfs/dir.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 64e5323cbbb0..437b0d535b33 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -660,19 +660,15 @@ static int create_default_group(struct config_group *parent_group,
660 struct config_group *group) 660 struct config_group *group)
661{ 661{
662 int ret; 662 int ret;
663 struct qstr name;
664 struct configfs_dirent *sd; 663 struct configfs_dirent *sd;
665 /* We trust the caller holds a reference to parent */ 664 /* We trust the caller holds a reference to parent */
666 struct dentry *child, *parent = parent_group->cg_item.ci_dentry; 665 struct dentry *child, *parent = parent_group->cg_item.ci_dentry;
667 666
668 if (!group->cg_item.ci_name) 667 if (!group->cg_item.ci_name)
669 group->cg_item.ci_name = group->cg_item.ci_namebuf; 668 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);
673 669
674 ret = -ENOMEM; 670 ret = -ENOMEM;
675 child = d_alloc(parent, &name); 671 child = d_alloc_name(parent, group->cg_item.ci_name);
676 if (child) { 672 if (child) {
677 d_add(child, NULL); 673 d_add(child, NULL);
678 674
@@ -1650,7 +1646,6 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)
1650{ 1646{
1651 int err; 1647 int err;
1652 struct config_group *group = &subsys->su_group; 1648 struct config_group *group = &subsys->su_group;
1653 struct qstr name;
1654 struct dentry *dentry; 1649 struct dentry *dentry;
1655 struct dentry *root; 1650 struct dentry *root;
1656 struct configfs_dirent *sd; 1651 struct configfs_dirent *sd;
@@ -1667,12 +1662,8 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)
1667 1662
1668 mutex_lock_nested(&root->d_inode->i_mutex, I_MUTEX_PARENT); 1663 mutex_lock_nested(&root->d_inode->i_mutex, I_MUTEX_PARENT);
1669 1664
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
1674 err = -ENOMEM; 1665 err = -ENOMEM;
1675 dentry = d_alloc(root, &name); 1666 dentry = d_alloc_name(root, group->cg_item.ci_name);
1676 if (dentry) { 1667 if (dentry) {
1677 d_add(dentry, NULL); 1668 d_add(dentry, NULL);
1678 1669