| /linux/fs/kernfs/ |
| H A D | dir.c | 33 static void kernfs_activate_one(struct kernfs_node *kn); 35 static bool __kernfs_active(struct kernfs_node *kn) in __kernfs_active() argument 37 return atomic_read(&kn->active) >= 0; in __kernfs_active() 40 static bool kernfs_active(struct kernfs_node *kn) in kernfs_active() argument 42 lockdep_assert_held(&kernfs_root(kn)->kernfs_rwsem); in kernfs_active() 43 return __kernfs_active(kn); in kernfs_active() 46 static bool kernfs_lockdep(struct kernfs_node *kn) in kernfs_lockdep() argument 49 return kn->flags & KERNFS_LOCKDEP; in kernfs_lockdep() 76 da = kernfs_depth(ra->kn, a); in kernfs_common_ancestor() 77 db = kernfs_depth(rb->kn, in kernfs_common_ancestor() 131 struct kernfs_node *kn, *common; kernfs_path_from_node_locked() local 192 kernfs_name(struct kernfs_node * kn,char * buf,size_t buflen) kernfs_name() argument 247 pr_cont_kernfs_name(struct kernfs_node * kn) pr_cont_kernfs_name() argument 265 pr_cont_kernfs_path(struct kernfs_node * kn) pr_cont_kernfs_path() argument 297 kernfs_get_parent(struct kernfs_node * kn) kernfs_get_parent() argument 349 kernfs_name_compare(unsigned int hash,const char * name,const struct ns_common * ns,const struct kernfs_node * kn) kernfs_name_compare() argument 384 kernfs_link_sibling(struct kernfs_node * kn) kernfs_link_sibling() argument 435 kernfs_unlink_sibling(struct kernfs_node * kn) kernfs_unlink_sibling() argument 464 kernfs_get_active(struct kernfs_node * kn) kernfs_get_active() argument 484 kernfs_put_active(struct kernfs_node * kn) kernfs_put_active() argument 510 kernfs_drain(struct kernfs_node * kn,bool drop_supers) kernfs_drain() argument 559 kernfs_get(struct kernfs_node * kn) kernfs_get() argument 570 struct kernfs_node *kn = container_of(rcu, struct kernfs_node, rcu); kernfs_free_rcu() local 587 kernfs_put(struct kernfs_node * kn) kernfs_put() argument 659 struct kernfs_node *kn; __kernfs_new_node() local 739 struct kernfs_node *kn; kernfs_new_node() local 778 struct kernfs_node *kn; kernfs_find_and_get_node_by_id() local 825 kernfs_add_one(struct kernfs_node * kn) kernfs_add_one() argument 917 struct kernfs_node *kn; kernfs_find_ns() local 978 struct kernfs_node *kn; kernfs_find_and_get_ns() local 1005 struct kernfs_node *kn; kernfs_walk_and_get_ns() local 1016 kernfs_root_flags(struct kernfs_node * kn) kernfs_root_flags() argument 1034 struct kernfs_node *kn; kernfs_create_root() local 1129 struct kernfs_node *kn; kernfs_create_dir_ns() local 1161 struct kernfs_node *kn; kernfs_create_empty_dir() local 1188 struct kernfs_node *kn; kernfs_dop_revalidate() local 1252 struct kernfs_node *kn; kernfs_iop_lookup() local 1312 struct kernfs_node *kn = kernfs_dentry_node(dentry); kernfs_iop_rmdir() local 1333 struct kernfs_node *kn = kernfs_dentry_node(old_dentry); kernfs_iop_rename() local 1428 kernfs_activate_one(struct kernfs_node * kn) kernfs_activate_one() argument 1456 kernfs_activate(struct kernfs_node * kn) kernfs_activate() argument 1482 kernfs_show(struct kernfs_node * kn,bool show) kernfs_show() argument 1519 kernfs_clear_inode_nlink(struct kernfs_node * kn) kernfs_clear_inode_nlink() argument 1536 __kernfs_remove(struct kernfs_node * kn) __kernfs_remove() argument 1612 kernfs_remove(struct kernfs_node * kn) kernfs_remove() argument 1642 kernfs_break_active_protection(struct kernfs_node * kn) kernfs_break_active_protection() argument 1667 kernfs_unbreak_active_protection(struct kernfs_node * kn) kernfs_unbreak_active_protection() argument 1711 kernfs_remove_self(struct kernfs_node * kn) kernfs_remove_self() argument 1780 struct kernfs_node *kn; kernfs_remove_by_name_ns() local 1818 kernfs_rename_ns(struct kernfs_node * kn,struct kernfs_node * new_parent,const char * new_name,const struct ns_common * new_ns) kernfs_rename_ns() argument 1957 struct kernfs_node *kn = rb_to_kn(node); kernfs_dir_pos() local [all...] |
| H A D | inode.c | 27 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 D | symlink.c | 29 struct kernfs_node *kn; in kernfs_create_link() local 50 kn = kernfs_new_node(parent, name, S_IFLNK|0777, uid, gid, KERNFS_LINK); in kernfs_create_link() 51 if (!kn) in kernfs_create_link() 55 kn->ns = target->ns; in kernfs_create_link() 56 kn->symlink.target_kn = target; in kernfs_create_link() 59 error = kernfs_add_one(kn); in kernfs_create_link() 61 return kn; in kernfs_create_link() 63 kernfs_put(kn); in kernfs_create_link() 70 struct kernfs_node *base, *kn; in kernfs_get_target_path() local 77 kn = kernfs_parent(target); in kernfs_get_target_path() [all …]
|
| H A D | file.c | 44 static inline struct mutex *kernfs_open_file_mutex_ptr(struct kernfs_node *kn) in kernfs_open_file_mutex_ptr() argument 46 return kernfs_node_lock_ptr(kn); in kernfs_open_file_mutex_ptr() 49 static inline struct mutex *kernfs_open_file_mutex_lock(struct kernfs_node *kn) in kernfs_open_file_mutex_lock() argument 51 return kernfs_node_lock(kn); in kernfs_open_file_mutex_lock() 62 return rcu_dereference_protected(of->kn->attr.open, in of_on() 73 if (!kernfs_get_active(of->kn)) in kernfs_get_active_of() 81 return kernfs_put_active(of->kn); in kernfs_put_active_of() 102 kernfs_deref_open_node_locked(struct kernfs_node *kn) in kernfs_deref_open_node_locked() argument 104 return rcu_dereference_protected(kn->attr.open, in kernfs_deref_open_node_locked() 105 lockdep_is_held(kernfs_open_file_mutex_ptr(kn))); in kernfs_deref_open_node_locked() [all …]
|
| H A D | kernfs-internal.h | 35 struct kernfs_node *kn; member 72 static inline struct kernfs_root *kernfs_root(const struct kernfs_node *kn) in kernfs_root() argument 77 knp = rcu_dereference(kn->__parent); in kernfs_root() 79 kn = knp; in kernfs_root() 80 return kn->dir.root; in kernfs_root() 108 static inline bool kernfs_root_is_locked(const struct kernfs_node *kn) in kernfs_root_is_locked() argument 110 return lockdep_is_held(&kernfs_root(kn)->kernfs_rwsem); in kernfs_root_is_locked() 113 static inline bool kernfs_rename_is_locked(const struct kernfs_node *kn) in kernfs_rename_is_locked() argument 115 return lockdep_is_held(&kernfs_root(kn)->kernfs_rename_lock); in kernfs_rename_is_locked() 118 static inline const char *kernfs_rcu_name(const struct kernfs_node *kn) in kernfs_rcu_name() argument [all …]
|
| H A D | mount.c | 85 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 135 kn = kernfs_find_and_get_node_by_id(info->root, id); in __kernfs_fh_to_dentry() 136 if (!kn) in __kernfs_fh_to_dentry() 142 parent = kernfs_get_parent(kn); in __kernfs_fh_to_dentry() 143 kernfs_put(kn); in __kernfs_fh_to_dentry() 144 kn = parent; in __kernfs_fh_to_dentry() 145 if (!kn) in __kernfs_fh_to_dentry() 149 inode = kernfs_get_inode(sb, kn); in __kernfs_fh_to_dentry() [all …]
|
| /linux/fs/sysfs/ |
| H A D | dir.c | 42 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 D | symlink.c | 24 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 D | group.c | 132 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 …]
|
| /linux/fs/resctrl/ |
| H A D | rdtgroup.c | 278 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 D | ctrlmondata.c | 315 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_schemata_write() 317 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_write() 387 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_write() 428 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_schemata_show() 454 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_show() 471 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_mba_mbps_event_write() 473 rdtgroup_kn_unlock(of->kn); in rdtgroup_mba_mbps_event_write() 504 rdtgroup_kn_unlock(of->kn); in rdtgroup_mba_mbps_event_write() 515 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_mba_mbps_event_show() 534 rdtgroup_kn_unlock(of->kn); in rdtgroup_mba_mbps_event_show() [all …]
|
| H A D | monitor.c | 1106 struct mon_evt *mevt = rdt_kn_parent_priv(of->kn); in event_filter_show() 1111 if (!info_kn_lock(of->kn)) in event_filter_show() 1133 info_kn_unlock(of->kn); in event_filter_show() 1141 struct rdt_resource *r = rdt_kn_parent_priv(of->kn); in resctrl_mbm_assign_on_mkdir_show() 1144 if (!info_kn_lock(of->kn)) in resctrl_mbm_assign_on_mkdir_show() 1157 info_kn_unlock(of->kn); in resctrl_mbm_assign_on_mkdir_show() 1165 struct rdt_resource *r = rdt_kn_parent_priv(of->kn); in resctrl_mbm_assign_on_mkdir_write() 1169 if (!info_kn_lock(of->kn)) in resctrl_mbm_assign_on_mkdir_write() 1188 info_kn_unlock(of->kn); in resctrl_mbm_assign_on_mkdir_write() 1467 struct mon_evt *mevt = rdt_kn_parent_priv(of->kn); in event_filter_write() [all...] |
| /linux/kernel/cgroup/ |
| H A D | cgroup.c | 627 static struct cgroup *kn_priv(struct kernfs_node *kn) 635 parent = rcu_dereference_check(kn->__parent, in cgroup_task_count() 636 kernfs_root_flags(kn) & KERNFS_ROOT_INVARIANT_PARENT); in cgroup_task_count() 642 struct cgroup *cgrp = kn_priv(of->kn); 1644 * @kn: the kernfs_node being serviced in cgroup_calc_subtree_ss_mask() 1652 void cgroup_kn_unlock(struct kernfs_node *kn) in cgroup_calc_subtree_ss_mask() 1656 if (kernfs_type(kn) == KERNFS_DIR) 1657 cgrp = kn->priv; 1659 cgrp = kn_priv(kn); 1663 kernfs_unbreak_active_protection(kn); 643 kn_priv(struct kernfs_node * kn) kn_priv() argument 1665 cgroup_kn_unlock(struct kernfs_node * kn) cgroup_kn_unlock() argument 1697 cgroup_kn_lock_live(struct kernfs_node * kn,bool drain_offline) cgroup_kn_lock_live() argument 4515 struct kernfs_node *kn; cgroup_add_file() local 4790 struct kernfs_node *kn = NULL; cgroup_file_notify() local 4825 struct kernfs_node *kn; cgroup_file_show() local 5972 struct kernfs_node *kn; cgroup_create() local 6397 cgroup_rmdir(struct kernfs_node * kn) cgroup_rmdir() argument 6648 struct kernfs_node *kn; cgroup_path_from_kernfs_id() local 6665 struct kernfs_node *kn; __cgroup_get_from_id() local 7326 struct kernfs_node *kn = kernfs_node_from_dentry(dentry); css_tryget_online_from_dir() local 7379 struct kernfs_node *kn; cgroup_get_from_path() local [all...] |
| H A D | debug.c | 48 if (IS_ERR(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 D | cgroup-v1.c | 508 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() 715 struct kernfs_node *kn = kernfs_node_from_dentry(dentry); 721 if (dentry->d_sb->s_type != &cgroup_fs_type || !kn || in cgroupstats_build() local 722 kernfs_type(kn) != KERNFS_DIR) in cgroupstats_build() 727 * @kn->priv's validity. For this and css_tryget_online_from_dir(), in cgroupstats_build() 728 * @kn->priv is RCU safe. Let's do the RCU dancing. in cgroupstats_build() 731 cgrp = rcu_dereference(*(void __rcu __force **)&kn in cgroupstats_build() 847 cgroup1_rename(struct kernfs_node * kn,struct kernfs_node * new_parent,const char * new_name_str) cgroup1_rename() argument [all...] |
| /linux/scripts/gdb/linux/ |
| H A D | device.py | 73 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 D | xgene_enet_cle.c | 50 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 D | sysfs.h | 420 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 …]
|
| /linux/arch/s390/pci/ |
| H A D | pci_sysfs.c | 82 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 D | test_cgroup1_hierarchy.c | 37 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 D | iters_css.c | 52 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()
|
| /linux/drivers/usb/core/ |
| H A D | port.c | 75 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 D | scx_flatcg.bpf.c | 169 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 D | scx_pair.bpf.c | 267 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 D | memcg_slabinfo.py | 41 name = prefix + '/' + css.cgroup.kn.name.string_().decode('utf-8') 43 MEMCGS[css.cgroup.kn.id.value_()] = memcg
|