diff options
author | Tejun Heo <tj@kernel.org> | 2013-11-23 17:21:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-27 16:57:56 -0500 |
commit | 879f40d193bb3c6c13930e88e3e9d5d7baf84d19 (patch) | |
tree | b09863db44998ae61f572f816e93100cb56250cc /include/linux/kernfs.h | |
parent | b8441ed279bff09a0a5ddeacf8f4087d2fb424ca (diff) |
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 'include/linux/kernfs.h')
-rw-r--r-- | include/linux/kernfs.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 254b9e872b09..83e151ad0619 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
@@ -7,6 +7,30 @@ | |||
7 | #ifndef __LINUX_KERNFS_H | 7 | #ifndef __LINUX_KERNFS_H |
8 | #define __LINUX_KERNFS_H | 8 | #define __LINUX_KERNFS_H |
9 | 9 | ||
10 | #include <linux/kernel.h> | ||
11 | |||
10 | struct sysfs_dirent; | 12 | struct sysfs_dirent; |
11 | 13 | ||
14 | #ifdef CONFIG_SYSFS | ||
15 | |||
16 | void kernfs_remove(struct sysfs_dirent *sd); | ||
17 | int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, const char *name, | ||
18 | const void *ns); | ||
19 | |||
20 | #else /* CONFIG_SYSFS */ | ||
21 | |||
22 | static inline void kernfs_remove(struct sysfs_dirent *sd) { } | ||
23 | |||
24 | static inline int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, | ||
25 | const char *name, const void *ns) | ||
26 | { return -ENOSYS; } | ||
27 | |||
28 | #endif /* CONFIG_SYSFS */ | ||
29 | |||
30 | static inline int kernfs_remove_by_name(struct sysfs_dirent *parent, | ||
31 | const char *name) | ||
32 | { | ||
33 | return kernfs_remove_by_name_ns(parent, name, NULL); | ||
34 | } | ||
35 | |||
12 | #endif /* __LINUX_KERNFS_H */ | 36 | #endif /* __LINUX_KERNFS_H */ |