2 * kernfs.h - pseudo filesystem decoupled from vfs locking
4 * This file is released under the GPLv2.
7 #ifndef __LINUX_KERNFS_H
8 #define __LINUX_KERNFS_H
10 #include <linux/kernel.h>
11 #include <linux/err.h>
17 struct sysfs_dirent *kernfs_create_link(struct sysfs_dirent *parent,
19 struct sysfs_dirent *target);
20 void kernfs_remove(struct sysfs_dirent *sd);
21 int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, const char *name,
24 #else /* CONFIG_SYSFS */
26 static inline struct sysfs_dirent *
27 kernfs_create_link(struct sysfs_dirent *parent, const char *name,
28 struct sysfs_dirent *target)
29 { return ERR_PTR(-ENOSYS); }
31 static inline void kernfs_remove(struct sysfs_dirent *sd) { }
33 static inline int kernfs_remove_by_name_ns(struct sysfs_dirent *parent,
34 const char *name, const void *ns)
37 #endif /* CONFIG_SYSFS */
39 static inline int kernfs_remove_by_name(struct sysfs_dirent *parent,
42 return kernfs_remove_by_name_ns(parent, name, NULL);
45 #endif /* __LINUX_KERNFS_H */