diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-23 17:21:50 -0500 |
---|---|---|
committer | Pawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local> | 2015-03-27 14:37:25 +0100 |
commit | 426887cf836d180b4e9aee11984656dd728c95d7 (patch) | |
tree | eaa6c0dfb8151aa9749fccdbf5090d282832a4f8 /include | |
parent | 43041b5e368bf7e80bf0c493723b14d0be2d6b86 (diff) | |
download | linux-3.10-426887cf836d180b4e9aee11984656dd728c95d7.tar.gz linux-3.10-426887cf836d180b4e9aee11984656dd728c95d7.tar.bz2 linux-3.10-426887cf836d180b4e9aee11984656dd728c95d7.zip |
sysfs, kernfs: introduce kernfs_create_link()
Separate out kernfs symlink interface - kernfs_create_link() - which
takes and returns sysfs_dirents, from sysfs_do_create_link_sd().
sysfs_do_create_link_sd() now just determines the parent and target
sysfs_dirents and invokes the new interface and handles dup warning.
This patch doesn't introduce behavior changes.
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')
-rw-r--r-- | include/linux/kernfs.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 83e151ad061..fe6290d4177 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -8,17 +8,26 @@ #define __LINUX_KERNFS_H #include <linux/kernel.h> +#include <linux/err.h> struct sysfs_dirent; #ifdef CONFIG_SYSFS +struct sysfs_dirent *kernfs_create_link(struct sysfs_dirent *parent, + const char *name, + struct sysfs_dirent *target); void kernfs_remove(struct sysfs_dirent *sd); int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, const char *name, const void *ns); #else /* CONFIG_SYSFS */ +static inline struct sysfs_dirent * +kernfs_create_link(struct sysfs_dirent *parent, const char *name, + struct sysfs_dirent *target) +{ return ERR_PTR(-ENOSYS); } + static inline void kernfs_remove(struct sysfs_dirent *sd) { } static inline int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, |