/Linux-v4.19/lib/ |
D | kobject.c | 28 const void *kobject_namespace(struct kobject *kobj) in kobject_namespace() argument 30 const struct kobj_ns_type_operations *ns_ops = kobj_ns_ops(kobj); in kobject_namespace() 35 return kobj->ktype->namespace(kobj); in kobject_namespace() 48 void kobject_get_ownership(struct kobject *kobj, kuid_t *uid, kgid_t *gid) in kobject_get_ownership() argument 53 if (kobj->ktype->get_ownership) in kobject_get_ownership() 54 kobj->ktype->get_ownership(kobj, uid, gid); in kobject_get_ownership() 66 static int populate_dir(struct kobject *kobj) in populate_dir() argument 68 struct kobj_type *t = get_ktype(kobj); in populate_dir() 75 error = sysfs_create_file(kobj, attr); in populate_dir() 83 static int create_dir(struct kobject *kobj) in create_dir() argument [all …]
|
D | kobject_uevent.c | 192 int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count) in kobject_synth_uevent() argument 208 r = kobject_uevent_env(kobj, action, no_uuid_envp); in kobject_synth_uevent() 222 r = kobject_uevent_env(kobj, action, env->envp); in kobject_synth_uevent() 226 devpath = kobject_get_path(kobj, GFP_KERNEL); in kobject_synth_uevent() 236 static int kobj_usermode_filter(struct kobject *kobj) in kobj_usermode_filter() argument 240 ops = kobj_ns_ops(kobj); in kobj_usermode_filter() 243 ns = kobj->ktype->namespace(kobj); in kobj_usermode_filter() 379 static int kobject_uevent_net_broadcast(struct kobject *kobj, in kobject_uevent_net_broadcast() argument 390 ops = kobj_ns_ops(kobj); in kobject_uevent_net_broadcast() 391 if (!ops && kobj->kset) { in kobject_uevent_net_broadcast() [all …]
|
/Linux-v4.19/include/linux/ |
D | kobject.h | 84 int kobject_set_name(struct kobject *kobj, const char *name, ...); 86 int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, 89 static inline const char *kobject_name(const struct kobject *kobj) in kobject_name() argument 91 return kobj->name; in kobject_name() 94 extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); 96 int kobject_add(struct kobject *kobj, struct kobject *parent, 99 int kobject_init_and_add(struct kobject *kobj, 103 extern void kobject_del(struct kobject *kobj); 112 extern struct kobject *kobject_get(struct kobject *kobj); 114 struct kobject *kobj); [all …]
|
D | sysfs.h | 221 int __must_check sysfs_create_dir_ns(struct kobject *kobj, const void *ns); 222 void sysfs_remove_dir(struct kobject *kobj); 223 int __must_check sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name, 225 int __must_check sysfs_move_dir_ns(struct kobject *kobj, 233 int __must_check sysfs_create_file_ns(struct kobject *kobj, 236 int __must_check sysfs_create_files(struct kobject *kobj, 238 int __must_check sysfs_chmod_file(struct kobject *kobj, 240 struct kernfs_node *sysfs_break_active_protection(struct kobject *kobj, 243 void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, 245 bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr); [all …]
|
/Linux-v4.19/fs/sysfs/ |
D | file.c | 28 struct kobject *kobj = kn->parent->priv; in sysfs_file_ops() local 32 return kobj->ktype ? kobj->ktype->sysfs_ops : NULL; in sysfs_file_ops() 43 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_seq_show() local 61 count = ops->show(kobj, of->kn->priv, buf); in sysfs_kf_seq_show() 84 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_read() local 100 return battr->read(of->file, kobj, battr, buf, pos, count); in sysfs_kf_bin_read() 108 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_read() local 117 len = ops->show(kobj, of->kn->priv, buf); in sysfs_kf_read() 134 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_write() local 139 return ops->store(kobj, of->kn->priv, buf, count); in sysfs_kf_write() [all …]
|
D | group.c | 33 static int create_files(struct kernfs_node *parent, struct kobject *kobj, in create_files() argument 53 mode = grp->is_visible(kobj, *attr, i); in create_files() 82 mode = grp->is_bin_visible(kobj, *bin_attr, i); in create_files() 107 static int internal_create_group(struct kobject *kobj, int update, in internal_create_group() argument 115 BUG_ON(!kobj || (!update && !kobj->sd)); in internal_create_group() 118 if (unlikely(update && !kobj->sd)) in internal_create_group() 122 kobj->name, grp->name ?: ""); in internal_create_group() 125 kobject_get_ownership(kobj, &uid, &gid); in internal_create_group() 128 kn = kernfs_find_and_get(kobj->sd, grp->name); in internal_create_group() 131 kobj->name, grp->name); in internal_create_group() [all …]
|
D | dir.c | 40 int sysfs_create_dir_ns(struct kobject *kobj, const void *ns) in sysfs_create_dir_ns() argument 46 BUG_ON(!kobj); in sysfs_create_dir_ns() 48 if (kobj->parent) in sysfs_create_dir_ns() 49 parent = kobj->parent->sd; in sysfs_create_dir_ns() 56 kobject_get_ownership(kobj, &uid, &gid); in sysfs_create_dir_ns() 58 kn = kernfs_create_dir_ns(parent, kobject_name(kobj), in sysfs_create_dir_ns() 60 kobj, ns); in sysfs_create_dir_ns() 63 sysfs_warn_dup(parent, kobject_name(kobj)); in sysfs_create_dir_ns() 67 kobj->sd = kn; in sysfs_create_dir_ns() 79 void sysfs_remove_dir(struct kobject *kobj) in sysfs_remove_dir() argument [all …]
|
D | symlink.c | 66 static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, in sysfs_do_create_link() argument 71 if (!kobj) in sysfs_do_create_link() 74 parent = kobj->sd; in sysfs_do_create_link() 88 int sysfs_create_link(struct kobject *kobj, struct kobject *target, in sysfs_create_link() argument 91 return sysfs_do_create_link(kobj, target, name, 1); in sysfs_create_link() 104 int sysfs_create_link_nowarn(struct kobject *kobj, struct kobject *target, in sysfs_create_link_nowarn() argument 107 return sysfs_do_create_link(kobj, target, name, 0); in sysfs_create_link_nowarn() 120 void sysfs_delete_link(struct kobject *kobj, struct kobject *targ, in sysfs_delete_link() argument 131 if (targ->sd && kernfs_ns_enabled(kobj->sd)) in sysfs_delete_link() 134 kernfs_remove_by_name_ns(kobj->sd, name, ns); in sysfs_delete_link() [all …]
|
/Linux-v4.19/drivers/vfio/mdev/ |
D | mdev_sysfs.c | 24 static ssize_t mdev_type_attr_show(struct kobject *kobj, in mdev_type_attr_show() argument 28 struct mdev_type *type = to_mdev_type(kobj); in mdev_type_attr_show() 32 ret = attr->show(kobj, type->parent->dev, buf); in mdev_type_attr_show() 36 static ssize_t mdev_type_attr_store(struct kobject *kobj, in mdev_type_attr_store() argument 41 struct mdev_type *type = to_mdev_type(kobj); in mdev_type_attr_store() 45 ret = attr->store(&type->kobj, type->parent->dev, buf, count); in mdev_type_attr_store() 54 static ssize_t create_store(struct kobject *kobj, struct device *dev, in create_store() argument 73 ret = mdev_device_create(kobj, dev, uuid); in create_store() 82 static void mdev_type_release(struct kobject *kobj) in mdev_type_release() argument 84 struct mdev_type *type = to_mdev_type(kobj); in mdev_type_release() [all …]
|
/Linux-v4.19/drivers/cpuidle/ |
D | sysfs.c | 151 return sysfs_create_group(&dev->kobj, &cpuidle_attr_group); in cpuidle_add_interface() 159 sysfs_remove_group(&dev->kobj, &cpuidle_attr_group); in cpuidle_remove_interface() 178 struct kobject kobj; member 181 static inline struct cpuidle_device *to_cpuidle_device(struct kobject *kobj) in to_cpuidle_device() argument 184 container_of(kobj, struct cpuidle_device_kobj, kobj); in to_cpuidle_device() 189 static ssize_t cpuidle_show(struct kobject *kobj, struct attribute *attr, in cpuidle_show() argument 193 struct cpuidle_device *dev = to_cpuidle_device(kobj); in cpuidle_show() 204 static ssize_t cpuidle_store(struct kobject *kobj, struct attribute *attr, in cpuidle_store() argument 208 struct cpuidle_device *dev = to_cpuidle_device(kobj); in cpuidle_store() 224 static void cpuidle_sysfs_release(struct kobject *kobj) in cpuidle_sysfs_release() argument [all …]
|
/Linux-v4.19/drivers/edac/ |
D | edac_device_sysfs.c | 23 #define to_edacdev(k) container_of(k, struct edac_device_ctl_info, kobj) 113 #define to_ctl_info(k) container_of(k, struct edac_device_ctl_info, kobj) 117 static ssize_t edac_dev_ctl_info_show(struct kobject *kobj, in edac_dev_ctl_info_show() argument 120 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj); in edac_dev_ctl_info_show() 129 static ssize_t edac_dev_ctl_info_store(struct kobject *kobj, in edac_dev_ctl_info_store() argument 133 struct edac_device_ctl_info *edac_dev = to_ctl_info(kobj); in edac_dev_ctl_info_store() 201 static void edac_device_ctrl_master_release(struct kobject *kobj) in edac_device_ctrl_master_release() argument 203 struct edac_device_ctl_info *edac_dev = to_edacdev(kobj); in edac_device_ctrl_master_release() 245 memset(&edac_dev->kobj, 0, sizeof(struct kobject)); in edac_device_register_sysfs_main_kobj() 258 err = kobject_init_and_add(&edac_dev->kobj, &ktype_device_ctrl, in edac_device_register_sysfs_main_kobj() [all …]
|
/Linux-v4.19/net/batman-adv/ |
D | sysfs.c | 55 struct device *dev = container_of(obj->parent, struct device, kobj); in batadv_kobj_to_netdev() 101 if (vlan_tmp->kobj != obj) in batadv_kobj_to_vlan() 150 ssize_t batadv_store_##_name(struct kobject *kobj, \ 154 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ 162 ssize_t batadv_show_##_name(struct kobject *kobj, \ 165 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ 182 ssize_t batadv_store_##_name(struct kobject *kobj, \ 186 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \ 196 ssize_t batadv_show_##_name(struct kobject *kobj, \ 199 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \ [all …]
|
/Linux-v4.19/drivers/of/ |
D | kobj.c | 10 return node && node->kobj.state_initialized; in of_node_is_initialized() 16 return node && node->kobj.state_in_sysfs; in of_node_is_attached() 21 static void of_node_release(struct kobject *kobj) in of_node_release() argument 31 static ssize_t of_node_property_read(struct file *filp, struct kobject *kobj, in of_node_property_read() argument 40 static const char *safe_name(struct kobject *kobj, const char *orig_name) in safe_name() argument 47 while (i < 16 && (kn = sysfs_get_dirent(kobj->sd, name))) { in safe_name() 58 kobject_name(kobj), name); in safe_name() 77 pp->attr.attr.name = safe_name(&np->kobj, pp->name); in __of_add_property_sysfs() 82 rc = sysfs_create_bin_file(&np->kobj, &pp->attr); in __of_add_property_sysfs() 92 sysfs_remove_bin_file(&np->kobj, &prop->attr); in __of_sysfs_remove_bin_file() [all …]
|
/Linux-v4.19/drivers/w1/slaves/ |
D | w1_ds2408.c | 69 static ssize_t state_read(struct file *filp, struct kobject *kobj, in state_read() argument 73 dev_dbg(&kobj_to_w1_slave(kobj)->dev, in state_read() 75 bin_attr->attr.name, kobj, (unsigned int)off, count, buf); in state_read() 78 return _read_reg(kobj_to_w1_slave(kobj), W1_F29_REG_LOGIG_STATE, buf); in state_read() 81 static ssize_t output_read(struct file *filp, struct kobject *kobj, in output_read() argument 85 dev_dbg(&kobj_to_w1_slave(kobj)->dev, in output_read() 87 bin_attr->attr.name, kobj, (unsigned int)off, count, buf); in output_read() 90 return _read_reg(kobj_to_w1_slave(kobj), in output_read() 94 static ssize_t activity_read(struct file *filp, struct kobject *kobj, in activity_read() argument 98 dev_dbg(&kobj_to_w1_slave(kobj)->dev, in activity_read() [all …]
|
/Linux-v4.19/fs/btrfs/ |
D | sysfs.c | 20 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj); 21 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj); 78 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() argument 82 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show() 94 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() argument 104 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store() 162 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() argument 165 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_visible() 224 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show() argument 258 static ssize_t global_rsv_size_show(struct kobject *kobj, in global_rsv_size_show() argument [all …]
|
/Linux-v4.19/block/ |
D | blk-mq-sysfs.c | 16 static void blk_mq_sysfs_release(struct kobject *kobj) in blk_mq_sysfs_release() argument 20 static void blk_mq_hw_sysfs_release(struct kobject *kobj) in blk_mq_hw_sysfs_release() argument 22 struct blk_mq_hw_ctx *hctx = container_of(kobj, struct blk_mq_hw_ctx, in blk_mq_hw_sysfs_release() 23 kobj); in blk_mq_hw_sysfs_release() 41 static ssize_t blk_mq_sysfs_show(struct kobject *kobj, struct attribute *attr, in blk_mq_sysfs_show() argument 50 ctx = container_of(kobj, struct blk_mq_ctx, kobj); in blk_mq_sysfs_show() 64 static ssize_t blk_mq_sysfs_store(struct kobject *kobj, struct attribute *attr, in blk_mq_sysfs_store() argument 73 ctx = container_of(kobj, struct blk_mq_ctx, kobj); in blk_mq_sysfs_store() 87 static ssize_t blk_mq_hw_sysfs_show(struct kobject *kobj, in blk_mq_hw_sysfs_show() argument 96 hctx = container_of(kobj, struct blk_mq_hw_ctx, kobj); in blk_mq_hw_sysfs_show() [all …]
|
/Linux-v4.19/arch/powerpc/platforms/powernv/ |
D | opal-elog.c | 25 struct kobject kobj; member 32 #define to_elog_obj(x) container_of(x, struct elog_obj, kobj) 80 sysfs_remove_file_self(&elog_obj->kobj, &attr->attr); in elog_ack_store() 81 kobject_put(&elog_obj->kobj); in elog_ack_store() 94 static ssize_t elog_attr_show(struct kobject *kobj, in elog_attr_show() argument 102 elog = to_elog_obj(kobj); in elog_attr_show() 110 static ssize_t elog_attr_store(struct kobject *kobj, in elog_attr_store() argument 118 elog = to_elog_obj(kobj); in elog_attr_store() 131 static void elog_release(struct kobject *kobj) in elog_release() argument 135 elog = to_elog_obj(kobj); in elog_release() [all …]
|
D | opal-dump.c | 25 struct kobject kobj; member 32 #define to_dump_obj(x) container_of(x, struct dump_obj, kobj) 96 sysfs_remove_file_self(&dump_obj->kobj, &attr->attr); in dump_ack_store() 97 kobject_put(&dump_obj->kobj); in dump_ack_store() 158 static ssize_t dump_attr_show(struct kobject *kobj, in dump_attr_show() argument 166 dump = to_dump_obj(kobj); in dump_attr_show() 174 static ssize_t dump_attr_store(struct kobject *kobj, in dump_attr_store() argument 182 dump = to_dump_obj(kobj); in dump_attr_store() 195 static void dump_release(struct kobject *kobj) in dump_release() argument 199 dump = to_dump_obj(kobj); in dump_release() [all …]
|
/Linux-v4.19/fs/xfs/ |
D | xfs_sysfs.h | 24 struct xfs_kobj *kobj = to_kobj(kobject); in xfs_sysfs_release() local 25 complete(&kobj->complete); in xfs_sysfs_release() 30 struct xfs_kobj *kobj, in xfs_sysfs_init() argument 35 init_completion(&kobj->complete); in xfs_sysfs_init() 36 return kobject_init_and_add(&kobj->kobject, ktype, in xfs_sysfs_init() 42 struct xfs_kobj *kobj) in xfs_sysfs_del() argument 44 kobject_del(&kobj->kobject); in xfs_sysfs_del() 45 kobject_put(&kobj->kobject); in xfs_sysfs_del() 46 wait_for_completion(&kobj->complete); in xfs_sysfs_del()
|
/Linux-v4.19/drivers/base/ |
D | core.c | 757 static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr, in dev_attr_show() argument 761 struct device *dev = kobj_to_dev(kobj); in dev_attr_show() 773 static ssize_t dev_attr_store(struct kobject *kobj, struct attribute *attr, in dev_attr_store() argument 777 struct device *dev = kobj_to_dev(kobj); in dev_attr_store() 870 static void device_release(struct kobject *kobj) in device_release() argument 872 struct device *dev = kobj_to_dev(kobj); in device_release() 899 static const void *device_namespace(struct kobject *kobj) in device_namespace() argument 901 struct device *dev = kobj_to_dev(kobj); in device_namespace() 910 static void device_get_ownership(struct kobject *kobj, kuid_t *uid, kgid_t *gid) in device_get_ownership() argument 912 struct device *dev = kobj_to_dev(kobj); in device_get_ownership() [all …]
|
D | class.c | 24 static ssize_t class_attr_show(struct kobject *kobj, struct attribute *attr, in class_attr_show() argument 28 struct subsys_private *cp = to_subsys_private(kobj); in class_attr_show() 36 static ssize_t class_attr_store(struct kobject *kobj, struct attribute *attr, in class_attr_store() argument 40 struct subsys_private *cp = to_subsys_private(kobj); in class_attr_store() 48 static void class_release(struct kobject *kobj) in class_release() argument 50 struct subsys_private *cp = to_subsys_private(kobj); in class_release() 64 static const struct kobj_ns_type_operations *class_child_ns_type(struct kobject *kobj) in class_child_ns_type() argument 66 struct subsys_private *cp = to_subsys_private(kobj); in class_child_ns_type() 93 error = sysfs_create_file_ns(&cls->p->subsys.kobj, in class_create_file_ns() 104 sysfs_remove_file_ns(&cls->p->subsys.kobj, &attr->attr, ns); in class_remove_file_ns() [all …]
|
/Linux-v4.19/drivers/firmware/efi/ |
D | runtime-map.c | 19 struct kobject kobj; /* kobject for each entry */ member 52 static inline struct efi_runtime_map_entry *to_map_entry(struct kobject *kobj) in to_map_entry() argument 54 return container_of(kobj, struct efi_runtime_map_entry, kobj); in to_map_entry() 57 static ssize_t map_attr_show(struct kobject *kobj, struct attribute *attr, in map_attr_show() argument 60 struct efi_runtime_map_entry *entry = to_map_entry(kobj); in map_attr_show() 88 static void map_release(struct kobject *kobj) in map_release() argument 92 entry = to_map_entry(kobj); in map_release() 105 add_sysfs_runtime_map_entry(struct kobject *kobj, int nr, in add_sysfs_runtime_map_entry() argument 112 map_kset = kset_create_and_add("runtime-map", NULL, kobj); in add_sysfs_runtime_map_entry() 126 kobject_init(&entry->kobj, &map_ktype); in add_sysfs_runtime_map_entry() [all …]
|
/Linux-v4.19/drivers/pci/ |
D | slot.c | 19 static ssize_t pci_slot_attr_show(struct kobject *kobj, in pci_slot_attr_show() argument 22 struct pci_slot *slot = to_pci_slot(kobj); in pci_slot_attr_show() 27 static ssize_t pci_slot_attr_store(struct kobject *kobj, in pci_slot_attr_store() argument 30 struct pci_slot *slot = to_pci_slot(kobj); in pci_slot_attr_store() 103 static void pci_slot_release(struct kobject *kobj) in pci_slot_release() argument 106 struct pci_slot *slot = to_pci_slot(kobj); in pci_slot_release() 192 result = kobject_rename(&slot->kobj, slot_name); in rename_slot() 216 kobject_get(&slot->kobj); in get_slot() 284 kobject_put(&slot->kobj); in pci_create_slot() 302 slot->kobj.kset = pci_slots_kset; in pci_create_slot() [all …]
|
/Linux-v4.19/fs/ |
D | char_dev.c | 289 kobject_set_name(&cdev->kobj, "%s", name); in __register_chrdev() 299 kobject_put(&cdev->kobj); in __register_chrdev() 354 struct kobject *kobj; in cdev_get() local 358 kobj = kobject_get(&p->kobj); in cdev_get() 359 if (!kobj) in cdev_get() 361 return kobj; in cdev_get() 368 kobject_put(&p->kobj); in cdev_put() 386 struct kobject *kobj; in chrdev_open() local 389 kobj = kobj_lookup(cdev_map, inode->i_rdev, &idx); in chrdev_open() 390 if (!kobj) in chrdev_open() [all …]
|
/Linux-v4.19/kernel/ |
D | ksysfs.c | 33 static ssize_t uevent_seqnum_show(struct kobject *kobj, in uevent_seqnum_show() argument 42 static ssize_t uevent_helper_show(struct kobject *kobj, in uevent_helper_show() argument 47 static ssize_t uevent_helper_store(struct kobject *kobj, in uevent_helper_store() argument 63 static ssize_t profiling_show(struct kobject *kobj, in profiling_show() argument 68 static ssize_t profiling_store(struct kobject *kobj, in profiling_store() argument 94 static ssize_t kexec_loaded_show(struct kobject *kobj, in kexec_loaded_show() argument 101 static ssize_t kexec_crash_loaded_show(struct kobject *kobj, in kexec_crash_loaded_show() argument 108 static ssize_t kexec_crash_size_show(struct kobject *kobj, in kexec_crash_size_show() argument 113 static ssize_t kexec_crash_size_store(struct kobject *kobj, in kexec_crash_size_store() argument 132 static ssize_t vmcoreinfo_show(struct kobject *kobj, in vmcoreinfo_show() argument [all …]
|