[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ibq6c56ja4mkcthp2yjtqv6qppadm5s7o2u533tdgebfbrfhx6@qzd32irlnvn7>
Date: Wed, 10 Sep 2025 17:36:29 +0200
From: Jan Kara <jack@...e.cz>
To: Christian Brauner <brauner@...nel.org>
Cc: Jan Kara <jack@...e.cz>, Amir Goldstein <amir73il@...il.com>,
linux-fsdevel@...r.kernel.org, Josef Bacik <josef@...icpanda.com>,
Jeff Layton <jlayton@...nel.org>, Mike Yuan <me@...dnzj.com>,
Zbigniew Jędrzejewski-Szmek <zbyszek@...waw.pl>, Lennart Poettering <mzxreary@...inter.de>,
Daan De Meyer <daan.j.demeyer@...il.com>, Aleksa Sarai <cyphar@...har.com>,
Alexander Viro <viro@...iv.linux.org.uk>, Jens Axboe <axboe@...nel.dk>, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>, Michal Koutný <mkoutny@...e.com>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Chuck Lever <chuck.lever@...cle.com>, linux-nfs@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 04/32] ns: move to_ns_common() to ns_common.h
On Wed 10-09-25 16:36:49, Christian Brauner wrote:
> Move the helper to ns_common.h where it belongs.
>
> Signed-off-by: Christian Brauner <brauner@...nel.org>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> include/linux/ns_common.h | 20 ++++++++++++++++++++
> include/linux/nsproxy.h | 11 -----------
> 2 files changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/ns_common.h b/include/linux/ns_common.h
> index 7d22ea50b098..bc2e0758e1c9 100644
> --- a/include/linux/ns_common.h
> +++ b/include/linux/ns_common.h
> @@ -6,6 +6,15 @@
>
> struct proc_ns_operations;
>
> +struct cgroup_namespace;
> +struct ipc_namespace;
> +struct mnt_namespace;
> +struct net;
> +struct pid_namespace;
> +struct time_namespace;
> +struct user_namespace;
> +struct uts_namespace;
> +
> struct ns_common {
> struct dentry *stashed;
> const struct proc_ns_operations *ops;
> @@ -13,4 +22,15 @@ struct ns_common {
> refcount_t count;
> };
>
> +#define to_ns_common(__ns) \
> + _Generic((__ns), \
> + struct cgroup_namespace *: &(__ns)->ns, \
> + struct ipc_namespace *: &(__ns)->ns, \
> + struct mnt_namespace *: &(__ns)->ns, \
> + struct net *: &(__ns)->ns, \
> + struct pid_namespace *: &(__ns)->ns, \
> + struct time_namespace *: &(__ns)->ns, \
> + struct user_namespace *: &(__ns)->ns, \
> + struct uts_namespace *: &(__ns)->ns)
> +
> #endif
> diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
> index dab6a1734a22..e6bec522b139 100644
> --- a/include/linux/nsproxy.h
> +++ b/include/linux/nsproxy.h
> @@ -42,17 +42,6 @@ struct nsproxy {
> };
> extern struct nsproxy init_nsproxy;
>
> -#define to_ns_common(__ns) \
> - _Generic((__ns), \
> - struct cgroup_namespace *: &(__ns->ns), \
> - struct ipc_namespace *: &(__ns->ns), \
> - struct net *: &(__ns->ns), \
> - struct pid_namespace *: &(__ns->ns), \
> - struct mnt_namespace *: &(__ns->ns), \
> - struct time_namespace *: &(__ns->ns), \
> - struct user_namespace *: &(__ns->ns), \
> - struct uts_namespace *: &(__ns->ns))
> -
> /*
> * A structure to encompass all bits needed to install
> * a partial or complete new set of namespaces.
>
> --
> 2.47.3
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists