Lines Matching refs:kn

653 	struct cgroup *cgrp = of->kn->parent->priv;  in of_css()
1304 struct cgroup *root_cgrp = kf_root->kn->priv; in cgroup_root_from_kf()
1582 void cgroup_kn_unlock(struct kernfs_node *kn) in cgroup_kn_unlock() argument
1586 if (kernfs_type(kn) == KERNFS_DIR) in cgroup_kn_unlock()
1587 cgrp = kn->priv; in cgroup_kn_unlock()
1589 cgrp = kn->parent->priv; in cgroup_kn_unlock()
1593 kernfs_unbreak_active_protection(kn); in cgroup_kn_unlock()
1614 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline) in cgroup_kn_lock_live() argument
1618 if (kernfs_type(kn) == KERNFS_DIR) in cgroup_kn_lock_live()
1619 cgrp = kn->priv; in cgroup_kn_lock_live()
1621 cgrp = kn->parent->priv; in cgroup_kn_lock_live()
1631 kernfs_break_active_protection(kn); in cgroup_kn_lock_live()
1641 cgroup_kn_unlock(kn); in cgroup_kn_lock_live()
1656 cfile->kn = NULL; in cgroup_rm_file()
1662 kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); in cgroup_rm_file()
1704 if ((css->flags & CSS_VISIBLE) || !cgrp->kn) in css_populate_dir()
1833 kernfs_activate(dcgrp->kn); in rebind_subsystems()
1851 len = kernfs_path_from_node(kf_node, ns_cgroup->kn, buf, PATH_MAX); in cgroup_show_path()
2027 root_cgrp->kn = root->kf_root->kn; in cgroup_setup_root()
2117 nsdentry = kernfs_node_dentry(cgrp->kn, sb); in cgroup_do_get_tree()
2286 return kernfs_path_from_node(cgrp->kn, root->kn, buf, buflen); in cgroup_path_ns_locked()
3317 cgrp = cgroup_kn_lock_live(of->kn, true); in cgroup_subtree_control_write()
3368 kernfs_activate(cgrp->kn); in cgroup_subtree_control_write()
3370 cgroup_kn_unlock(of->kn); in cgroup_subtree_control_write()
3457 cgrp = cgroup_kn_lock_live(of->kn, true); in cgroup_type_write()
3464 cgroup_kn_unlock(of->kn); in cgroup_type_write()
3500 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_max_descendants_write()
3506 cgroup_kn_unlock(of->kn); in cgroup_max_descendants_write()
3543 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_max_depth_write()
3549 cgroup_kn_unlock(of->kn); in cgroup_max_depth_write()
3638 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_pressure_write()
3643 cgroup_kn_unlock(of->kn); in cgroup_pressure_write()
3731 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_freeze_write()
3737 cgroup_kn_unlock(of->kn); in cgroup_freeze_write()
3797 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_kill_write()
3811 cgroup_kn_unlock(of->kn); in cgroup_kill_write()
3856 struct cgroup *cgrp = of->kn->parent->priv; in cgroup_file_write()
3970 static int cgroup_kn_set_ugid(struct kernfs_node *kn) in cgroup_kn_set_ugid() argument
3980 return kernfs_setattr(kn, &iattr); in cgroup_kn_set_ugid()
3993 struct kernfs_node *kn; in cgroup_add_file() local
4000 kn = __kernfs_create_file(cgrp->kn, cgroup_file_name(cgrp, cft, name), in cgroup_add_file()
4005 if (IS_ERR(kn)) in cgroup_add_file()
4006 return PTR_ERR(kn); in cgroup_add_file()
4008 ret = cgroup_kn_set_ugid(kn); in cgroup_add_file()
4010 kernfs_remove(kn); in cgroup_add_file()
4020 cfile->kn = kn; in cgroup_add_file()
4099 kernfs_activate(root->kn); in cgroup_apply_cftypes()
4274 if (cfile->kn) { in cgroup_file_notify()
4281 kernfs_notify(cfile->kn); in cgroup_file_notify()
4851 inode = kernfs_get_inode(sb, cgrp->procs_file.kn); in cgroup_may_write()
4922 dst_cgrp = cgroup_kn_lock_live(of->kn, false); in __cgroup_procs_write()
4954 cgroup_kn_unlock(of->kn); in __cgroup_procs_write()
5133 kernfs_put(cgrp->kn); in css_free_rwork_fn()
5191 if (cgrp->kn) in css_release_work_fn()
5192 RCU_INIT_POINTER(*(void __rcu __force **)&cgrp->kn->priv, in css_release_work_fn()
5344 struct kernfs_node *kn; in cgroup_create() local
5363 kn = kernfs_create_dir(parent->kn, name, mode, cgrp); in cgroup_create()
5364 if (IS_ERR(kn)) { in cgroup_create()
5365 ret = PTR_ERR(kn); in cgroup_create()
5368 cgrp->kn = kn; in cgroup_create()
5445 kernfs_remove(cgrp->kn); in cgroup_create()
5506 kernfs_get(cgrp->kn); in cgroup_mkdir()
5508 ret = cgroup_kn_set_ugid(cgrp->kn); in cgroup_mkdir()
5523 kernfs_activate(cgrp->kn); in cgroup_mkdir()
5680 kernfs_remove(cgrp->kn); in cgroup_destroy_locked()
5708 int cgroup_rmdir(struct kernfs_node *kn) in cgroup_rmdir() argument
5713 cgrp = cgroup_kn_lock_live(kn, false); in cgroup_rmdir()
5721 cgroup_kn_unlock(kn); in cgroup_rmdir()
5949 struct kernfs_node *kn; in cgroup_path_from_kernfs_id() local
5951 kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id); in cgroup_path_from_kernfs_id()
5952 if (!kn) in cgroup_path_from_kernfs_id()
5954 kernfs_path(kn, buf, buflen); in cgroup_path_from_kernfs_id()
5955 kernfs_put(kn); in cgroup_path_from_kernfs_id()
5965 struct kernfs_node *kn; in cgroup_get_from_id() local
5968 kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id); in cgroup_get_from_id()
5969 if (!kn) in cgroup_get_from_id()
5974 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in cgroup_get_from_id()
5980 kernfs_put(kn); in cgroup_get_from_id()
6487 struct kernfs_node *kn = kernfs_node_from_dentry(dentry); in css_tryget_online_from_dir() local
6494 !kn || kernfs_type(kn) != KERNFS_DIR) in css_tryget_online_from_dir()
6504 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in css_tryget_online_from_dir()
6540 struct kernfs_node *kn; in cgroup_get_from_path() local
6543 kn = kernfs_walk_and_get(cgrp_dfl_root.cgrp.kn, path); in cgroup_get_from_path()
6544 if (!kn) in cgroup_get_from_path()
6547 if (kernfs_type(kn) != KERNFS_DIR) { in cgroup_get_from_path()
6554 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in cgroup_get_from_path()
6561 kernfs_put(kn); in cgroup_get_from_path()