Lines Matching refs:kn
636 struct cgroup *cgrp = of->kn->parent->priv; in of_css()
1591 void cgroup_kn_unlock(struct kernfs_node *kn) in cgroup_kn_unlock() argument
1595 if (kernfs_type(kn) == KERNFS_DIR) in cgroup_kn_unlock()
1596 cgrp = kn->priv; in cgroup_kn_unlock()
1598 cgrp = kn->parent->priv; in cgroup_kn_unlock()
1602 kernfs_unbreak_active_protection(kn); in cgroup_kn_unlock()
1623 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline) in cgroup_kn_lock_live() argument
1627 if (kernfs_type(kn) == KERNFS_DIR) in cgroup_kn_lock_live()
1628 cgrp = kn->priv; in cgroup_kn_lock_live()
1630 cgrp = kn->parent->priv; in cgroup_kn_lock_live()
1640 kernfs_break_active_protection(kn); in cgroup_kn_lock_live()
1650 cgroup_kn_unlock(kn); in cgroup_kn_lock_live()
1665 cfile->kn = NULL; in cgroup_rm_file()
1671 kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); in cgroup_rm_file()
1869 kernfs_activate(dcgrp->kn); in rebind_subsystems()
1887 len = kernfs_path_from_node(kf_node, ns_cgroup->kn, buf, PATH_MAX); in cgroup_show_path()
2074 root_cgrp->kn = kernfs_root_to_node(root->kf_root); in cgroup_setup_root()
2164 nsdentry = kernfs_node_dentry(cgrp->kn, sb); in cgroup_do_get_tree()
2337 return kernfs_path_from_node(cgrp->kn, root->kn, buf, buflen); in cgroup_path_ns_locked()
3376 cgrp = cgroup_kn_lock_live(of->kn, true); in cgroup_subtree_control_write()
3427 kernfs_activate(cgrp->kn); in cgroup_subtree_control_write()
3429 cgroup_kn_unlock(of->kn); in cgroup_subtree_control_write()
3516 cgrp = cgroup_kn_lock_live(of->kn, true); in cgroup_type_write()
3523 cgroup_kn_unlock(of->kn); in cgroup_type_write()
3559 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_max_descendants_write()
3565 cgroup_kn_unlock(of->kn); in cgroup_max_descendants_write()
3602 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_max_depth_write()
3608 cgroup_kn_unlock(of->kn); in cgroup_max_depth_write()
3750 cgrp = cgroup_kn_lock_live(of->kn, false); in pressure_write()
3755 cgroup_kn_unlock(of->kn); in pressure_write()
3840 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_pressure_write()
3857 cgroup_kn_unlock(of->kn); in cgroup_pressure_write()
3916 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_freeze_write()
3922 cgroup_kn_unlock(of->kn); in cgroup_freeze_write()
3982 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_kill_write()
3996 cgroup_kn_unlock(of->kn); in cgroup_kill_write()
4041 struct cgroup *cgrp = of->kn->parent->priv; in cgroup_file_write()
4155 static int cgroup_kn_set_ugid(struct kernfs_node *kn) in cgroup_kn_set_ugid() argument
4165 return kernfs_setattr(kn, &iattr); in cgroup_kn_set_ugid()
4178 struct kernfs_node *kn; in cgroup_add_file() local
4185 kn = __kernfs_create_file(cgrp->kn, cgroup_file_name(cgrp, cft, name), in cgroup_add_file()
4190 if (IS_ERR(kn)) in cgroup_add_file()
4191 return PTR_ERR(kn); in cgroup_add_file()
4193 ret = cgroup_kn_set_ugid(kn); in cgroup_add_file()
4195 kernfs_remove(kn); in cgroup_add_file()
4205 cfile->kn = kn; in cgroup_add_file()
4282 kernfs_activate(root->kn); in cgroup_apply_cftypes()
4464 if (cfile->kn) { in cgroup_file_notify()
4471 kernfs_notify(cfile->kn); in cgroup_file_notify()
4485 struct kernfs_node *kn; in cgroup_file_show() local
4488 kn = cfile->kn; in cgroup_file_show()
4489 kernfs_get(kn); in cgroup_file_show()
4492 if (kn) in cgroup_file_show()
4493 kernfs_show(kn, show); in cgroup_file_show()
4495 kernfs_put(kn); in cgroup_file_show()
5061 inode = kernfs_get_inode(sb, cgrp->procs_file.kn); in cgroup_may_write()
5132 dst_cgrp = cgroup_kn_lock_live(of->kn, false); in __cgroup_procs_write()
5164 cgroup_kn_unlock(of->kn); in __cgroup_procs_write()
5367 kernfs_put(cgrp->kn); in css_free_rwork_fn()
5425 if (cgrp->kn) in css_release_work_fn()
5426 RCU_INIT_POINTER(*(void __rcu __force **)&cgrp->kn->priv, in css_release_work_fn()
5577 struct kernfs_node *kn; in cgroup_create() local
5595 kn = kernfs_create_dir(parent->kn, name, mode, cgrp); in cgroup_create()
5596 if (IS_ERR(kn)) { in cgroup_create()
5597 ret = PTR_ERR(kn); in cgroup_create()
5600 cgrp->kn = kn; in cgroup_create()
5677 kernfs_remove(cgrp->kn); in cgroup_create()
5738 kernfs_get(cgrp->kn); in cgroup_mkdir()
5740 ret = cgroup_kn_set_ugid(cgrp->kn); in cgroup_mkdir()
5755 kernfs_activate(cgrp->kn); in cgroup_mkdir()
5912 kernfs_remove(cgrp->kn); in cgroup_destroy_locked()
5940 int cgroup_rmdir(struct kernfs_node *kn) in cgroup_rmdir() argument
5945 cgrp = cgroup_kn_lock_live(kn, false); in cgroup_rmdir()
5953 cgroup_kn_unlock(kn); in cgroup_rmdir()
6176 struct kernfs_node *kn; in cgroup_path_from_kernfs_id() local
6178 kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id); in cgroup_path_from_kernfs_id()
6179 if (!kn) in cgroup_path_from_kernfs_id()
6181 kernfs_path(kn, buf, buflen); in cgroup_path_from_kernfs_id()
6182 kernfs_put(kn); in cgroup_path_from_kernfs_id()
6193 struct kernfs_node *kn; in cgroup_get_from_id() local
6196 kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id); in cgroup_get_from_id()
6197 if (!kn) in cgroup_get_from_id()
6200 if (kernfs_type(kn) != KERNFS_DIR) { in cgroup_get_from_id()
6201 kernfs_put(kn); in cgroup_get_from_id()
6207 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in cgroup_get_from_id()
6212 kernfs_put(kn); in cgroup_get_from_id()
6767 struct kernfs_node *kn = kernfs_node_from_dentry(dentry); in css_tryget_online_from_dir() local
6774 !kn || kernfs_type(kn) != KERNFS_DIR) in css_tryget_online_from_dir()
6784 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in css_tryget_online_from_dir()
6820 struct kernfs_node *kn; in cgroup_get_from_path() local
6825 kn = kernfs_walk_and_get(root_cgrp->kn, path); in cgroup_get_from_path()
6826 if (!kn) in cgroup_get_from_path()
6829 if (kernfs_type(kn) != KERNFS_DIR) { in cgroup_get_from_path()
6836 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in cgroup_get_from_path()
6843 kernfs_put(kn); in cgroup_get_from_path()