diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2009-11-20 16:08:57 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 11:24:54 -0800 |
commit | ca1bab38195d66bdf42320a99cc7359434a271d3 (patch) | |
tree | 4394403b4a85fb269d052b7852b41ee0f7ba8a88 /fs/sysfs/sysfs.h | |
parent | 832b6af198aefe6034310e124594cc8b833c0ef9 (diff) | |
download | linux-stable-ca1bab38195d66bdf42320a99cc7359434a271d3.tar.gz linux-stable-ca1bab38195d66bdf42320a99cc7359434a271d3.tar.bz2 linux-stable-ca1bab38195d66bdf42320a99cc7359434a271d3.zip |
sysfs: Factor out sysfs_rename from sysfs_rename_dir and sysfs_move_dir
These two functions do 90% of the same work and it doesn't significantly
obfuscate the function to allow both the parent dir and the name to change
at the same time. So merge them together to simplify maintenance, and
increase testing.
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r-- | fs/sysfs/sysfs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index 98a15bf1efe1..ca52e7b9d8f8 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -130,6 +130,9 @@ int sysfs_create_subdir(struct kobject *kobj, const char *name, struct sysfs_dirent **p_sd); void sysfs_remove_subdir(struct sysfs_dirent *sd); +int sysfs_rename(struct sysfs_dirent *sd, + struct sysfs_dirent *new_parent_sd, const char *new_name); + static inline struct sysfs_dirent *__sysfs_get(struct sysfs_dirent *sd) { if (sd) { |