include/cgroup: separate {get,put}_cgroup_ns no-op case
authorJoel Savitz <jsavitz@redhat.com>
Thu, 8 May 2025 18:49:30 +0000 (14:49 -0400)
committerChristian Brauner <brauner@kernel.org>
Fri, 9 May 2025 11:13:54 +0000 (13:13 +0200)
commit79fb8d8d93e41be4ebda8c9cc507e20297277231
treeb79ceb3087673c9986b63b826307dfb9568993ce
parent5caa2d89b7f1c1249ca7cc47e10930d2cdabd8a5
include/cgroup: separate {get,put}_cgroup_ns no-op case

When CONFIG_CGROUPS is not selected, {get,put}_cgroup_ns become no-ops
and therefore it is not necessary to compile in the code for changing
the reference count.

When CONFIG_CGROUP is selected, there is no valid case where
either of {get,put}_cgroup_ns() will be called with a NULL argument.

Signed-off-by: Joel Savitz <jsavitz@redhat.com>
Link: https://lore.kernel.org/20250508184930.183040-3-jsavitz@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/cgroup.h