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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b8441ed279
commit
879f40d193
@@ -952,7 +952,7 @@ void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr,
|
||||
{
|
||||
struct sysfs_dirent *dir_sd = kobj->sd;
|
||||
|
||||
sysfs_hash_and_remove(dir_sd, attr->name, ns);
|
||||
kernfs_remove_by_name_ns(dir_sd, attr->name, ns);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sysfs_remove_file_ns);
|
||||
|
||||
@@ -980,7 +980,7 @@ void sysfs_remove_file_from_group(struct kobject *kobj,
|
||||
else
|
||||
dir_sd = sysfs_get(kobj->sd);
|
||||
if (dir_sd) {
|
||||
sysfs_hash_and_remove(dir_sd, attr->name, NULL);
|
||||
kernfs_remove_by_name(dir_sd, attr->name);
|
||||
sysfs_put(dir_sd);
|
||||
}
|
||||
}
|
||||
@@ -1008,7 +1008,7 @@ EXPORT_SYMBOL_GPL(sysfs_create_bin_file);
|
||||
void sysfs_remove_bin_file(struct kobject *kobj,
|
||||
const struct bin_attribute *attr)
|
||||
{
|
||||
sysfs_hash_and_remove(kobj->sd, attr->attr.name, NULL);
|
||||
kernfs_remove_by_name(kobj->sd, attr->attr.name);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(sysfs_remove_bin_file);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user