kernfs: add CONFIG_KERNFS
As sysfs was kernfs's only user, kernfs has been piggybacking on CONFIG_SYSFS; however, kernfs is scheduled to grow a new user very soon. Introduce a separate config option CONFIG_KERNFS which is to be selected by kernfs users. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
fa4cd451cc
commit
ba341d55a4
@@ -96,6 +96,7 @@ endif # BLOCK
|
|||||||
menu "Pseudo filesystems"
|
menu "Pseudo filesystems"
|
||||||
|
|
||||||
source "fs/proc/Kconfig"
|
source "fs/proc/Kconfig"
|
||||||
|
source "fs/kernfs/Kconfig"
|
||||||
source "fs/sysfs/Kconfig"
|
source "fs/sysfs/Kconfig"
|
||||||
|
|
||||||
config TMPFS
|
config TMPFS
|
||||||
|
@@ -52,7 +52,8 @@ obj-$(CONFIG_FHANDLE) += fhandle.o
|
|||||||
obj-y += quota/
|
obj-y += quota/
|
||||||
|
|
||||||
obj-$(CONFIG_PROC_FS) += proc/
|
obj-$(CONFIG_PROC_FS) += proc/
|
||||||
obj-$(CONFIG_SYSFS) += sysfs/ kernfs/
|
obj-$(CONFIG_KERNFS) += kernfs/
|
||||||
|
obj-$(CONFIG_SYSFS) += sysfs/
|
||||||
obj-$(CONFIG_CONFIGFS_FS) += configfs/
|
obj-$(CONFIG_CONFIGFS_FS) += configfs/
|
||||||
obj-y += devpts/
|
obj-y += devpts/
|
||||||
|
|
||||||
|
7
fs/kernfs/Kconfig
Normal file
7
fs/kernfs/Kconfig
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#
|
||||||
|
# KERNFS should be selected by its users
|
||||||
|
#
|
||||||
|
|
||||||
|
config KERNFS
|
||||||
|
bool
|
||||||
|
default n
|
@@ -1,6 +1,7 @@
|
|||||||
config SYSFS
|
config SYSFS
|
||||||
bool "sysfs file system support" if EXPERT
|
bool "sysfs file system support" if EXPERT
|
||||||
default y
|
default y
|
||||||
|
select KERNFS
|
||||||
help
|
help
|
||||||
The sysfs filesystem is a virtual filesystem that the kernel uses to
|
The sysfs filesystem is a virtual filesystem that the kernel uses to
|
||||||
export internal kernel objects, their attributes, and their
|
export internal kernel objects, their attributes, and their
|
||||||
|
@@ -201,7 +201,7 @@ struct kernfs_ops {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_SYSFS
|
#ifdef CONFIG_KERNFS
|
||||||
|
|
||||||
static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
|
static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
|
||||||
{
|
{
|
||||||
@@ -284,7 +284,7 @@ void kernfs_kill_sb(struct super_block *sb);
|
|||||||
|
|
||||||
void kernfs_init(void);
|
void kernfs_init(void);
|
||||||
|
|
||||||
#else /* CONFIG_SYSFS */
|
#else /* CONFIG_KERNFS */
|
||||||
|
|
||||||
static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
|
static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
|
||||||
{ return 0; } /* whatever */
|
{ return 0; } /* whatever */
|
||||||
@@ -379,7 +379,7 @@ static inline void kernfs_kill_sb(struct super_block *sb) { }
|
|||||||
|
|
||||||
static inline void kernfs_init(void) { }
|
static inline void kernfs_init(void) { }
|
||||||
|
|
||||||
#endif /* CONFIG_SYSFS */
|
#endif /* CONFIG_KERNFS */
|
||||||
|
|
||||||
static inline struct kernfs_node *
|
static inline struct kernfs_node *
|
||||||
kernfs_find_and_get(struct kernfs_node *kn, const char *name)
|
kernfs_find_and_get(struct kernfs_node *kn, const char *name)
|
||||||
|
Reference in New Issue
Block a user