/kernel/linux/linux-5.10/fs/kernfs/ |
D | dir.c | 27 static bool kernfs_active(struct kernfs_node *kn) in kernfs_active() argument 30 return atomic_read(&kn->active) >= 0; in kernfs_active() 33 static bool kernfs_lockdep(struct kernfs_node *kn) in kernfs_lockdep() argument 36 return kn->flags & KERNFS_LOCKDEP; in kernfs_lockdep() 42 static int kernfs_name_locked(struct kernfs_node *kn, char *buf, size_t buflen) in kernfs_name_locked() argument 44 if (!kn) in kernfs_name_locked() 47 return strlcpy(buf, kn->parent ? kn->name : "/", buflen); in kernfs_name_locked() 71 da = kernfs_depth(ra->kn, a); in kernfs_common_ancestor() 72 db = kernfs_depth(rb->kn, b); in kernfs_common_ancestor() 126 struct kernfs_node *kn, *common; in kernfs_path_from_node_locked() local [all …]
|
D | inode.c | 33 static struct kernfs_iattrs *__kernfs_iattrs(struct kernfs_node *kn, int alloc) in __kernfs_iattrs() argument 40 if (kn->iattr || !alloc) in __kernfs_iattrs() 43 kn->iattr = kmem_cache_zalloc(kernfs_iattrs_cache, GFP_KERNEL); in __kernfs_iattrs() 44 if (!kn->iattr) in __kernfs_iattrs() 48 kn->iattr->ia_uid = GLOBAL_ROOT_UID; in __kernfs_iattrs() 49 kn->iattr->ia_gid = GLOBAL_ROOT_GID; in __kernfs_iattrs() 51 ktime_get_real_ts64(&kn->iattr->ia_atime); in __kernfs_iattrs() 52 kn->iattr->ia_mtime = kn->iattr->ia_atime; in __kernfs_iattrs() 53 kn->iattr->ia_ctime = kn->iattr->ia_atime; in __kernfs_iattrs() 55 simple_xattrs_init(&kn->iattr->xattrs); in __kernfs_iattrs() [all …]
|
D | symlink.c | 29 struct kernfs_node *kn; in kernfs_create_link() local 39 kn = kernfs_new_node(parent, name, S_IFLNK|S_IRWXUGO, uid, gid, in kernfs_create_link() 41 if (!kn) in kernfs_create_link() 45 kn->ns = target->ns; in kernfs_create_link() 46 kn->symlink.target_kn = target; in kernfs_create_link() 49 error = kernfs_add_one(kn); in kernfs_create_link() 51 return kn; in kernfs_create_link() 53 kernfs_put(kn); in kernfs_create_link() 60 struct kernfs_node *base, *kn; in kernfs_get_target_path() local 67 kn = target->parent; in kernfs_get_target_path() [all …]
|
D | file.c | 64 static const struct kernfs_ops *kernfs_ops(struct kernfs_node *kn) in kernfs_ops() argument 66 if (kn->flags & KERNFS_LOCKDEP) in kernfs_ops() 67 lockdep_assert_held(kn); in kernfs_ops() 68 return kn->attr.ops; in kernfs_ops() 96 const struct kernfs_ops *ops = kernfs_ops(of->kn); in kernfs_seq_stop_active() 100 kernfs_put_active(of->kn); in kernfs_seq_stop_active() 113 if (!kernfs_get_active(of->kn)) in kernfs_seq_start() 116 ops = kernfs_ops(of->kn); in kernfs_seq_start() 135 const struct kernfs_ops *ops = kernfs_ops(of->kn); in kernfs_seq_next() 166 of->event = atomic_read(&of->kn->attr.open->event); in kernfs_seq_show() [all …]
|
D | kernfs-internal.h | 44 static inline struct kernfs_root *kernfs_root(struct kernfs_node *kn) in kernfs_root() argument 47 if (kn->parent) in kernfs_root() 48 kn = kn->parent; in kernfs_root() 49 return kn->dir.root; in kernfs_root() 97 int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr); 107 struct kernfs_node *kernfs_get_active(struct kernfs_node *kn); 108 void kernfs_put_active(struct kernfs_node *kn); 109 int kernfs_add_one(struct kernfs_node *kn); 120 void kernfs_drain_open_files(struct kernfs_node *kn);
|
D | mount.c | 59 struct kernfs_node *kn = inode->i_private; in kernfs_encode_fh() local 67 *(u64 *)fh = kn->id; in kernfs_encode_fh() 76 struct kernfs_node *kn; in __kernfs_fh_to_dentry() local 101 kn = kernfs_find_and_get_node_by_id(info->root, id); in __kernfs_fh_to_dentry() 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() [all …]
|
/kernel/linux/linux-5.10/include/linux/ |
D | kernfs.h | 173 int (*rmdir)(struct kernfs_node *kn); 174 int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent, 176 int (*show_path)(struct seq_file *sf, struct kernfs_node *kn, 182 struct kernfs_node *kn; member 199 struct kernfs_node *kn; member 287 static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) in kernfs_type() argument 289 return kn->flags & KERNFS_TYPE_MASK; in kernfs_type() 310 static inline ino_t kernfs_ino(struct kernfs_node *kn) in kernfs_ino() argument 312 return kernfs_id_ino(kn->id); in kernfs_ino() 315 static inline ino_t kernfs_gen(struct kernfs_node *kn) in kernfs_gen() argument [all …]
|
D | sysfs.h | 258 void sysfs_unbreak_active_protection(struct kernfs_node *kn); 316 static inline void sysfs_enable_ns(struct kernfs_node *kn) in sysfs_enable_ns() argument 318 return kernfs_enable_ns(kn); in sysfs_enable_ns() 398 static inline void sysfs_unbreak_active_protection(struct kernfs_node *kn) in sysfs_unbreak_active_protection() argument 545 static inline void sysfs_enable_ns(struct kernfs_node *kn) in sysfs_enable_ns() argument 614 static inline void sysfs_notify_dirent(struct kernfs_node *kn) in sysfs_notify_dirent() argument 616 kernfs_notify(kn); in sysfs_notify_dirent() 625 static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn) in sysfs_get() argument 627 kernfs_get(kn); in sysfs_get() 628 return kn; in sysfs_get() [all …]
|
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()
|
/kernel/linux/linux-5.10/fs/sysfs/ |
D | file.c | 26 static const struct sysfs_ops *sysfs_file_ops(struct kernfs_node *kn) in sysfs_file_ops() argument 28 struct kobject *kobj = kn->parent->priv; in sysfs_file_ops() 30 if (kn->flags & KERNFS_LOCKDEP) in sysfs_file_ops() 31 lockdep_assert_held(kn); in sysfs_file_ops() 43 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_seq_show() 44 const struct sysfs_ops *ops = sysfs_file_ops(of->kn); in sysfs_kf_seq_show() 61 count = ops->show(kobj, of->kn->priv, buf); in sysfs_kf_seq_show() 83 struct bin_attribute *battr = of->kn->priv; in sysfs_kf_bin_read() 84 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_read() 107 const struct sysfs_ops *ops = sysfs_file_ops(of->kn); in sysfs_kf_read() [all …]
|
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), in sysfs_create_dir_ns() 62 if (IS_ERR(kn)) { in sysfs_create_dir_ns() 63 if (PTR_ERR(kn) == -EEXIST) in sysfs_create_dir_ns() 65 return PTR_ERR(kn); in sysfs_create_dir_ns() 68 kobj->sd = kn; in sysfs_create_dir_ns() 82 struct kernfs_node *kn = kobj->sd; in sysfs_remove_dir() local 100 if (kn) { in sysfs_remove_dir() 101 WARN_ON_ONCE(kernfs_type(kn) != KERNFS_DIR); in sysfs_remove_dir() 102 kernfs_remove(kn); in sysfs_remove_dir() [all …]
|
D | group.c | 111 struct kernfs_node *kn; in internal_create_group() local 130 kn = kernfs_find_and_get(kobj->sd, grp->name); in internal_create_group() 131 if (!kn) { in internal_create_group() 137 kn = kernfs_create_dir_ns(kobj->sd, grp->name, in internal_create_group() 140 if (IS_ERR(kn)) { in internal_create_group() 141 if (PTR_ERR(kn) == -EEXIST) in internal_create_group() 143 return PTR_ERR(kn); in internal_create_group() 147 kn = kobj->sd; in internal_create_group() 148 kernfs_get(kn); in internal_create_group() 149 error = create_files(kn, kobj, uid, gid, grp, update); in internal_create_group() [all …]
|
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() 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() [all …]
|
D | sysfs.h | 38 int sysfs_create_link_sd(struct kernfs_node *kn, struct kobject *target,
|
/kernel/linux/linux-5.10/arch/x86/kernel/cpu/resctrl/ |
D | rdtgroup.c | 189 static int rdtgroup_kn_set_ugid(struct kernfs_node *kn) in rdtgroup_kn_set_ugid() argument 199 return kernfs_setattr(kn, &iattr); in rdtgroup_kn_set_ugid() 204 struct kernfs_node *kn; in rdtgroup_add_file() local 207 kn = __kernfs_create_file(parent_kn, rft->name, rft->mode, in rdtgroup_add_file() 210 if (IS_ERR(kn)) in rdtgroup_add_file() 211 return PTR_ERR(kn); in rdtgroup_add_file() 213 ret = rdtgroup_kn_set_ugid(kn); in rdtgroup_add_file() 215 kernfs_remove(kn); in rdtgroup_add_file() 225 struct rftype *rft = of->kn->priv; in rdtgroup_seqfile_show() 235 struct rftype *rft = of->kn->priv; in rdtgroup_file_write() [all …]
|
D | ctrlmondata.c | 312 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_schemata_write() 314 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_write() 369 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_write() 402 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_schemata_show() 428 rdtgroup_kn_unlock(of->kn); in rdtgroup_schemata_show() 460 rdtgrp = rdtgroup_kn_lock_live(of->kn); in rdtgroup_mondata_show() 466 md.priv = of->kn->priv; in rdtgroup_mondata_show() 488 rdtgroup_kn_unlock(of->kn); in rdtgroup_mondata_show()
|
/kernel/linux/linux-5.10/scripts/gdb/linux/ |
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')
|
/kernel/linux/linux-5.10/drivers/net/ethernet/apm/xgene/ |
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 …]
|
/kernel/linux/linux-5.10/kernel/cgroup/ |
D | cgroup.c | 625 struct cgroup *cgrp = of->kn->parent->priv; in of_css() 1276 struct cgroup *root_cgrp = kf_root->kn->priv; in cgroup_root_from_kf() 1553 void cgroup_kn_unlock(struct kernfs_node *kn) in cgroup_kn_unlock() argument 1557 if (kernfs_type(kn) == KERNFS_DIR) in cgroup_kn_unlock() 1558 cgrp = kn->priv; in cgroup_kn_unlock() 1560 cgrp = kn->parent->priv; in cgroup_kn_unlock() 1564 kernfs_unbreak_active_protection(kn); in cgroup_kn_unlock() 1585 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline) in cgroup_kn_lock_live() argument 1589 if (kernfs_type(kn) == KERNFS_DIR) in cgroup_kn_lock_live() 1590 cgrp = kn->priv; in cgroup_kn_lock_live() [all …]
|
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()
|
D | cgroup-v1.c | 498 cgrp = cgroup_kn_lock_live(of->kn, false); in __cgroup1_procs_write() 532 cgroup_kn_unlock(of->kn); in __cgroup1_procs_write() 564 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_release_agent_write() 571 cgroup_kn_unlock(of->kn); in cgroup_release_agent_write() 708 struct kernfs_node *kn = kernfs_node_from_dentry(dentry); in cgroupstats_build() local 714 if (dentry->d_sb->s_type != &cgroup_fs_type || !kn || in cgroupstats_build() 715 kernfs_type(kn) != KERNFS_DIR) in cgroupstats_build() 726 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in cgroupstats_build() 837 static int cgroup1_rename(struct kernfs_node *kn, struct kernfs_node *new_parent, in cgroup1_rename() argument 840 struct cgroup *cgrp = kn->priv; in cgroup1_rename() [all …]
|
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);
|
/kernel/linux/linux-5.10/arch/s390/pci/ |
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() 96 if (kn) in recover_store() 97 sysfs_unbreak_active_protection(kn); in recover_store()
|
/kernel/linux/linux-5.10/drivers/of/ |
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()
|
/kernel/linux/linux-5.10/tools/cgroup/ |
D | memcg_slabinfo.py | 41 name = prefix + '/' + css.cgroup.kn.name.string_().decode('utf-8') 43 MEMCGS[css.cgroup.kn.id.value_()] = memcg
|