summaryrefslogtreecommitdiffstats
path: root/fs/mount.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2024-06-24 17:49:46 +0200
committerChristian Brauner <brauner@kernel.org>2024-06-28 09:53:30 +0200
commit1901c92497bd90caf608a474f1bf4d8795b372a2 (patch)
tree2a2604e8effabdbe8ccb4ed4ec09688897adefef /fs/mount.h
parentfs: relax permissions for statmount() (diff)
downloadlinux-1901c92497bd90caf608a474f1bf4d8795b372a2.tar.xz
linux-1901c92497bd90caf608a474f1bf4d8795b372a2.zip
fs: keep an index of current mount namespaces
In order to allow for listmount() to be used on different namespaces we need a way to lookup a mount ns by its id. Keep a rbtree of the current !anonymous mount name spaces indexed by ID that we can use to look up the namespace. Co-developed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Link: https://lore.kernel.org/r/e5fdd78a90f5b00a75bd893962a70f52a2c015cd.1719243756.git.josef@toxicpanda.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/mount.h')
-rw-r--r--fs/mount.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/mount.h b/fs/mount.h
index 4a42fc68f4cc..5b980c262c0c 100644
--- a/fs/mount.h
+++ b/fs/mount.h
@@ -16,6 +16,8 @@ struct mnt_namespace {
u64 event;
unsigned int nr_mounts; /* # of mounts in the namespace */
unsigned int pending_mounts;
+ struct rb_node mnt_ns_tree_node; /* node in the mnt_ns_tree */
+ refcount_t passive; /* number references not pinning @mounts */
} __randomize_layout;
struct mnt_pcp {