diff options
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 @@ #ifndef __LINUX_KERNFS_H #define __LINUX_KERNFS_H +#include <linux/kernel.h> + struct sysfs_dirent; +#ifdef CONFIG_SYSFS + +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 void kernfs_remove(struct sysfs_dirent *sd) { } + +static inline int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, + const char *name, const void *ns) +{ return -ENOSYS; } + +#endif /* CONFIG_SYSFS */ + +static inline int kernfs_remove_by_name(struct sysfs_dirent *parent, + const char *name) +{ + return kernfs_remove_by_name_ns(parent, name, NULL); +} + #endif /* __LINUX_KERNFS_H */ |