Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hare@kernel.org
To: Andreas Hindborg <a.hindborg@kernel.org>,
	 Breno Leitao <leitao@debian.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	 Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	 Chaitanya Kulkarni <kch@nvidia.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	 linux-nvme@lists.infradead.org,
	Hannes Reinecke <hare@kernel.org>,
	 Hannes Reinecke <hare@suse.de>
Subject: [PATCH RFC v2 01/12] fs/configfs: rework configfs_is_root()
Date: Fri, 19 Jun 2026 10:36:41 +0200	[thread overview]
Message-ID: <20260619-configfs-ns-v2-1-82fd7094b8dc@kernel.org> (raw)
In-Reply-To: <20260619-configfs-ns-v2-0-82fd7094b8dc@kernel.org>

From: Hannes Reinecke <hare@suse.de>

In preparation for making configfs namespace-aware rework
configfs_is_root() to not rely on static structures but
rather use the information in the structures themselves.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 fs/configfs/configfs_internal.h | 2 +-
 fs/configfs/mount.c             | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h
index acdeea8e2d69ac9d621e1a42b039719811c31757..6261e1f3ec201a58a5d46b08dfbced8c2a44d82b 100644
--- a/fs/configfs/configfs_internal.h
+++ b/fs/configfs/configfs_internal.h
@@ -63,7 +63,7 @@ extern spinlock_t configfs_dirent_lock;
 
 extern struct kmem_cache *configfs_dir_cachep;
 
-extern int configfs_is_root(struct config_item *item);
+extern bool configfs_is_root(struct config_item *item);
 
 extern struct inode * configfs_new_inode(umode_t mode, struct configfs_dirent *, struct super_block *);
 extern struct inode *configfs_create(struct dentry *, umode_t mode);
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index 4929f343118946eaa55a539db4192e9c6621a8dc..88da7b428e52f2f4ab139ad3907101f685d617b1 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -47,9 +47,14 @@ static struct config_group configfs_root_group = {
 	},
 };
 
-int configfs_is_root(struct config_item *item)
+bool configfs_is_root(struct config_item *item)
 {
-	return item == &configfs_root_group.cg_item;
+	struct configfs_dirent *sd;
+
+	if (!item->ci_dentry)
+		return false;
+	sd = item->ci_dentry->d_fsdata;
+	return !!(sd->s_type & CONFIGFS_ROOT);
 }
 
 static struct configfs_dirent configfs_root = {

-- 
2.51.0



  reply	other threads:[~2026-06-19  8:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19  8:36 [PATCH RFC v2 00/12] namespace-aware configfs hare
2026-06-19  8:36 ` hare [this message]
2026-06-19  8:36 ` [PATCH RFC v2 02/12] fs/configfs: dynamically allocate super_info hare
2026-06-19  8:36 ` [PATCH RFC v2 03/12] fs/configfs: separate out configfs_{link,unlink}_root() hare
2026-06-19  8:36 ` [PATCH RFC v2 04/12] fs/configfs: add superblock as attribute to configfs_pin_fs() Hannes Reinecke
2026-06-19  8:36 ` [PATCH RFC v2 05/12] fs/configfs: add 'fill_subsystem' and 'clear_subsystem' callbacks Hannes Reinecke
2026-06-19  8:36 ` [PATCH RFC v2 06/12] fs/configfs: add superblock as attribute to configfs_pin_fs() Hannes Reinecke
2026-06-19  8:36 ` [PATCH RFC v2 07/12] fs/namespace: implement mnt_clone_direct() Hannes Reinecke
2026-06-19  8:36 ` [PATCH RFC v2 08/12] fs/configfs: switch to get_tree_keyed() Hannes Reinecke
2026-06-19  8:36 ` [PATCH RFC v2 09/12] fs/configfs: open-code simple_pin_fs() Hannes Reinecke
2026-06-19  8:36 ` [PATCH RFC v2 10/12] nvmet: make discovery subsystem dynamic Hannes Reinecke
2026-06-19  8:36 ` [PATCH RFC v2 11/12] nvmet: per net-namespace port list Hannes Reinecke
2026-06-19  8:36 ` [PATCH RFC v2 12/12] nvmet: make configfs setup namespace aware Hannes Reinecke
2026-06-19 13:25 ` [syzbot ci] Re: namespace-aware configfs syzbot ci

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=20260619-configfs-ns-v2-1-82fd7094b8dc@kernel.org \
    --to=hare@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=brauner@kernel.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=kch@nvidia.com \
    --cc=leitao@debian.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=viro@zeniv.linux.org.uk \
    /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