blob: 83e151ad0619a34d1ede83f58f2bda44d2ff602f [file] [log] [blame]
Tejun Heob8441ed2013-11-24 09:54:58 -05001/*
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 Heo879f40d2013-11-23 17:21:49 -050010#include <linux/kernel.h>
11
Tejun Heob8441ed2013-11-24 09:54:58 -050012struct sysfs_dirent;
13
Tejun Heo879f40d2013-11-23 17:21:49 -050014#ifdef CONFIG_SYSFS
15
16void kernfs_remove(struct sysfs_dirent *sd);
17int kernfs_remove_by_name_ns(struct sysfs_dirent *parent, const char *name,
18 const void *ns);
19
20#else /* CONFIG_SYSFS */
21
22static inline void kernfs_remove(struct sysfs_dirent *sd) { }
23
24static 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
30static 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 Heob8441ed2013-11-24 09:54:58 -050036#endif /* __LINUX_KERNFS_H */