Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tejun Heo and committed by
Greg Kroah-Hartman
ba341d55 fa4cd451

+14 -4
+1
fs/Kconfig
··· 96 96 menu "Pseudo filesystems" 97 97 98 98 source "fs/proc/Kconfig" 99 + source "fs/kernfs/Kconfig" 99 100 source "fs/sysfs/Kconfig" 100 101 101 102 config TMPFS
+2 -1
fs/Makefile
··· 52 52 obj-y += quota/ 53 53 54 54 obj-$(CONFIG_PROC_FS) += proc/ 55 - obj-$(CONFIG_SYSFS) += sysfs/ kernfs/ 55 + obj-$(CONFIG_KERNFS) += kernfs/ 56 + obj-$(CONFIG_SYSFS) += sysfs/ 56 57 obj-$(CONFIG_CONFIGFS_FS) += configfs/ 57 58 obj-y += devpts/ 58 59
+7
fs/kernfs/Kconfig
··· 1 + # 2 + # KERNFS should be selected by its users 3 + # 4 + 5 + config KERNFS 6 + bool 7 + default n
+1
fs/sysfs/Kconfig
··· 1 1 config SYSFS 2 2 bool "sysfs file system support" if EXPERT 3 3 default y 4 + select KERNFS 4 5 help 5 6 The sysfs filesystem is a virtual filesystem that the kernel uses to 6 7 export internal kernel objects, their attributes, and their
+3 -3
include/linux/kernfs.h
··· 201 201 #endif 202 202 }; 203 203 204 - #ifdef CONFIG_SYSFS 204 + #ifdef CONFIG_KERNFS 205 205 206 206 static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) 207 207 { ··· 284 284 285 285 void kernfs_init(void); 286 286 287 - #else /* CONFIG_SYSFS */ 287 + #else /* CONFIG_KERNFS */ 288 288 289 289 static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) 290 290 { return 0; } /* whatever */ ··· 379 379 380 380 static inline void kernfs_init(void) { } 381 381 382 - #endif /* CONFIG_SYSFS */ 382 + #endif /* CONFIG_KERNFS */ 383 383 384 384 static inline struct kernfs_node * 385 385 kernfs_find_and_get(struct kernfs_node *kn, const char *name)