From nobody Thu Sep 11 01:48:08 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78CC131AF06; Wed, 10 Sep 2025 14:37:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757515049; cv=none; b=UcmFEF/C/p5zp2phcCQIJzWc4784cOXeRAQ6G2lXWTuTErXIS+AfhUXoFM8F/B2QZ+yPtyM6e+FbD9/MmbNShOFH+UrdxXMxAsxZko+aSzJqbPdT1vRkfIds+2QHoerEiKcvDFaQEAjbNVt9/Ddako07YMVXdRpDsBewErJZRYw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757515049; c=relaxed/simple; bh=ygHSdVECEky2ur8dAJ5kFJhfsJSwR30ApmvwmuGj5yo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EW8c/RH+JMDajKKFuoPUS4BIxrh0JCxzIR9rrqtru2kYboYM3cjkmcYPR8iL+owpgZw6Iepu45Gc3UsNUGqbab1gKImM+/qcJ6tw44Tjkn9b+dq3jYMqrCgyFCkWOlEM+F/WYL1mCpmeQqQeFjXvLDKartmnl+2yc1DFTVxaMe8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uXRhCXHQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uXRhCXHQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B19E0C4CEF9; Wed, 10 Sep 2025 14:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757515049; bh=ygHSdVECEky2ur8dAJ5kFJhfsJSwR30ApmvwmuGj5yo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uXRhCXHQM7+BUFhrfe33B3BKlUxIF6zIEfkqE2XLwfVf1LpLaqTmqV3mRAvy3avlu USavCz2kLkAYOedsFmywNwuPf2EOBoE+bXWiBR+oTYBDQEBEsccwemEkusIuuMILef M9Eud7NUYL51LxCBsEJU2gWr5u0sU0DpddjGZUiLWdaldcIAgwPBgAi6CBFgU0e8ac 7Qjvo2lliTqzQyty/+wFP8ETdrvurZ67+w96MQREIXgpOWLIlQt938lnKyN2vkSVS9 l+DAybyDdjw+s/ciqZs6CDXsf8MwdFkSt39Vau0gA9wGt3XU6VGY9mqWTEJKzkr85h nTJSbkPvcJnKQ== From: Christian Brauner Date: Wed, 10 Sep 2025 16:36:49 +0200 Subject: [PATCH 04/32] ns: move to_ns_common() to ns_common.h Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250910-work-namespace-v1-4-4dd56e7359d8@kernel.org> References: <20250910-work-namespace-v1-0-4dd56e7359d8@kernel.org> In-Reply-To: <20250910-work-namespace-v1-0-4dd56e7359d8@kernel.org> To: Jan Kara , Amir Goldstein , linux-fsdevel@vger.kernel.org Cc: Josef Bacik , Jeff Layton , Mike Yuan , =?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= , Lennart Poettering , Daan De Meyer , Aleksa Sarai , Alexander Viro , Jens Axboe , Tejun Heo , Johannes Weiner , =?utf-8?q?Michal_Koutn=C3=BD?= , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Chuck Lever , linux-nfs@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, netdev@vger.kernel.org, Christian Brauner X-Mailer: b4 0.14.3-dev-385fa X-Developer-Signature: v=1; a=openpgp-sha256; l=2191; i=brauner@kernel.org; h=from:subject:message-id; bh=ygHSdVECEky2ur8dAJ5kFJhfsJSwR30ApmvwmuGj5yo=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMWQc7GVfK1sx13oB05HdnhZHJJXX5zNGnXrYpHykLen5X t2Fi55GdpSwMIhxMciKKbI4tJuEyy3nqdhslKkBM4eVCWQIAxenAExEYgvDV6EcPy6lps4Xy6Nr q8V3Tk/8c2PilJAP9Z/5W/zbPmZ8ZfhfXzfPfpus+qkFOqcXt/RtTLxwT/KMx+dja/01TRkaC1t 4AA== X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 Move the helper to ns_common.h where it belongs. Signed-off-by: Christian Brauner Reviewed-by: Jan Kara --- 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 @@ =20 struct proc_ns_operations; =20 +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; }; =20 +#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; =20 -#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. --=20 2.47.3