aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-02-03 14:09:17 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-07 19:08:57 -0500
commitba341d55a420ab4fdd1a53fd395fd59bd65de880 (patch)
tree2de1c2cfc849e34434b275d78a9b40962418912a
parentfa4cd451cceb77e97432b91fcf50a7e4a7361e29 (diff)
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>
-rw-r--r--fs/Kconfig1
-rw-r--r--fs/Makefile3
-rw-r--r--fs/kernfs/Kconfig7
-rw-r--r--fs/sysfs/Kconfig1
-rw-r--r--include/linux/kernfs.h6
5 files changed, 14 insertions, 4 deletions
diff --git a/fs/Kconfig b/fs/Kconfig
index 7385e54be4b9..312393f32948 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -96,6 +96,7 @@ endif # BLOCK
96menu "Pseudo filesystems" 96menu "Pseudo filesystems"
97 97
98source "fs/proc/Kconfig" 98source "fs/proc/Kconfig"
99source "fs/kernfs/Kconfig"
99source "fs/sysfs/Kconfig" 100source "fs/sysfs/Kconfig"
100 101
101config TMPFS 102config TMPFS
diff --git a/fs/Makefile b/fs/Makefile
index 47ac07bb4acc..f9cb9876e466 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -52,7 +52,8 @@ obj-$(CONFIG_FHANDLE) += fhandle.o
52obj-y += quota/ 52obj-y += quota/
53 53
54obj-$(CONFIG_PROC_FS) += proc/ 54obj-$(CONFIG_PROC_FS) += proc/
55obj-$(CONFIG_SYSFS) += sysfs/ kernfs/ 55obj-$(CONFIG_KERNFS) += kernfs/
56obj-$(CONFIG_SYSFS) += sysfs/
56obj-$(CONFIG_CONFIGFS_FS) += configfs/ 57obj-$(CONFIG_CONFIGFS_FS) += configfs/
57obj-y += devpts/ 58obj-y += devpts/
58 59
diff --git a/fs/kernfs/Kconfig b/fs/kernfs/Kconfig
new file mode 100644
index 000000000000..397b5f7a7a16
--- /dev/null
+++ b/fs/kernfs/Kconfig
@@ -0,0 +1,7 @@
1#
2# KERNFS should be selected by its users
3#
4
5config KERNFS
6 bool
7 default n
diff --git a/fs/sysfs/Kconfig b/fs/sysfs/Kconfig
index 8c41feacbac5..b2756014508c 100644
--- a/fs/sysfs/Kconfig
+++ b/fs/sysfs/Kconfig
@@ -1,6 +1,7 @@
1config SYSFS 1config SYSFS
2 bool "sysfs file system support" if EXPERT 2 bool "sysfs file system support" if EXPERT
3 default y 3 default y
4 select KERNFS
4 help 5 help
5 The sysfs filesystem is a virtual filesystem that the kernel uses to 6 The sysfs filesystem is a virtual filesystem that the kernel uses to
6 export internal kernel objects, their attributes, and their 7 export internal kernel objects, their attributes, and their
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index 8736ee86a1d6..649497a56a95 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -201,7 +201,7 @@ struct kernfs_ops {
201#endif 201#endif
202}; 202};
203 203
204#ifdef CONFIG_SYSFS 204#ifdef CONFIG_KERNFS
205 205
206static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) 206static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
207{ 207{
@@ -284,7 +284,7 @@ void kernfs_kill_sb(struct super_block *sb);
284 284
285void kernfs_init(void); 285void kernfs_init(void);
286 286
287#else /* CONFIG_SYSFS */ 287#else /* CONFIG_KERNFS */
288 288
289static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) 289static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
290{ return 0; } /* whatever */ 290{ return 0; } /* whatever */
@@ -379,7 +379,7 @@ static inline void kernfs_kill_sb(struct super_block *sb) { }
379 379
380static inline void kernfs_init(void) { } 380static inline void kernfs_init(void) { }
381 381
382#endif /* CONFIG_SYSFS */ 382#endif /* CONFIG_KERNFS */
383 383
384static inline struct kernfs_node * 384static inline struct kernfs_node *
385kernfs_find_and_get(struct kernfs_node *kn, const char *name) 385kernfs_find_and_get(struct kernfs_node *kn, const char *name)