@@ -656,6 +656,8 @@ static inline union kernfs_node_id *cgroup_get_kernfs_id(struct cgroup *cgrp)
void cgroup_path_from_kernfs_id(const union kernfs_node_id *id,
char *buf, size_t buflen);
+bool cgroup_on_dfl(const struct cgroup *cgrp);
+
#else /* !CONFIG_CGROUPS */
struct cgroup_subsys_state;
@@ -156,7 +156,6 @@ static inline void get_css_set(struct css_set *cset)
}
bool cgroup_ssid_enabled(int ssid);
-bool cgroup_on_dfl(const struct cgroup *cgrp);
bool cgroup_is_thread_root(struct cgroup *cgrp);
bool cgroup_is_threaded(struct cgroup *cgrp);
@@ -298,6 +298,7 @@ bool cgroup_on_dfl(const struct cgroup *cgrp)
{
return cgrp->root == &cgrp_dfl_root;
}
+EXPORT_SYMBOL(cgroup_on_dfl);
/* IDR wrappers which synchronize using cgroup_idr_lock */
static int cgroup_idr_alloc(struct idr *idr, void *ptr, int start, int end,
Drivers may wish to limit their own cgroup operations to cgroups in the cgroup-v2 hierarchy. Let's make this helper function usable outside the cgroup core code. Cc: Tejun Heo <tj@kernel.org> Cc: cgroups@vger.kernel.org Signed-off-by: Matt Roper <matthew.d.roper@intel.com> --- include/linux/cgroup.h | 2 ++ kernel/cgroup/cgroup-internal.h | 1 - kernel/cgroup/cgroup.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)