• Home
  • Raw
  • Download

Lines Matching refs:root

319 	return cgrp->root == &cgrp_dfl_root;  in cgroup_on_dfl()
440 u16 root_ss_mask = cgrp->root->subsys_mask; in cgroup_control()
471 return cgrp->root->subsys_mask; in cgroup_ss_mask()
1060 BUG_ON(cgrp1->root != cgrp2->root); in compare_css_sets()
1069 if (cgrp1->root == new_cgrp->root) { in compare_css_sets()
1090 struct cgroup_root *root = cgrp->root; in find_existing_css_set() local
1102 if (root->subsys_mask & (1UL << i)) { in find_existing_css_set()
1261 if (c->root == cgrp->root) in find_css_set()
1313 return root_cgrp->root; in cgroup_root_from_kf()
1316 void cgroup_favor_dynmods(struct cgroup_root *root, bool favor) in cgroup_favor_dynmods() argument
1318 bool favoring = root->flags & CGRP_ROOT_FAVOR_DYNMODS; in cgroup_favor_dynmods()
1323 root->flags |= CGRP_ROOT_FAVOR_DYNMODS; in cgroup_favor_dynmods()
1326 root->flags &= ~CGRP_ROOT_FAVOR_DYNMODS; in cgroup_favor_dynmods()
1330 static int cgroup_init_root_id(struct cgroup_root *root) in cgroup_init_root_id() argument
1336 id = idr_alloc_cyclic(&cgroup_hierarchy_idr, root, 0, 0, GFP_KERNEL); in cgroup_init_root_id()
1340 root->hierarchy_id = id; in cgroup_init_root_id()
1344 static void cgroup_exit_root_id(struct cgroup_root *root) in cgroup_exit_root_id() argument
1348 idr_remove(&cgroup_hierarchy_idr, root->hierarchy_id); in cgroup_exit_root_id()
1351 void cgroup_free_root(struct cgroup_root *root) in cgroup_free_root() argument
1353 kfree(root); in cgroup_free_root()
1356 static void cgroup_destroy_root(struct cgroup_root *root) in cgroup_destroy_root() argument
1358 struct cgroup *cgrp = &root->cgrp; in cgroup_destroy_root()
1361 trace_cgroup_destroy_root(root); in cgroup_destroy_root()
1365 BUG_ON(atomic_read(&root->nr_cgrps)); in cgroup_destroy_root()
1369 WARN_ON(rebind_subsystems(&cgrp_dfl_root, root->subsys_mask)); in cgroup_destroy_root()
1385 if (!list_empty(&root->root_list)) { in cgroup_destroy_root()
1386 list_del(&root->root_list); in cgroup_destroy_root()
1390 cgroup_favor_dynmods(root, false); in cgroup_destroy_root()
1391 cgroup_exit_root_id(root); in cgroup_destroy_root()
1396 kernfs_destroy_root(root->kf_root); in cgroup_destroy_root()
1397 cgroup_free_root(root); in cgroup_destroy_root()
1404 struct cgroup_root *root) in __cset_cgroup_from_root() argument
1409 res_cgroup = &root->cgrp; in __cset_cgroup_from_root()
1410 } else if (root == &cgrp_dfl_root) { in __cset_cgroup_from_root()
1419 if (c->root == root) { in __cset_cgroup_from_root()
1435 current_cgns_cgroup_from_root(struct cgroup_root *root) in current_cgns_cgroup_from_root() argument
1445 res = __cset_cgroup_from_root(cset, root); in current_cgns_cgroup_from_root()
1473 struct cgroup_root *root) in cset_cgroup_from_root() argument
1478 return __cset_cgroup_from_root(cset, root); in cset_cgroup_from_root()
1486 struct cgroup_root *root) in task_cgroup_from_root() argument
1492 return cset_cgroup_from_root(task_css_set(task), root); in task_cgroup_from_root()
1529 !(cgrp->root->flags & CGRP_ROOT_NOPREFIX)) { in cgroup_file_name()
1801 if (css_next_child(NULL, cgroup_css(&ss->root->cgrp, ss)) && in rebind_subsystems()
1806 if (ss->root != &cgrp_dfl_root && dst_root != &cgrp_dfl_root) in rebind_subsystems()
1813 if (ss->root == &cgrp_dfl_root) in rebind_subsystems()
1831 struct cgroup_root *src_root = ss->root; in rebind_subsystems()
1849 ss->root = dst_root; in rebind_subsystems()
2041 struct cgroup_root *root = ctx->root; in init_cgroup_root() local
2042 struct cgroup *cgrp = &root->cgrp; in init_cgroup_root()
2044 INIT_LIST_HEAD(&root->root_list); in init_cgroup_root()
2045 atomic_set(&root->nr_cgrps, 1); in init_cgroup_root()
2046 cgrp->root = root; in init_cgroup_root()
2050 root->flags = ctx->flags & ~CGRP_ROOT_FAVOR_DYNMODS; in init_cgroup_root()
2052 strscpy(root->release_agent_path, ctx->release_agent, PATH_MAX); in init_cgroup_root()
2054 strscpy(root->name, ctx->name, MAX_CGROUP_ROOT_NAMELEN); in init_cgroup_root()
2056 set_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags); in init_cgroup_root()
2059 int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask) in cgroup_setup_root() argument
2062 struct cgroup *root_cgrp = &root->cgrp; in cgroup_setup_root()
2085 ret = cgroup_init_root_id(root); in cgroup_setup_root()
2089 kf_sops = root == &cgrp_dfl_root ? in cgroup_setup_root()
2092 root->kf_root = kernfs_create_root(kf_sops, in cgroup_setup_root()
2097 if (IS_ERR(root->kf_root)) { in cgroup_setup_root()
2098 ret = PTR_ERR(root->kf_root); in cgroup_setup_root()
2101 root_cgrp->kn = kernfs_root_to_node(root->kf_root); in cgroup_setup_root()
2113 ret = rebind_subsystems(root, ss_mask); in cgroup_setup_root()
2120 trace_cgroup_setup_root(root); in cgroup_setup_root()
2127 list_add(&root->root_list, &cgroup_roots); in cgroup_setup_root()
2143 BUG_ON(atomic_read(&root->nr_cgrps) != 1); in cgroup_setup_root()
2151 kernfs_destroy_root(root->kf_root); in cgroup_setup_root()
2152 root->kf_root = NULL; in cgroup_setup_root()
2154 cgroup_exit_root_id(root); in cgroup_setup_root()
2167 ctx->kfc.root = ctx->root->kf_root; in cgroup_do_get_tree()
2180 struct super_block *sb = fc->root->d_sb; in cgroup_do_get_tree()
2186 cgrp = cset_cgroup_from_root(ctx->ns->root_cset, ctx->root); in cgroup_do_get_tree()
2192 dput(fc->root); in cgroup_do_get_tree()
2198 fc->root = nsdentry; in cgroup_do_get_tree()
2202 cgroup_put(&ctx->root->cgrp); in cgroup_do_get_tree()
2228 ctx->root = &cgrp_dfl_root; in cgroup_get_tree()
2282 struct cgroup_root *root = cgroup_root_from_kf(kf_root); in cgroup_kill_sb() local
2290 if (list_empty(&root->cgrp.self.children) && root != &cgrp_dfl_root && in cgroup_kill_sb()
2291 !percpu_ref_is_dying(&root->cgrp.self.refcnt)) { in cgroup_kill_sb()
2292 cgroup_bpf_offline(&root->cgrp); in cgroup_kill_sb()
2293 percpu_ref_kill(&root->cgrp.self.refcnt); in cgroup_kill_sb()
2295 cgroup_put(&root->cgrp); in cgroup_kill_sb()
2362 struct cgroup *root = cset_cgroup_from_root(ns->root_cset, cgrp->root); in cgroup_path_ns_locked() local
2364 return kernfs_path_from_node(cgrp->kn, root->kn, buf, buflen); in cgroup_path_ns_locked()
2399 struct cgroup_root *root; in task_cgroup_path() local
2407 root = idr_get_next(&cgroup_hierarchy_idr, &hierarchy_id); in task_cgroup_path()
2409 if (root) { in task_cgroup_path()
2410 cgrp = task_cgroup_from_root(task, root); in task_cgroup_path()
2780 src_cgrp = cset_cgroup_from_root(src_cset, dst_cgrp->root); in cgroup_migrate_add_src()
4084 if ((cgrp->root->flags & CGRP_ROOT_NS_DELEGATE) && in cgroup_file_write()
4292 struct cgroup *root = &ss->root->cgrp; in cgroup_apply_cftypes() local
4299 css_for_each_descendant_pre(css, cgroup_css(root, ss)) { in cgroup_apply_cftypes()
4311 kernfs_activate(root->kn); in cgroup_apply_cftypes()
4620 struct cgroup_subsys_state *root) in css_next_descendant_pre() argument
4628 return root; in css_next_descendant_pre()
4636 while (pos != root) { in css_next_descendant_pre()
4715 struct cgroup_subsys_state *root) in css_next_descendant_post() argument
4723 return css_leftmost_descendant(root); in css_next_descendant_post()
4726 if (pos == root) in css_next_descendant_post()
5389 atomic_dec(&cgrp->root->nr_cgrps); in css_free_rwork_fn()
5411 cgroup_destroy_root(cgrp->root); in css_free_rwork_fn()
5610 struct cgroup_root *root = parent->root; in cgroup_create() local
5640 cgrp->root = root; in cgroup_create()
5695 atomic_inc(&root->nr_cgrps); in cgroup_create()
6011 ss->root = &cgrp_dfl_root; in cgroup_init_subsys()
6064 ctx.root = &cgrp_dfl_root; in cgroup_init_early()
6272 struct cgroup_root *root; in proc_cgroup_show() local
6282 for_each_root(root) { in proc_cgroup_show()
6287 if (root == &cgrp_dfl_root && !READ_ONCE(cgrp_dfl_visible)) in proc_cgroup_show()
6290 seq_printf(m, "%d:", root->hierarchy_id); in proc_cgroup_show()
6291 if (root != &cgrp_dfl_root) in proc_cgroup_show()
6293 if (root->subsys_mask & (1 << ssid)) in proc_cgroup_show()
6296 if (strlen(root->name)) in proc_cgroup_show()
6298 root->name); in proc_cgroup_show()
6301 cgrp = task_cgroup_from_root(tsk, root); in proc_cgroup_show()