diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-23 17:21:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-27 16:57:57 -0500 |
commit | 890ece160c6465b49c42975d529c3481d89da8f5 (patch) | |
tree | 77cc4d36a9d32d0055a752cae5e3a95806dc87d7 /include/linux/kernfs.h | |
parent | 5d0e26bb59a680a5d97db5b6629941603e8de229 (diff) |
sysfs, kernfs: introduce kernfs_rename[_ns]()
Introduce kernfs rename interface, krenfs_rename[_ns]().
This is just rename of sysfs_rename(). No functional changes.
Function comment is added to kernfs_rename_ns() and @new_parent_sd is
renamed to @new_parent for consistency with other kernfs interfaces.
v2: Dummy implementation for !CONFIG_SYSFS updated to return -ENOSYS.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/kernfs.h')
-rw-r--r-- | include/linux/kernfs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index fe6290d41776..803d9600cf72 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
@@ -20,6 +20,8 @@ struct sysfs_dirent *kernfs_create_link(struct sysfs_dirent *parent, | |||
20 | void kernfs_remove(struct sysfs_dirent *sd); | 20 | void kernfs_remove(struct sysfs_dirent *sd); |
21 | int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, const char *name, | 21 | int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, const char *name, |
22 | const void *ns); | 22 | const void *ns); |
23 | int kernfs_rename_ns(struct sysfs_dirent *sd, struct sysfs_dirent *new_parent, | ||
24 | const char *new_name, const void *new_ns); | ||
23 | 25 | ||
24 | #else /* CONFIG_SYSFS */ | 26 | #else /* CONFIG_SYSFS */ |
25 | 27 | ||
@@ -34,6 +36,11 @@ static inline int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, | |||
34 | const char *name, const void *ns) | 36 | const char *name, const void *ns) |
35 | { return -ENOSYS; } | 37 | { return -ENOSYS; } |
36 | 38 | ||
39 | static inline int kernfs_rename_ns(struct sysfs_dirent *sd, | ||
40 | struct sysfs_dirent *new_parent, | ||
41 | const char *new_name, const void *new_ns) | ||
42 | { return -ENOSYS; } | ||
43 | |||
37 | #endif /* CONFIG_SYSFS */ | 44 | #endif /* CONFIG_SYSFS */ |
38 | 45 | ||
39 | static inline int kernfs_remove_by_name(struct sysfs_dirent *parent, | 46 | static inline int kernfs_remove_by_name(struct sysfs_dirent *parent, |