/linux/fs/kernfs/ |
A D | dir.c | 44 if (!kn) in kernfs_name_locked() 159 kn = kn->parent; in kernfs_path_from_node_locked() 400 rb_erase(&kn->rb, &kn->parent->dir.children); in kernfs_unlink_sibling() 513 if (!kn || !atomic_dec_and_test(&kn->count)) in kernfs_put() 586 if (!kn) in __kernfs_new_node() 677 if (!kn) in kernfs_find_and_get_node_by_id() 743 kn->hash = kernfs_name_hash(kn->name, kn->ns); in kernfs_add_one() 942 root->kn = kn; in kernfs_create_root() 1321 if (!kn || (kn->parent && RB_EMPTY_NODE(&kn->rb))) in __kernfs_remove() 1543 if (kn) in kernfs_remove_by_name_ns() [all …]
|
A D | inode.c | 34 if (kn->iattr || !alloc) in __kernfs_iattrs() 38 if (!kn->iattr) in __kernfs_iattrs() 46 kn->iattr->ia_mtime = kn->iattr->ia_atime; in __kernfs_iattrs() 47 kn->iattr->ia_ctime = kn->iattr->ia_atime; in __kernfs_iattrs() 53 ret = kn->iattr; in __kernfs_iattrs() 116 if (!kn) in kernfs_iop_setattr() 200 kernfs_get(kn); in kernfs_init_inode() 201 inode->i_private = kn; in kernfs_init_inode() 270 kernfs_put(kn); in kernfs_evict_inode() 276 struct kernfs_node *kn; in kernfs_iop_permission() local [all …]
|
A D | file.c | 68 return kn->attr.ops; in kernfs_ops() 537 on = kn->attr.open; in kernfs_get_open_node() 652 of->kn = kn; in kernfs_fop_open() 881 name = (struct qstr)QSTR_INIT(kn->name, strlen(kn->name)); in kernfs_notify_workfn() 902 kernfs_put(kn); in kernfs_notify_workfn() 934 kernfs_get(kn); in kernfs_notify() 987 if (!kn) in __kernfs_create_file() 992 kn->ns = ns; in __kernfs_create_file() 993 kn->priv = priv; in __kernfs_create_file() 1016 kernfs_put(kn); in __kernfs_create_file() [all …]
|
A D | symlink.c | 40 if (!kn) in kernfs_create_link() 50 return kn; in kernfs_create_link() 52 kernfs_put(kn); in kernfs_create_link() 67 while (kn->parent && base != kn) in kernfs_get_target_path() 68 kn = kn->parent; in kernfs_get_target_path() 82 kn = target; in kernfs_get_target_path() 83 while (kn->parent && kn != base) { in kernfs_get_target_path() 85 kn = kn->parent; in kernfs_get_target_path() 96 kn = target; in kernfs_get_target_path() 97 while (kn->parent && kn != base) { in kernfs_get_target_path() [all …]
|
A D | mount.c | 67 *(u64 *)fh = kn->id; in kernfs_encode_fh() 76 struct kernfs_node *kn; in __kernfs_fh_to_dentry() local 102 if (!kn) in __kernfs_fh_to_dentry() 108 parent = kernfs_get_parent(kn); in __kernfs_fh_to_dentry() 109 kernfs_put(kn); in __kernfs_fh_to_dentry() 110 kn = parent; in __kernfs_fh_to_dentry() 111 if (!kn) in __kernfs_fh_to_dentry() 115 inode = kernfs_get_inode(sb, kn); in __kernfs_fh_to_dentry() 116 kernfs_put(kn); in __kernfs_fh_to_dentry() 206 if (!kn->parent) in kernfs_node_dentry() [all …]
|
A D | kernfs-internal.h | 45 static inline struct kernfs_root *kernfs_root(struct kernfs_node *kn) in kernfs_root() argument 48 if (kn->parent) in kernfs_root() 49 kn = kn->parent; in kernfs_root() 50 return kn->dir.root; in kernfs_root() 120 int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr); 130 struct kernfs_node *kernfs_get_active(struct kernfs_node *kn); 131 void kernfs_put_active(struct kernfs_node *kn); 132 int kernfs_add_one(struct kernfs_node *kn); 143 void kernfs_drain_open_files(struct kernfs_node *kn);
|
/linux/include/linux/ |
A D | kernfs.h | 178 int (*rmdir)(struct kernfs_node *kn); 187 struct kernfs_node *kn; member 204 struct kernfs_node *kn; member 290 return kn->flags & KERNFS_TYPE_MASK; in kernfs_type() 313 return kernfs_id_ino(kn->id); in kernfs_ino() 318 return kernfs_id_gen(kn->id); in kernfs_gen() 333 kn->flags |= KERNFS_NS; in kernfs_enable_ns() 344 return kn->flags & KERNFS_NS; in kernfs_ns_enabled() 357 void kernfs_get(struct kernfs_node *kn); 358 void kernfs_put(struct kernfs_node *kn); [all …]
|
A D | sysfs.h | 266 void sysfs_unbreak_active_protection(struct kernfs_node *kn); 324 static inline void sysfs_enable_ns(struct kernfs_node *kn) in sysfs_enable_ns() argument 326 return kernfs_enable_ns(kn); in sysfs_enable_ns() 553 static inline void sysfs_enable_ns(struct kernfs_node *kn) in sysfs_enable_ns() argument 622 static inline void sysfs_notify_dirent(struct kernfs_node *kn) in sysfs_notify_dirent() argument 624 kernfs_notify(kn); in sysfs_notify_dirent() 633 static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn) in sysfs_get() argument 635 kernfs_get(kn); in sysfs_get() 636 return kn; in sysfs_get() 639 static inline void sysfs_put(struct kernfs_node *kn) in sysfs_put() argument [all …]
|
A D | cgroup.h | 312 return cgrp->kn->id; in cgroup_id() 627 return kernfs_ino(cgrp->kn); in cgroup_ino() 633 return of->kn->priv; in of_cft() 656 return kernfs_name(cgrp->kn, buf, buflen); in cgroup_name() 661 return kernfs_path(cgrp->kn, buf, buflen); in cgroup_path() 666 pr_cont_kernfs_name(cgrp->kn); in pr_cont_cgroup_name() 671 pr_cont_kernfs_path(cgrp->kn); in pr_cont_cgroup_path()
|
/linux/fs/sysfs/ |
A D | file.c | 184 if (kn && dir) in sysfs_notify() 185 kn = kernfs_find_and_get(kn, dir); in sysfs_notify() 187 kernfs_get(kn); in sysfs_notify() 191 kernfs_put(kn); in sysfs_notify() 192 kn = tmp; in sysfs_notify() 195 if (kn) { in sysfs_notify() 421 if (!kn) in sysfs_chmod_file() 451 if (kn) in sysfs_break_active_protection() 453 return kn; in sysfs_break_active_protection() 621 if (!kn) in sysfs_link_change_owner() [all …]
|
A D | dir.c | 42 struct kernfs_node *parent, *kn; in sysfs_create_dir_ns() local 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() 99 if (kn) { in sysfs_remove_dir() 101 kernfs_remove(kn); in sysfs_remove_dir() 126 return kernfs_rename_ns(kn, new_parent, kn->name, new_ns); in sysfs_move_dir_ns() 139 if (IS_ERR(kn)) { in sysfs_create_mount_point() 140 if (PTR_ERR(kn) == -EEXIST) in sysfs_create_mount_point() [all …]
|
A D | group.c | 130 if (!kn) { in internal_create_group() 146 kn = kobj->sd; in internal_create_group() 147 kernfs_get(kn); in internal_create_group() 153 kernfs_put(kn); in internal_create_group() 156 kernfs_put(kn); in internal_create_group() 277 if (!kn) { in sysfs_remove_group() 284 kn = parent; in sysfs_remove_group() 285 kernfs_get(kn); in sysfs_remove_group() 292 kernfs_put(kn); in sysfs_remove_group() 479 if (!kn) in sysfs_group_attrs_change_owner() [all …]
|
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() 169 struct kernfs_node *parent, *kn = NULL; in sysfs_rename_link_ns() local 182 kn = kernfs_find_and_get_ns(parent, old, old_ns); in sysfs_rename_link_ns() 183 if (!kn) in sysfs_rename_link_ns() 187 if (kernfs_type(kn) != KERNFS_LINK) in sysfs_rename_link_ns() 189 if (kn->symlink.target_kn->priv != targ) in sysfs_rename_link_ns() [all …]
|
/linux/arch/x86/kernel/cpu/resctrl/ |
A D | rdtgroup.c | 213 if (IS_ERR(kn)) in rdtgroup_add_file() 1646 kn = kernfs_find_and_get_ns(r->kn, name, NULL); in rdtgroup_kn_mode_restrict() 1647 if (!kn) in rdtgroup_kn_mode_restrict() 1663 kernfs_put(kn); in rdtgroup_kn_mode_restrict() 1694 kn = kernfs_find_and_get_ns(r->kn, name, NULL); in rdtgroup_kn_mode_restore() 1695 if (!kn) in rdtgroup_kn_mode_restore() 1716 kernfs_put(kn); in rdtgroup_kn_mode_restore() 1982 if (kn == kn_info || kn->parent == kn_info) in kernfs_to_rdtgroup() 2873 rdtgrp->kn = kn; in mkdir_rdt_prepare() 2980 kn = rdtgrp->kn; in rdtgroup_mkdir_ctrl_mon() [all …]
|
A D | ctrlmondata.c | 367 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_schemata_write() 369 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_write() 425 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_write() 470 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_schemata_show() 497 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_show() 530 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_mondata_show() 536 md.priv = of->kn->priv; in rdtgroup_mondata_show() 559 rdtgroup_kn_unlock(of->kn); in rdtgroup_mondata_show()
|
A D | internal.h | 217 struct kernfs_node *kn; member 500 struct rdtgroup *rdtgroup_kn_lock_live(struct kernfs_node *kn); 501 void rdtgroup_kn_unlock(struct kernfs_node *kn);
|
/linux/kernel/cgroup/ |
A D | cgroup.c | 2027 root_cgrp->kn = root->kf_root->kn; in cgroup_setup_root() 2286 return kernfs_path_from_node(cgrp->kn, root->kn, buf, buflen); in cgroup_path_ns_locked() 4020 cfile->kn = kn; in cgroup_add_file() 5191 if (cgrp->kn) in css_release_work_fn() 5363 kn = kernfs_create_dir(parent->kn, name, mode, cgrp); in cgroup_create() 5368 cgrp->kn = kn; in cgroup_create() 5952 if (!kn) in cgroup_path_from_kernfs_id() 5969 if (!kn) in cgroup_get_from_id() 6494 !kn || kernfs_type(kn) != KERNFS_DIR) in css_tryget_online_from_dir() 6543 kn = kernfs_walk_and_get(cgrp_dfl_root.cgrp.kn, path); in cgroup_get_from_path() [all …]
|
A D | cgroup-v1.c | 499 cgrp = cgroup_kn_lock_live(of->kn, false); in __cgroup1_procs_write() 528 cgroup_kn_unlock(of->kn); in __cgroup1_procs_write() 552 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_release_agent_write() 559 cgroup_kn_unlock(of->kn); in cgroup_release_agent_write() 698 kernfs_type(kn) != KERNFS_DIR) in cgroupstats_build() 820 struct cgroup *cgrp = kn->priv; in cgroup1_rename() 827 if (kernfs_type(kn) != KERNFS_DIR) in cgroup1_rename() 829 if (kn->parent != new_parent) in cgroup1_rename() 838 kernfs_break_active_protection(kn); in cgroup1_rename() 842 ret = kernfs_rename(kn, new_parent, new_name_str); in cgroup1_rename() [all …]
|
A D | debug.c | 48 if (!cgroup_kn_lock_live(of->kn, false)) in current_css_set_read() 72 cgroup_kn_unlock(of->kn); in current_css_set_read() 212 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_subsys_states_read() 232 cgroup_kn_unlock(of->kn); in cgroup_subsys_states_read() 260 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_masks_read() 267 cgroup_kn_unlock(of->kn); in cgroup_masks_read()
|
A D | cgroup-internal.h | 232 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline); 233 void cgroup_kn_unlock(struct kernfs_node *kn); 262 int cgroup_rmdir(struct kernfs_node *kn);
|
/linux/drivers/net/ethernet/apm/xgene/ |
A D | xgene_enet_cle.c | 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() 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() 809 kn.key[0].priority = 0; in xgene_enet_cle_init() 810 kn.key[0].result_pointer = DB_RES_ACCEPT; in xgene_enet_cle_init() [all …]
|
/linux/scripts/gdb/linux/ |
A D | device.py | 73 for kn in klist_for_each(bus['p']['klist_devices']): 74 dp = container_of(kn, device_private_type.get_type().pointer(), 'knode_bus') 79 for kn in klist_for_each(cls['p']['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/arch/s390/pci/ |
A D | pci_sysfs.c | 55 struct kernfs_node *kn; in recover_store() local 70 kn = sysfs_break_active_protection(&dev->kobj, &attr->attr); in recover_store() 71 WARN_ON_ONCE(!kn); in recover_store() 117 if (kn) in recover_store() 118 sysfs_unbreak_active_protection(kn); in recover_store()
|
/linux/drivers/of/ |
A D | kobj.c | 43 struct kernfs_node *kn; in safe_name() local 47 while (i < 16 && (kn = sysfs_get_dirent(kobj->sd, name))) { in safe_name() 48 sysfs_put(kn); in safe_name()
|
/linux/tools/cgroup/ |
A D | memcg_slabinfo.py | 41 name = prefix + '/' + css.cgroup.kn.name.string_().decode('utf-8') 43 MEMCGS[css.cgroup.kn.id.value_()] = memcg
|