Home
last modified time | relevance | path

Searched refs:kn (Results 1 – 25 of 48) sorted by relevance

12

/linux/fs/kernfs/
H A Dinode.c27 static struct kernfs_iattrs *__kernfs_iattrs(struct kernfs_node *kn, bool alloc) in __kernfs_iattrs() argument
32 attr = READ_ONCE(kn->iattr); in __kernfs_iattrs()
52 if (!try_cmpxchg(&kn->iattr, &attr, ret)) in __kernfs_iattrs()
53 return READ_ONCE(kn->iattr); in __kernfs_iattrs()
58 static struct kernfs_iattrs *kernfs_iattrs(struct kernfs_node *kn) in kernfs_iattrs() argument
60 return __kernfs_iattrs(kn, true); in kernfs_iattrs()
63 static struct kernfs_iattrs *kernfs_iattrs_noalloc(struct kernfs_node *kn) in kernfs_iattrs_noalloc() argument
65 return __kernfs_iattrs(kn, false); in kernfs_iattrs_noalloc()
68 int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr) in __kernfs_setattr() argument
73 attrs = kernfs_iattrs(kn); in __kernfs_setattr()
[all …]
H A Dmount.c85 struct kernfs_node *kn = inode->i_private; in kernfs_encode_fh() local
93 *(u64 *)fh = kn->id; in kernfs_encode_fh()
102 struct kernfs_node *kn; in __kernfs_fh_to_dentry() local
127 kn = kernfs_find_and_get_node_by_id(info->root, id); in __kernfs_fh_to_dentry()
128 if (!kn) in __kernfs_fh_to_dentry()
134 parent = kernfs_get_parent(kn); in __kernfs_fh_to_dentry()
135 kernfs_put(kn); in __kernfs_fh_to_dentry()
136 kn = parent; in __kernfs_fh_to_dentry()
137 if (!kn) in __kernfs_fh_to_dentry()
141 inode = kernfs_get_inode(sb, kn); in __kernfs_fh_to_dentry()
[all …]
/linux/fs/sysfs/
H A Ddir.c42 struct kernfs_node *parent, *kn; in sysfs_create_dir_ns() local
59 kn = kernfs_create_dir_ns(parent, kobject_name(kobj), 0755, uid, gid, in sysfs_create_dir_ns()
61 if (IS_ERR(kn)) { in sysfs_create_dir_ns()
62 if (PTR_ERR(kn) == -EEXIST) in sysfs_create_dir_ns()
64 return PTR_ERR(kn); in sysfs_create_dir_ns()
67 kobj->sd = kn; in sysfs_create_dir_ns()
81 struct kernfs_node *kn = kobj->sd; in sysfs_remove_dir() local
99 if (kn) { in sysfs_remove_dir()
100 WARN_ON_ONCE(kernfs_type(kn) != KERNFS_DIR); in sysfs_remove_dir()
101 kernfs_remove(kn); in sysfs_remove_dir()
[all …]
H A Dsymlink.c24 struct kernfs_node *kn, *target = NULL; in sysfs_do_create_link_sd() local
44 kn = kernfs_create_link(parent, name, target); in sysfs_do_create_link_sd()
47 if (!IS_ERR(kn)) in sysfs_do_create_link_sd()
50 if (warn && PTR_ERR(kn) == -EEXIST) in sysfs_do_create_link_sd()
52 return PTR_ERR(kn); in sysfs_do_create_link_sd()
61 int sysfs_create_link_sd(struct kernfs_node *kn, struct kobject *target, in sysfs_create_link_sd() argument
64 return sysfs_do_create_link_sd(kn, target, name, 1); in sysfs_create_link_sd()
170 struct kernfs_node *parent, *kn = NULL; in sysfs_rename_link_ns() local
183 kn = kernfs_find_and_get_ns(parent, old, old_ns); in sysfs_rename_link_ns()
184 if (!kn) in sysfs_rename_link_ns()
[all …]
H A Dgroup.c132 struct kernfs_node *kn; in internal_create_group() local
160 kn = kernfs_find_and_get(kobj->sd, grp->name); in internal_create_group()
161 if (!kn) { in internal_create_group()
168 kernfs_put(kn); in internal_create_group()
176 kn = kernfs_create_dir_ns(kobj->sd, grp->name, mode, in internal_create_group()
178 if (IS_ERR(kn)) { in internal_create_group()
179 if (PTR_ERR(kn) == -EEXIST) in internal_create_group()
181 return PTR_ERR(kn); in internal_create_group()
185 kn = kobj->sd; in internal_create_group()
188 kernfs_get(kn); in internal_create_group()
[all …]
H A Dsysfs.h40 int sysfs_create_link_sd(struct kernfs_node *kn, struct kobject *target,
/linux/fs/resctrl/
H A Drdtgroup.c278 static int rdtgroup_kn_set_ugid(struct kernfs_node *kn) in rdtgroup_kn_set_ugid() argument
288 return kernfs_setattr(kn, &iattr); in rdtgroup_kn_set_ugid()
293 struct kernfs_node *kn; in rdtgroup_add_file() local
296 kn = __kernfs_create_file(parent_kn, rft->name, rft->mode, in rdtgroup_add_file()
299 if (IS_ERR(kn)) in rdtgroup_add_file()
300 return PTR_ERR(kn); in rdtgroup_add_file()
302 ret = rdtgroup_kn_set_ugid(kn); in rdtgroup_add_file()
304 kernfs_remove(kn); in rdtgroup_add_file()
314 struct rftype *rft = of->kn->priv; in rdtgroup_seqfile_show()
324 struct rftype *rft = of->kn->priv; in rdtgroup_file_write()
[all …]
H A Dmonitor.c1104 struct mon_evt *mevt = rdt_kn_parent_priv(of->kn); in event_filter_show()
1109 if (!info_kn_lock(of->kn)) in event_filter_show()
1131 info_kn_unlock(of->kn); in event_filter_show()
1139 struct rdt_resource *r = rdt_kn_parent_priv(of->kn); in resctrl_mbm_assign_on_mkdir_show()
1142 if (!info_kn_lock(of->kn)) in resctrl_mbm_assign_on_mkdir_show()
1155 info_kn_unlock(of->kn); in resctrl_mbm_assign_on_mkdir_show()
1163 struct rdt_resource *r = rdt_kn_parent_priv(of->kn); in resctrl_mbm_assign_on_mkdir_write()
1167 if (!info_kn_lock(of->kn)) in resctrl_mbm_assign_on_mkdir_write()
1186 info_kn_unlock(of->kn); in resctrl_mbm_assign_on_mkdir_write()
1465 struct mon_evt *mevt = rdt_kn_parent_priv(of->kn); in event_filter_write()
[all …]
/linux/kernel/cgroup/
H A Dcgroup.c643 static struct cgroup *kn_priv(struct kernfs_node *kn) in kn_priv() argument
651 parent = rcu_dereference_check(kn->__parent, in kn_priv()
652 kernfs_root_flags(kn) & KERNFS_ROOT_INVARIANT_PARENT); in kn_priv()
658 struct cgroup *cgrp = kn_priv(of->kn); in of_css()
1665 void cgroup_kn_unlock(struct kernfs_node *kn) in cgroup_kn_unlock() argument
1669 if (kernfs_type(kn) == KERNFS_DIR) in cgroup_kn_unlock()
1670 cgrp = kn->priv; in cgroup_kn_unlock()
1672 cgrp = kn_priv(kn); in cgroup_kn_unlock()
1676 kernfs_unbreak_active_protection(kn); in cgroup_kn_unlock()
1697 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline) in cgroup_kn_lock_live() argument
[all …]
H A Ddebug.c48 if (!cgroup_kn_lock_live(of->kn, false)) in current_css_set_read()
70 cgroup_kn_unlock(of->kn); in current_css_set_read()
208 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_subsys_states_read()
228 cgroup_kn_unlock(of->kn); in cgroup_subsys_states_read()
256 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_masks_read()
263 cgroup_kn_unlock(of->kn); in cgroup_masks_read()
H A Dcgroup-v1.c508 cgrp = cgroup_kn_lock_live(of->kn, false); in __cgroup1_procs_write()
537 cgroup_kn_unlock(of->kn); in __cgroup1_procs_write()
571 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_release_agent_write()
578 cgroup_kn_unlock(of->kn); in cgroup_release_agent_write()
721 struct kernfs_node *kn = kernfs_node_from_dentry(dentry); in cgroupstats_build() local
727 if (dentry->d_sb->s_type != &cgroup_fs_type || !kn || in cgroupstats_build()
728 kernfs_type(kn) != KERNFS_DIR) in cgroupstats_build()
737 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in cgroupstats_build()
847 static int cgroup1_rename(struct kernfs_node *kn, struct kernfs_node *new_parent, in cgroup1_rename() argument
850 struct cgroup *cgrp = kn->priv; in cgroup1_rename()
[all …]
/linux/scripts/gdb/linux/
H A Ddevice.py73 for kn in klist_for_each(bus['klist_devices']):
74 dp = container_of(kn, device_private_type.get_type().pointer(), 'knode_bus')
79 for kn in klist_for_each(cls['klist_devices']):
80 dp = container_of(kn, device_private_type.get_type().pointer(), 'knode_class')
85 for kn in klist_for_each(dev['p']['klist_children']):
86 dp = container_of(kn, device_private_type.get_type().pointer(), 'knode_parent')
/linux/drivers/net/ethernet/apm/xgene/
H A Dxgene_enet_cle.c50 static void xgene_cle_kn_to_hw(struct xgene_cle_ptree_kn *kn, u32 *buf) in xgene_cle_kn_to_hw() argument
55 buf[j++] = SET_VAL(CLE_TYPE, kn->node_type); in xgene_cle_kn_to_hw()
56 for (i = 0; i < kn->num_keys; i++) { in xgene_cle_kn_to_hw()
57 struct xgene_cle_ptree_key *key = &kn->key[i]; in xgene_cle_kn_to_hw()
569 struct xgene_cle_ptree_kn *kn = ptree->kn; in xgene_cle_setup_node() local
585 xgene_cle_kn_to_hw(&kn[j - num_dn], buf); in xgene_cle_setup_node()
767 struct xgene_cle_ptree_kn kn; in xgene_enet_cle_init() local
806 memset(&kn, 0, sizeof(kn)); in xgene_enet_cle_init()
807 kn.node_type = KN; in xgene_enet_cle_init()
808 kn.num_keys = 1; in xgene_enet_cle_init()
[all …]
/linux/include/linux/
H A Dsysfs.h420 void sysfs_unbreak_active_protection(struct kernfs_node *kn);
478 static inline void sysfs_enable_ns(struct kernfs_node *kn) in sysfs_enable_ns() argument
480 return kernfs_enable_ns(kn); in sysfs_enable_ns()
564 static inline void sysfs_unbreak_active_protection(struct kernfs_node *kn) in sysfs_unbreak_active_protection() argument
711 static inline void sysfs_enable_ns(struct kernfs_node *kn) in sysfs_enable_ns() argument
789 static inline void sysfs_notify_dirent(struct kernfs_node *kn) in sysfs_notify_dirent() argument
791 kernfs_notify(kn); in sysfs_notify_dirent()
800 static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn) in sysfs_get() argument
802 kernfs_get(kn); in sysfs_get()
803 return kn; in sysfs_get()
[all …]
H A Dcgroup-defs.h168 struct kernfs_node *kn; member
536 struct kernfs_node *kn; /* cgroup kernfs entry */ member
/linux/arch/s390/pci/
H A Dpci_sysfs.c82 struct kernfs_node *kn; in recover_store() local
97 kn = sysfs_break_active_protection(&dev->kobj, &attr->attr); in recover_store()
98 WARN_ON_ONCE(!kn); in recover_store()
124 if (kn) in recover_store()
125 sysfs_unbreak_active_protection(kn); in recover_store()
/linux/tools/testing/selftests/bpf/progs/
H A Dtest_cgroup1_hierarchy.c37 if (cgrp->kn->id == target_ancestor_cgid) in bpf_link_create_verify()
44 if (ancestor->kn->id == target_ancestor_cgid) in bpf_link_create_verify()
H A Diters_css.c52 last_cg_id = cur_cgrp->kn->id; in iter_css_for_each()
59 first_cg_id = cur_cgrp->kn->id; in iter_css_for_each()
H A Diters_css_task.c52 return cgrp->kn->id; in cgroup_id()
/linux/drivers/usb/core/
H A Dport.c75 struct kernfs_node *kn; in disable_show() local
88 kn = sysfs_break_active_protection(&dev->kobj, &attr->attr); in disable_show()
89 if (!kn) { in disable_show()
104 sysfs_unbreak_active_protection(kn); in disable_show()
126 struct kernfs_node *kn; in disable_store() local
143 kn = sysfs_break_active_protection(&dev->kobj, &attr->attr); in disable_store()
144 if (!kn) { in disable_store()
171 sysfs_unbreak_active_protection(kn); in disable_store()
/linux/tools/sched_ext/
H A Dscx_flatcg.bpf.c169 scx_bpf_error("cgrp_ctx lookup failed for cgid %llu", cgrp->kn->id); in find_cgrp_ctx()
279 u64 cgid = cgrp->kn->id; in cgrp_enqueued()
391 scx_bpf_dsq_insert(p, cgrp->kn->id, SCX_SLICE_DFL, enq_flags); in BPF_STRUCT_OPS()
402 scx_bpf_dsq_insert_vtime(p, cgrp->kn->id, SCX_SLICE_DFL, in BPF_STRUCT_OPS()
850 u64 cgid = cgrp->kn->id; in BPF_STRUCT_OPS_SLEEPABLE()
919 u64 cgid = cgrp->kn->id; in BPF_STRUCT_OPS()
H A Dscx_pair.bpf.c267 cgid = cgrp->kn->id; in BPF_STRUCT_OPS()
608 u64 cgid = cgrp->kn->id; in BPF_STRUCT_OPS()
631 u64 cgid = cgrp->kn->id; in BPF_STRUCT_OPS()
/linux/tools/cgroup/
H A Dmemcg_slabinfo.py41 name = prefix + '/' + css.cgroup.kn.name.string_().decode('utf-8')
43 MEMCGS[css.cgroup.kn.id.value_()] = memcg
/linux/tools/perf/util/bpf_skel/
H A Doff_cpu.bpf.c155 return BPF_CORE_READ(t, cgroups, dfl_cgrp, kn, id); in get_cgroup_id()
167 return BPF_CORE_READ(cgrp, kn, id); in get_cgroup_id()
/linux/drivers/cpufreq/
H A Dpowernv-cpufreq.c831 struct kernfs_node *kn; in powernv_cpufreq_cpu_init() local
839 kn = kernfs_find_and_get(policy->kobj.sd, throttle_attr_grp.name); in powernv_cpufreq_cpu_init()
840 if (!kn) { in powernv_cpufreq_cpu_init()
850 kernfs_put(kn); in powernv_cpufreq_cpu_init()

12