diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-17 16:53:29 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:48 -0400 |
commit | 2a152ad3a58508b06b9e0482e68117a79bbb27ce (patch) | |
tree | fd80467e9b4cbeb163eb58239e9400c22946ef84 /fs/configfs/dir.c | |
parent | 0dd6c08a0042ed83037cf5c772d9066e33046427 (diff) |
make configfs_pin_fs() return root dentry on success
... and make configfs_mnt static
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/configfs/dir.c')
-rw-r--r-- | fs/configfs/dir.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 6c560e77965c..7e6c52d8a207 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -1075,16 +1075,15 @@ int configfs_depend_item(struct configfs_subsystem *subsys, | |||
1075 | * Pin the configfs filesystem. This means we can safely access | 1075 | * Pin the configfs filesystem. This means we can safely access |
1076 | * the root of the configfs filesystem. | 1076 | * the root of the configfs filesystem. |
1077 | */ | 1077 | */ |
1078 | ret = configfs_pin_fs(); | 1078 | root = configfs_pin_fs(); |
1079 | if (ret) | 1079 | if (IS_ERR(root)) |
1080 | return ret; | 1080 | return PTR_ERR(root); |
1081 | 1081 | ||
1082 | /* | 1082 | /* |
1083 | * Next, lock the root directory. We're going to check that the | 1083 | * Next, lock the root directory. We're going to check that the |
1084 | * subsystem is really registered, and so we need to lock out | 1084 | * subsystem is really registered, and so we need to lock out |
1085 | * configfs_[un]register_subsystem(). | 1085 | * configfs_[un]register_subsystem(). |
1086 | */ | 1086 | */ |
1087 | root = configfs_mount->mnt_root; | ||
1088 | mutex_lock(&root->d_inode->i_mutex); | 1087 | mutex_lock(&root->d_inode->i_mutex); |
1089 | 1088 | ||
1090 | root_sd = root->d_fsdata; | 1089 | root_sd = root->d_fsdata; |
@@ -1673,14 +1672,13 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys) | |||
1673 | struct dentry *root; | 1672 | struct dentry *root; |
1674 | struct configfs_dirent *sd; | 1673 | struct configfs_dirent *sd; |
1675 | 1674 | ||
1676 | err = configfs_pin_fs(); | 1675 | root = configfs_pin_fs(); |
1677 | if (err) | 1676 | if (IS_ERR(root)) |
1678 | return err; | 1677 | return PTR_ERR(root); |
1679 | 1678 | ||
1680 | if (!group->cg_item.ci_name) | 1679 | if (!group->cg_item.ci_name) |
1681 | group->cg_item.ci_name = group->cg_item.ci_namebuf; | 1680 | group->cg_item.ci_name = group->cg_item.ci_namebuf; |
1682 | 1681 | ||
1683 | root = configfs_mount->mnt_root; | ||
1684 | sd = root->d_fsdata; | 1682 | sd = root->d_fsdata; |
1685 | link_group(to_config_group(sd->s_element), group); | 1683 | link_group(to_config_group(sd->s_element), group); |
1686 | 1684 | ||