Tejun Heo | b8441ed | 2013-11-24 09:54:58 -0500 | [diff] [blame] | 1 | /* |
| 2 | * kernfs.h - pseudo filesystem decoupled from vfs locking |
| 3 | * |
| 4 | * This file is released under the GPLv2. |
| 5 | */ |
| 6 | |
| 7 | #ifndef __LINUX_KERNFS_H |
| 8 | #define __LINUX_KERNFS_H |
| 9 | |
Tejun Heo | 879f40d | 2013-11-23 17:21:49 -0500 | [diff] [blame^] | 10 | #include <linux/kernel.h> |
| 11 | |
Tejun Heo | b8441ed | 2013-11-24 09:54:58 -0500 | [diff] [blame] | 12 | struct sysfs_dirent; |
| 13 | |
Tejun Heo | 879f40d | 2013-11-23 17:21:49 -0500 | [diff] [blame^] | 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 | |
Tejun Heo | b8441ed | 2013-11-24 09:54:58 -0500 | [diff] [blame] | 36 | #endif /* __LINUX_KERNFS_H */ |