linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH 10/10] kernfs: add CONFIG_KERNFS
Date: Mon,  3 Feb 2014 14:09:17 -0500	[thread overview]
Message-ID: <1391454557-32376-11-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1391454557-32376-1-git-send-email-tj@kernel.org>

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
---
 fs/Kconfig             | 1 +
 fs/Makefile            | 3 ++-
 fs/kernfs/Kconfig      | 7 +++++++
 fs/sysfs/Kconfig       | 1 +
 include/linux/kernfs.h | 6 +++---
 5 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 fs/kernfs/Kconfig

diff --git a/fs/Kconfig b/fs/Kconfig
index 7385e54..312393f 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -96,6 +96,7 @@ endif # BLOCK
 menu "Pseudo filesystems"
 
 source "fs/proc/Kconfig"
+source "fs/kernfs/Kconfig"
 source "fs/sysfs/Kconfig"
 
 config TMPFS
diff --git a/fs/Makefile b/fs/Makefile
index 47ac07b..f9cb987 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -52,7 +52,8 @@ obj-$(CONFIG_FHANDLE)		+= fhandle.o
 obj-y				+= quota/
 
 obj-$(CONFIG_PROC_FS)		+= proc/
-obj-$(CONFIG_SYSFS)		+= sysfs/ kernfs/
+obj-$(CONFIG_KERNFS)		+= kernfs/
+obj-$(CONFIG_SYSFS)		+= sysfs/
 obj-$(CONFIG_CONFIGFS_FS)	+= configfs/
 obj-y				+= devpts/
 
diff --git a/fs/kernfs/Kconfig b/fs/kernfs/Kconfig
new file mode 100644
index 0000000..397b5f7
--- /dev/null
+++ b/fs/kernfs/Kconfig
@@ -0,0 +1,7 @@
+#
+# KERNFS should be selected by its users
+#
+
+config KERNFS
+	bool
+	default n
diff --git a/fs/sysfs/Kconfig b/fs/sysfs/Kconfig
index 8c41fea..b275601 100644
--- a/fs/sysfs/Kconfig
+++ b/fs/sysfs/Kconfig
@@ -1,6 +1,7 @@
 config SYSFS
 	bool "sysfs file system support" if EXPERT
 	default y
+	select KERNFS
 	help
 	The sysfs filesystem is a virtual filesystem that the kernel uses to
 	export internal kernel objects, their attributes, and their
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index b7cb267..32b696f 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -201,7 +201,7 @@ struct kernfs_ops {
 #endif
 };
 
-#ifdef CONFIG_SYSFS
+#ifdef CONFIG_KERNFS
 
 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);
 
-#else	/* CONFIG_SYSFS */
+#else	/* CONFIG_KERNFS */
 
 static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
 { return 0; }	/* whatever */
@@ -379,7 +379,7 @@ static inline void kernfs_kill_sb(struct super_block *sb) { }
 
 static inline void kernfs_init(void) { }
 
-#endif	/* CONFIG_SYSFS */
+#endif	/* CONFIG_KERNFS */
 
 static inline struct kernfs_node *
 kernfs_find_and_get(struct kernfs_node *kn, const char *name)
-- 
1.8.5.3


  parent reply	other threads:[~2014-02-03 19:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03 19:09 [PATCHSET v2 driver-core-next] kernfs: prepare for cgroup's kernfs conversion Tejun Heo
2014-02-03 19:09 ` [PATCH 01/10] kernfs: invoke dir_ops while holding active ref of the target node Tejun Heo
2014-02-03 19:09 ` [PATCH 02/10] kernfs: rename kernfs_dir_ops to kernfs_syscall_ops Tejun Heo
2014-02-03 19:09 ` [PATCH 03/10] kernfs: implement kernfs_syscall_ops->remount_fs() and ->show_options() Tejun Heo
2014-02-03 19:09 ` [PATCH 04/10] kernfs: add missing kernfs_active() checks in directory operations Tejun Heo
2014-02-03 19:09 ` [PATCH 05/10] kernfs: allow nodes to be created in the deactivated state Tejun Heo
2014-02-03 19:09 ` [PATCH 06/10] kernfs: implement kernfs_ops->atomic_write_len Tejun Heo
2014-02-03 19:09 ` [PATCH 07/10] kernfs: add kernfs_open_file->priv Tejun Heo
2014-02-03 19:09 ` [PATCH 08/10] kernfs: implement kernfs_node_from_dentry(), kernfs_root_from_sb() and kernfs_rename() Tejun Heo
2014-02-03 19:09 ` [PATCH 09/10] kernfs: implement kernfs_get_parent(), kernfs_name/path() and friends Tejun Heo
2014-02-07 18:40   ` [PATCH v2 " Tejun Heo
2014-02-03 19:09 ` Tejun Heo [this message]
2014-02-07 18:41 ` [PATCH 9.5/10] sysfs, kobject: add sysfs wrapper for kernfs_enable_ns() Tejun Heo
2014-02-07 18:43 ` [PATCHSET v2 driver-core-next] kernfs: prepare for cgroup's kernfs conversion Tejun Heo
2014-02-08  0:12   ` Greg KH
2014-02-08 15:07     ` Tejun Heo
2014-02-08 15:08       ` Tejun Heo
2014-02-08 18:17         ` Greg KH
2014-02-08 18:17           ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391454557-32376-11-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).