summaryrefslogtreecommitdiffstats
path: root/fs/sysfs/group.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-11-23 23:21:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-27 22:57:56 +0100
commit879f40d193bb3c6c13930e88e3e9d5d7baf84d19 (patch)
treeb09863db44998ae61f572f816e93100cb56250cc /fs/sysfs/group.c
parentsysfs, kernfs: add skeletons for kernfs (diff)
downloadlinux-879f40d193bb3c6c13930e88e3e9d5d7baf84d19.tar.xz
linux-879f40d193bb3c6c13930e88e3e9d5d7baf84d19.zip
sysfs, kernfs: introduce kernfs_remove[_by_name[_ns]]()
Introduce kernfs removal interfaces - kernfs_remove() and kernfs_remove_by_name[_ns](). These are just renames of sysfs_remove() and sysfs_hash_and_remove(). No functional changes. v2: Dummy kernfs_remove_by_name_ns() for !CONFIG_SYSFS updated to return -ENOSYS instead of 0. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/group.c')
-rw-r--r--fs/sysfs/group.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index 1898a10e38ce..4bd997340830 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -26,7 +26,7 @@ static void remove_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,
if (grp->attrs)
for (attr = grp->attrs; *attr; attr++)
- sysfs_hash_and_remove(dir_sd, (*attr)->name, NULL);
+ kernfs_remove_by_name(dir_sd, (*attr)->name);
if (grp->bin_attrs)
for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++)
sysfs_remove_bin_file(kobj, *bin_attr);
@@ -49,8 +49,7 @@ static int create_files(struct sysfs_dirent *dir_sd, struct kobject *kobj,
* re-adding (if required) the file.
*/
if (update)
- sysfs_hash_and_remove(dir_sd, (*attr)->name,
- NULL);
+ kernfs_remove_by_name(dir_sd, (*attr)->name);
if (grp->is_visible) {
mode = grp->is_visible(kobj, *attr, i);
if (!mode)
@@ -111,7 +110,7 @@ static int internal_create_group(struct kobject *kobj, int update,
error = create_files(sd, kobj, grp, update);
if (error) {
if (grp->name)
- sysfs_remove(sd);
+ kernfs_remove(sd);
}
sysfs_put(sd);
return error;
@@ -219,7 +218,7 @@ void sysfs_remove_group(struct kobject *kobj,
remove_files(sd, kobj, grp);
if (grp->name)
- sysfs_remove(sd);
+ kernfs_remove(sd);
sysfs_put(sd);
}
@@ -270,7 +269,7 @@ int sysfs_merge_group(struct kobject *kobj,
error = sysfs_add_file(dir_sd, *attr, SYSFS_KOBJ_ATTR);
if (error) {
while (--i >= 0)
- sysfs_hash_and_remove(dir_sd, (*--attr)->name, NULL);
+ kernfs_remove_by_name(dir_sd, (*--attr)->name);
}
sysfs_put(dir_sd);
@@ -292,7 +291,7 @@ void sysfs_unmerge_group(struct kobject *kobj,
dir_sd = sysfs_get_dirent(kobj->sd, grp->name);
if (dir_sd) {
for (attr = grp->attrs; *attr; ++attr)
- sysfs_hash_and_remove(dir_sd, (*attr)->name, NULL);
+ kernfs_remove_by_name(dir_sd, (*attr)->name);
sysfs_put(dir_sd);
}
}
@@ -335,7 +334,7 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
dir_sd = sysfs_get_dirent(kobj->sd, group_name);
if (dir_sd) {
- sysfs_hash_and_remove(dir_sd, link_name, NULL);
+ kernfs_remove_by_name(dir_sd, link_name);
sysfs_put(dir_sd);
}
}