| /linux/lib/ |
| H A D | kobject.c | 30 const void *kobject_namespace(const struct kobject *kobj) in kobject_namespace() argument 32 const struct kobj_ns_type_operations *ns_ops = kobj_ns_ops(kobj); in kobject_namespace() 37 return kobj->ktype->namespace(kobj); in kobject_namespace() 50 void kobject_get_ownership(const struct kobject *kobj, kuid_t *uid, kgid_t *gid) in kobject_get_ownership() argument 55 if (kobj->ktype->get_ownership) in kobject_get_ownership() 56 kobj->ktype->get_ownership(kobj, uid, gid); in kobject_get_ownership() 67 static int create_dir(struct kobject *kobj) in create_dir() argument 69 const struct kobj_type *ktype = get_ktype(kobj); in create_dir() 73 error = sysfs_create_dir_ns(kobj, kobject_namespace(kobj)); in create_dir() 78 error = sysfs_create_groups(kobj, ktype->default_groups); in create_dir() [all …]
|
| /linux/mm/damon/ |
| H A D | sysfs-schemes.c | 18 struct kobject kobj; member 33 sysfs_region->kobj = (struct kobject){}; in damon_sysfs_scheme_region_alloc() 41 static ssize_t start_show(struct kobject *kobj, struct kobj_attribute *attr, in start_show() argument 44 struct damon_sysfs_scheme_region *region = container_of(kobj, in start_show() 45 struct damon_sysfs_scheme_region, kobj); in start_show() 50 static ssize_t end_show(struct kobject *kobj, struct kobj_attribute *attr, in end_show() argument 53 struct damon_sysfs_scheme_region *region = container_of(kobj, in end_show() 54 struct damon_sysfs_scheme_region, kobj); in end_show() 59 static ssize_t nr_accesses_show(struct kobject *kobj, in nr_accesses_show() argument 62 struct damon_sysfs_scheme_region *region = container_of(kobj, in nr_accesses_show() [all …]
|
| H A D | sysfs.c | 19 struct kobject kobj; member 28 static ssize_t start_show(struct kobject *kobj, struct kobj_attribute *attr, in start_show() argument 31 struct damon_sysfs_region *region = container_of(kobj, in start_show() 32 struct damon_sysfs_region, kobj); in start_show() 37 static ssize_t start_store(struct kobject *kobj, struct kobj_attribute *attr, in start_store() argument 40 struct damon_sysfs_region *region = container_of(kobj, in start_store() 41 struct damon_sysfs_region, kobj); in start_store() 47 static ssize_t end_show(struct kobject *kobj, struct kobj_attribute *attr, in end_show() argument 50 struct damon_sysfs_region *region = container_of(kobj, in end_show() 51 struct damon_sysfs_region, kobj); in end_show() 56 end_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) end_store() argument 66 damon_sysfs_region_release(struct kobject * kobj) damon_sysfs_region_release() argument 95 struct kobject kobj; global() member 155 nr_regions_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) nr_regions_show() argument 164 nr_regions_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) nr_regions_store() argument 187 damon_sysfs_regions_release(struct kobject * kobj) damon_sysfs_regions_release() argument 212 struct kobject kobj; global() member 246 pid_target_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) pid_target_show() argument 255 pid_target_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) pid_target_store() argument 267 obsolete_target_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) obsolete_target_show() argument 276 obsolete_target_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) obsolete_target_store() argument 290 damon_sysfs_target_release(struct kobject * kobj) damon_sysfs_target_release() argument 319 struct kobject kobj; global() member 387 nr_targets_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) nr_targets_show() argument 396 nr_targets_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) nr_targets_store() argument 419 damon_sysfs_targets_release(struct kobject * kobj) damon_sysfs_targets_release() argument 444 struct kobject kobj; global() member 468 access_bp_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) access_bp_show() argument 477 access_bp_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) access_bp_store() argument 492 aggrs_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) aggrs_show() argument 501 aggrs_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) aggrs_store() argument 516 min_sample_us_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) min_sample_us_show() argument 525 min_sample_us_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) min_sample_us_store() argument 540 max_sample_us_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) max_sample_us_show() argument 549 max_sample_us_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) max_sample_us_store() argument 564 damon_sysfs_intervals_goal_release(struct kobject * kobj) damon_sysfs_intervals_goal_release() argument 601 struct kobject kobj; global() member 650 sample_us_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) sample_us_show() argument 659 sample_us_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) sample_us_store() argument 674 aggr_us_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) aggr_us_show() argument 683 aggr_us_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) aggr_us_store() argument 698 update_us_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) update_us_show() argument 707 update_us_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) update_us_store() argument 722 damon_sysfs_intervals_release(struct kobject * kobj) damon_sysfs_intervals_release() argument 755 struct kobject kobj; global() member 822 damon_sysfs_attrs_release(struct kobject * kobj) damon_sysfs_attrs_release() argument 863 struct kobject kobj; global() member 977 avail_operations_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) avail_operations_show() argument 994 operations_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) operations_show() argument 1011 operations_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) operations_store() argument 1030 addr_unit_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) addr_unit_show() argument 1039 addr_unit_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) addr_unit_store() argument 1056 damon_sysfs_context_release(struct kobject * kobj) damon_sysfs_context_release() argument 1089 struct kobject kobj; global() member 1157 nr_contexts_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) nr_contexts_show() argument 1166 nr_contexts_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) nr_contexts_store() argument 1190 damon_sysfs_contexts_release(struct kobject * kobj) damon_sysfs_contexts_release() argument 1215 struct kobject kobj; global() member 1318 state_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) state_show() argument 1784 state_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) state_store() argument 1806 pid_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) pid_show() argument 1828 refresh_ms_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) refresh_ms_show() argument 1837 refresh_ms_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) refresh_ms_store() argument 1852 damon_sysfs_kdamond_release(struct kobject * kobj) damon_sysfs_kdamond_release() argument 1890 struct kobject kobj; global() member 1974 nr_kdamonds_show(struct kobject * kobj,struct kobj_attribute * attr,char * buf) nr_kdamonds_show() argument 1983 nr_kdamonds_store(struct kobject * kobj,struct kobj_attribute * attr,const char * buf,size_t count) nr_kdamonds_store() argument 2007 damon_sysfs_kdamonds_release(struct kobject * kobj) damon_sysfs_kdamonds_release() argument 2032 struct kobject kobj; global() member 2061 damon_sysfs_ui_dir_release(struct kobject * kobj) damon_sysfs_ui_dir_release() argument [all...] |
| H A D | sysfs-common.c | 26 range->kobj = (struct kobject){}; in damon_sysfs_ul_range_alloc() 33 static ssize_t min_show(struct kobject *kobj, struct kobj_attribute *attr, in min_show() argument 36 struct damon_sysfs_ul_range *range = container_of(kobj, in min_show() 37 struct damon_sysfs_ul_range, kobj); in min_show() 42 static ssize_t min_store(struct kobject *kobj, struct kobj_attribute *attr, in min_store() argument 45 struct damon_sysfs_ul_range *range = container_of(kobj, in min_store() 46 struct damon_sysfs_ul_range, kobj); in min_store() 58 static ssize_t max_show(struct kobject *kobj, struct kobj_attribute *attr, in max_show() argument 61 struct damon_sysfs_ul_range *range = container_of(kobj, in max_show() 62 struct damon_sysfs_ul_range, kobj); in max_show() [all …]
|
| /linux/include/linux/ |
| H A D | sysfs.h | 138 * static umode_t example_attr_visible(struct kobject *kobj, 148 * static bool example_group_visible(struct kobject *kobj) 170 struct kobject *kobj, struct attribute *attr, int n) \ 172 if (n == 0 && !name##_group_visible(kobj)) \ 174 return name##_attr_visible(kobj, attr, n); \ 185 * static bool example_group_visible(struct kobject *kobj) 202 struct kobject *kobj, struct attribute *a, int n) \ 204 if (n == 0 && !name##_group_visible(kobj)) \ 217 struct kobject *kobj, const struct bin_attribute *attr, int n) \ 219 if (n == 0 && !name##_group_visible(kobj)) \ 505 sysfs_create_dir_ns(struct kobject * kobj,const void * ns) sysfs_create_dir_ns() argument 510 sysfs_remove_dir(struct kobject * kobj) sysfs_remove_dir() argument 514 sysfs_rename_dir_ns(struct kobject * kobj,const char * new_name,const void * new_ns) sysfs_rename_dir_ns() argument 520 sysfs_move_dir_ns(struct kobject * kobj,struct kobject * new_parent_kobj,const void * new_ns) sysfs_move_dir_ns() argument 538 sysfs_create_file_ns(struct kobject * kobj,const struct attribute * attr,const void * ns) sysfs_create_file_ns() argument 545 sysfs_create_files(struct kobject * kobj,const struct attribute * const * attr) sysfs_create_files() argument 551 sysfs_chmod_file(struct kobject * kobj,const struct attribute * attr,umode_t mode) sysfs_chmod_file() argument 558 sysfs_break_active_protection(struct kobject * kobj,const struct attribute * attr) sysfs_break_active_protection() argument 568 sysfs_remove_file_ns(struct kobject * kobj,const struct attribute * attr,const void * ns) sysfs_remove_file_ns() argument 574 sysfs_remove_file_self(struct kobject * kobj,const struct attribute * attr) sysfs_remove_file_self() argument 580 sysfs_remove_files(struct kobject * kobj,const struct attribute * const * attr) sysfs_remove_files() argument 585 sysfs_create_bin_file(struct kobject * kobj,const struct bin_attribute * attr) sysfs_create_bin_file() argument 591 sysfs_remove_bin_file(struct kobject * kobj,const struct bin_attribute * attr) sysfs_remove_bin_file() argument 596 sysfs_create_link(struct kobject * kobj,struct kobject * target,const char * name) sysfs_create_link() argument 602 sysfs_create_link_nowarn(struct kobject * kobj,struct kobject * target,const char * name) sysfs_create_link_nowarn() argument 609 sysfs_remove_link(struct kobject * kobj,const char * name) sysfs_remove_link() argument 625 sysfs_create_group(struct kobject * kobj,const struct attribute_group * grp) sysfs_create_group() argument 631 sysfs_create_groups(struct kobject * kobj,const struct attribute_group ** groups) sysfs_create_groups() argument 637 sysfs_update_groups(struct kobject * kobj,const struct attribute_group ** groups) sysfs_update_groups() argument 643 sysfs_update_group(struct kobject * kobj,const struct attribute_group * grp) sysfs_update_group() argument 649 sysfs_remove_group(struct kobject * kobj,const struct attribute_group * grp) sysfs_remove_group() argument 654 sysfs_remove_groups(struct kobject * kobj,const struct attribute_group ** groups) sysfs_remove_groups() argument 659 sysfs_add_file_to_group(struct kobject * kobj,const struct attribute * attr,const char * group) sysfs_add_file_to_group() argument 665 sysfs_remove_file_from_group(struct kobject * kobj,const struct attribute * attr,const char * group) sysfs_remove_file_from_group() argument 670 sysfs_merge_group(struct kobject * kobj,const struct attribute_group * grp) sysfs_merge_group() argument 676 sysfs_unmerge_group(struct kobject * kobj,const struct attribute_group * grp) sysfs_unmerge_group() argument 681 sysfs_add_link_to_group(struct kobject * kobj,const char * group_name,struct kobject * target,const char * link_name) sysfs_add_link_to_group() argument 688 sysfs_remove_link_from_group(struct kobject * kobj,const char * group_name,const char * link_name) sysfs_remove_link_from_group() argument 693 compat_only_sysfs_link_entry_to_kobj(struct kobject * kobj,struct kobject * target_kobj,const char * target_name,const char * symlink_name) compat_only_sysfs_link_entry_to_kobj() argument 701 sysfs_notify(struct kobject * kobj,const char * dir,const char * attr) sysfs_notify() argument 715 sysfs_file_change_owner(struct kobject * kobj,const char * name,kuid_t kuid,kgid_t kgid) sysfs_file_change_owner() argument 722 sysfs_link_change_owner(struct kobject * kobj,struct kobject * targ,const char * name,kuid_t kuid,kgid_t kgid) sysfs_link_change_owner() argument 730 sysfs_change_owner(struct kobject * kobj,kuid_t kuid,kgid_t kgid) sysfs_change_owner() argument 735 sysfs_groups_change_owner(struct kobject * kobj,const struct attribute_group ** groups,kuid_t kuid,kgid_t kgid) sysfs_groups_change_owner() argument 742 sysfs_group_change_owner(struct kobject * kobj,const struct attribute_group * groups,kuid_t kuid,kgid_t kgid) sysfs_group_change_owner() argument 762 sysfs_bin_attr_simple_read(struct file * file,struct kobject * kobj,const struct bin_attribute * attr,char * buf,loff_t off,size_t count) sysfs_bin_attr_simple_read() argument 771 sysfs_create_file(struct kobject * kobj,const struct attribute * attr) sysfs_create_file() argument 777 sysfs_remove_file(struct kobject * kobj,const struct attribute * attr) sysfs_remove_file() argument 783 sysfs_rename_link(struct kobject * kobj,struct kobject * target,const char * old_name,const char * new_name) sysfs_rename_link() argument [all...] |
| H A D | kobject.h | 84 __printf(2, 3) int kobject_set_name(struct kobject *kobj, const char *name, ...); 85 __printf(2, 0) int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list vargs); 87 static inline const char *kobject_name(const struct kobject *kobj) in kobject_name() argument 89 return kobj->name; in kobject_name() 92 void kobject_init(struct kobject *kobj, const struct kobj_type *ktype); 93 __printf(3, 4) __must_check int kobject_add(struct kobject *kobj, 96 __printf(4, 5) __must_check int kobject_init_and_add(struct kobject *kobj, 101 void kobject_del(struct kobject *kobj); 108 struct kobject *kobject_get(struct kobject *kobj); 109 struct kobject * __must_check kobject_get_unless_zero(struct kobject *kobj); [all …]
|
| /linux/drivers/gpu/drm/xe/ |
| H A D | xe_hw_engine_class_sysfs.c | 35 static void xe_hw_engine_sysfs_kobj_release(struct kobject *kobj) in xe_hw_engine_sysfs_kobj_release() argument 37 kfree(kobj); in xe_hw_engine_sysfs_kobj_release() 40 static ssize_t xe_hw_engine_class_sysfs_attr_show(struct kobject *kobj, in xe_hw_engine_class_sysfs_attr_show() argument 44 struct xe_device *xe = kobj_to_xe(kobj); in xe_hw_engine_class_sysfs_attr_show() 50 return kattr->show(kobj, kattr, buf); in xe_hw_engine_class_sysfs_attr_show() 56 static ssize_t xe_hw_engine_class_sysfs_attr_store(struct kobject *kobj, in xe_hw_engine_class_sysfs_attr_store() argument 61 struct xe_device *xe = kobj_to_xe(kobj); in xe_hw_engine_class_sysfs_attr_store() 67 return kattr->store(kobj, kattr, buf, count); in xe_hw_engine_class_sysfs_attr_store() 88 static ssize_t job_timeout_max_store(struct kobject *kobj, in job_timeout_max_store() argument 92 struct xe_hw_engine_class_intf *eclass = kobj_to_eclass(kobj); in job_timeout_max_store() [all …]
|
| H A D | xe_gt_freq.c | 57 return &kobj_to_gt(dev->kobj.parent)->uc.guc.pc; in dev_to_pc() 63 return gt_to_xe(kobj_to_gt(dev->kobj.parent)); in dev_to_xe() 66 static ssize_t act_freq_show(struct kobject *kobj, in act_freq_show() argument 69 struct device *dev = kobj_to_dev(kobj); in act_freq_show() 80 static ssize_t cur_freq_show(struct kobject *kobj, in cur_freq_show() argument 83 struct device *dev = kobj_to_dev(kobj); in cur_freq_show() 97 static ssize_t rp0_freq_show(struct kobject *kobj, in rp0_freq_show() argument 100 struct device *dev = kobj_to_dev(kobj); in rp0_freq_show() 107 static ssize_t rpe_freq_show(struct kobject *kobj, in rpe_freq_show() argument 110 struct device *dev = kobj_to_dev(kobj); in rpe_freq_show() [all …]
|
| /linux/fs/sysfs/ |
| H A D | group.c | 34 static umode_t __first_visible(const struct attribute_group *grp, struct kobject *kobj) in __first_visible() argument 37 return grp->is_visible(kobj, grp->attrs[0], 0); in __first_visible() 40 return grp->is_visible_const(kobj, grp->attrs[0], 0); in __first_visible() 43 return grp->is_bin_visible(kobj, grp->bin_attrs[0], 0); in __first_visible() 48 static int create_files(struct kernfs_node *parent, struct kobject *kobj, in create_files() argument 69 mode = grp->is_visible(kobj, *attr, i); in create_files() 71 mode = grp->is_visible_const(kobj, *attr, i); in create_files() 102 mode = grp->is_bin_visible(kobj, *bin_attr, i); in create_files() 108 size = grp->bin_size(kobj, *bin_attr, i); in create_files() 129 static int internal_create_group(struct kobject *kobj, int update, in internal_create_group() argument [all …]
|
| H A D | symlink.c | 67 static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, in sysfs_do_create_link() argument 72 if (!kobj) in sysfs_do_create_link() 75 parent = kobj->sd; in sysfs_do_create_link() 89 int sysfs_create_link(struct kobject *kobj, struct kobject *target, in sysfs_create_link() argument 92 return sysfs_do_create_link(kobj, target, name, 1); in sysfs_create_link() 105 int sysfs_create_link_nowarn(struct kobject *kobj, struct kobject *target, in sysfs_create_link_nowarn() argument 108 return sysfs_do_create_link(kobj, target, name, 0); in sysfs_create_link_nowarn() 121 void sysfs_delete_link(struct kobject *kobj, struct kobject *targ, in sysfs_delete_link() argument 132 if (targ->sd && kernfs_ns_enabled(kobj->sd)) in sysfs_delete_link() 135 kernfs_remove_by_name_ns(kobj->sd, name, ns); in sysfs_delete_link() [all …]
|
| /linux/fs/nfs/ |
| H A D | sysfs.c | 24 static void nfs_kset_release(struct kobject *kobj) in nfs_kset_release() argument 26 struct kset *kset = container_of(kobj, struct kset, kobj); in nfs_kset_release() 31 const struct kobject *kobj) in nfs_netns_object_child_ns_type() argument 50 ret = kobject_set_name(&nfs_kset->kobj, "nfs"); in nfs_sysfs_init() 56 nfs_kset->kobj.parent = fs_kobj; in nfs_sysfs_init() 57 nfs_kset->kobj.ktype = &nfs_kset_type; in nfs_sysfs_init() 58 nfs_kset->kobj.kset = NULL; in nfs_sysfs_init() 74 static ssize_t nfs_netns_identifier_show(struct kobject *kobj, in nfs_netns_identifier_show() argument 77 struct nfs_netns_client *c = container_of(kobj, in nfs_netns_identifier_show() 96 static ssize_t nfs_netns_identifier_store(struct kobject *kobj, in nfs_netns_identifier_store() argument [all …]
|
| /linux/drivers/gpu/drm/i915/gt/ |
| H A D | sysfs_engines.c | 20 static struct intel_engine_cs *kobj_to_engine(struct kobject *kobj) in kobj_to_engine() argument 22 return container_of(kobj, struct kobj_engine, base)->engine; in kobj_to_engine() 26 name_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in name_show() argument 28 return sysfs_emit(buf, "%s\n", kobj_to_engine(kobj)->name); in name_show() 35 class_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in class_show() argument 37 return sysfs_emit(buf, "%d\n", kobj_to_engine(kobj)->uabi_class); in class_show() 44 inst_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in inst_show() argument 46 return sysfs_emit(buf, "%d\n", kobj_to_engine(kobj)->uabi_instance); in inst_show() 53 mmio_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in mmio_show() argument 55 return sysfs_emit(buf, "0x%x\n", kobj_to_engine(kobj)->mmio_base); in mmio_show() [all …]
|
| /linux/drivers/edac/ |
| H A 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() 202 static void edac_device_ctrl_master_release(struct kobject *kobj) in edac_device_ctrl_master_release() argument 204 struct edac_device_ctl_info *edac_dev = to_edacdev(kobj); in edac_device_ctrl_master_release() 244 memset(&edac_dev->kobj, 0, sizeof(struct kobject)); in edac_device_register_sysfs_main_kobj() 257 err = kobject_init_and_add(&edac_dev->kobj, &ktype_device_ctrl, in edac_device_register_sysfs_main_kobj() [all …]
|
| /linux/drivers/cpuidle/ |
| H A D | sysfs.c | 131 retval = sysfs_create_group(&dev_root->kobj, &cpuidle_attr_group); in cpuidle_add_interface() 142 sysfs_remove_group(&dev->kobj, &cpuidle_attr_group); in cpuidle_remove_interface() 156 struct kobject kobj; member 159 static inline struct cpuidle_device *to_cpuidle_device(struct kobject *kobj) in to_cpuidle_device() argument 162 container_of(kobj, struct cpuidle_device_kobj, kobj); in to_cpuidle_device() 167 static ssize_t cpuidle_show(struct kobject *kobj, struct attribute *attr, in cpuidle_show() argument 171 struct cpuidle_device *dev = to_cpuidle_device(kobj); in cpuidle_show() 182 static ssize_t cpuidle_store(struct kobject *kobj, struct attribute *attr, in cpuidle_store() argument 186 struct cpuidle_device *dev = to_cpuidle_device(kobj); in cpuidle_store() 202 static void cpuidle_sysfs_release(struct kobject *kobj) in cpuidle_sysfs_release() argument [all …]
|
| /linux/drivers/block/rnbd/ |
| H A D | rnbd-srv-sysfs.c | 27 static void rnbd_srv_dev_release(struct kobject *kobj) in rnbd_srv_dev_release() argument 31 dev = container_of(kobj, struct rnbd_srv_dev, dev_kobj); in rnbd_srv_dev_release() 61 bdev_kobj = &disk_to_dev(bdev->bd_disk)->kobj; in rnbd_srv_create_dev_sysfs() 85 static ssize_t read_only_show(struct kobject *kobj, struct kobj_attribute *attr, in read_only_show() argument 90 sess_dev = container_of(kobj, struct rnbd_srv_sess_dev, kobj); in read_only_show() 98 static ssize_t access_mode_show(struct kobject *kobj, in access_mode_show() argument 104 sess_dev = container_of(kobj, struct rnbd_srv_sess_dev, kobj); in access_mode_show() 113 static ssize_t mapping_path_show(struct kobject *kobj, in mapping_path_show() argument 118 sess_dev = container_of(kobj, struct rnbd_srv_sess_dev, kobj); in mapping_path_show() 126 static ssize_t rnbd_srv_dev_session_force_close_show(struct kobject *kobj, in rnbd_srv_dev_session_force_close_show() argument [all …]
|
| /linux/fs/btrfs/ |
| H A D | sysfs.c | 58 struct kobject kobj; member 101 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj); 102 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj); 103 static struct kobject *get_btrfs_kobj(struct kobject *kobj); 175 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() argument 179 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show() 191 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() argument 201 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store() 259 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() argument 262 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_visible() [all …]
|
| /linux/arch/powerpc/kernel/ |
| H A D | secvar-sysfs.c | 22 static ssize_t format_show(struct kobject *kobj, struct kobj_attribute *attr, in format_show() argument 39 static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr, in size_show() argument 45 rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize); in size_show() 48 pr_err("Error retrieving %s variable size %d\n", kobj->name, rc); in size_show() 55 static ssize_t data_read(struct file *filep, struct kobject *kobj, in data_read() argument 63 rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize); in data_read() 66 pr_err("Error getting %s variable size %d\n", kobj->name, rc); in data_read() 75 rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, data, &dsize); in data_read() 77 pr_err("Error getting %s variable %d\n", kobj->name, rc); in data_read() 88 static ssize_t update_write(struct file *filep, struct kobject *kobj, in update_write() argument [all …]
|
| /linux/net/sunrpc/ |
| H A D | sysfs.c | 28 static void rpc_sysfs_object_release(struct kobject *kobj) in rpc_sysfs_object_release() argument 30 kfree(kobj); in rpc_sysfs_object_release() 34 rpc_sysfs_object_child_ns_type(const struct kobject *kobj) in rpc_sysfs_object_child_ns_type() argument 49 struct kobject *kobj; in rpc_sysfs_object_alloc() local 51 kobj = kzalloc_obj(*kobj); in rpc_sysfs_object_alloc() 52 if (kobj) { in rpc_sysfs_object_alloc() 53 kobj->kset = kset; in rpc_sysfs_object_alloc() 54 if (kobject_init_and_add(kobj, &rpc_sysfs_object_type, in rpc_sysfs_object_alloc() 56 return kobj; in rpc_sysfs_object_alloc() 57 kobject_put(kobj); in rpc_sysfs_object_alloc() [all …]
|
| /linux/mm/ |
| H A D | hugetlb_sysfs.c | 26 static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp); 28 static struct hstate *kobj_to_hstate(struct kobject *kobj, int *nidp) in kobj_to_hstate() argument 33 if (hstate_kobjs[i] == kobj) { in kobj_to_hstate() 39 return kobj_to_node_hstate(kobj, nidp); in kobj_to_hstate() 42 static ssize_t nr_hugepages_show_common(struct kobject *kobj, in nr_hugepages_show_common() argument 49 h = kobj_to_hstate(kobj, &nid); in nr_hugepages_show_common() 59 struct kobject *kobj, const char *buf, in nr_hugepages_store_common() argument 71 h = kobj_to_hstate(kobj, &nid); in nr_hugepages_store_common() 75 static ssize_t nr_hugepages_show(struct kobject *kobj, in nr_hugepages_show() argument 78 return nr_hugepages_show_common(kobj, attr, buf); in nr_hugepages_show() [all …]
|
| H A D | cma_sysfs.c | 32 static inline struct cma *cma_from_kobj(struct kobject *kobj) in cma_from_kobj() argument 34 return container_of(kobj, struct cma_kobject, kobj)->cma; in cma_from_kobj() 37 static ssize_t alloc_pages_success_show(struct kobject *kobj, in alloc_pages_success_show() argument 40 struct cma *cma = cma_from_kobj(kobj); in alloc_pages_success_show() 47 static ssize_t alloc_pages_fail_show(struct kobject *kobj, in alloc_pages_fail_show() argument 50 struct cma *cma = cma_from_kobj(kobj); in alloc_pages_fail_show() 56 static ssize_t release_pages_success_show(struct kobject *kobj, in release_pages_success_show() argument 59 struct cma *cma = cma_from_kobj(kobj); in release_pages_success_show() 65 static ssize_t total_pages_show(struct kobject *kobj, in total_pages_show() argument 68 struct cma *cma = cma_from_kobj(kobj); in total_pages_show() [all …]
|
| /linux/arch/powerpc/platforms/pseries/ |
| H A D | vas-sysfs.c | 22 struct kobject kobj; member 26 #define to_caps_entry(entry) container_of(entry, struct vas_caps_entry, kobj) 121 static ssize_t vas_type_show(struct kobject *kobj, struct attribute *attr, in vas_type_show() argument 128 centry = to_caps_entry(kobj); in vas_type_show() 138 static ssize_t vas_type_store(struct kobject *kobj, struct attribute *attr, in vas_type_store() argument 145 centry = to_caps_entry(kobj); in vas_type_store() 154 static void vas_type_release(struct kobject *kobj) in vas_type_release() argument 156 struct vas_caps_entry *centry = to_caps_entry(kobj); in vas_type_release() 178 struct kobject **kobj) in vas_caps_kobj_name() argument 183 kobject_init(¢ry->kobj, &vas_qos_attr_type); in vas_caps_kobj_name() [all …]
|
| /linux/arch/powerpc/platforms/powernv/ |
| H A D | opal-elog.c | 21 struct kobject kobj; member 28 #define to_elog_obj(x) container_of(x, struct elog_obj, kobj) 79 if (sysfs_remove_file_self(&elog_obj->kobj, &attr->attr)) { in elog_ack_store() 81 kobject_put(&elog_obj->kobj); in elog_ack_store() 95 static ssize_t elog_attr_show(struct kobject *kobj, in elog_attr_show() argument 103 elog = to_elog_obj(kobj); in elog_attr_show() 111 static ssize_t elog_attr_store(struct kobject *kobj, in elog_attr_store() argument 119 elog = to_elog_obj(kobj); in elog_attr_store() 132 static void elog_release(struct kobject *kobj) in elog_release() argument 136 elog = to_elog_obj(kobj); in elog_release() [all …]
|
| /linux/Documentation/translations/zh_CN/core-api/ |
| H A D | kobject.rst | 67 struct kobject kobj; 71 如果你有一个uio_map结构体,找到其嵌入的kobject只是一个使用kobj成员的问题。 89 struct uio_map *u_map = container_of(kp, struct uio_map, kobj); 95 struct kobject kobj; 99 #define to_map(map) container_of(map, struct uio_map, kobj) 103 struct uio_map *map = to_map(kobj); 112 void kobject_init(struct kobject *kobj, struct kobj_type *ktype); 117 int kobject_add(struct kobject *kobj, struct kobject *parent, 121 联,在调用kobject_add()之前必须分配kobj->kset。如果kset与kobject相关联,则 128 int kobject_rename(struct kobject *kobj, const char *new_name); [all …]
|
| /linux/drivers/w1/slaves/ |
| H A D | w1_ds2408.c | 67 static ssize_t state_read(struct file *filp, struct kobject *kobj, in state_read() argument 71 dev_dbg(&kobj_to_w1_slave(kobj)->dev, in state_read() 73 bin_attr->attr.name, kobj, (unsigned int)off, count, buf); in state_read() 76 return _read_reg(kobj_to_w1_slave(kobj), W1_F29_REG_LOGIG_STATE, buf); in state_read() 79 static ssize_t output_read(struct file *filp, struct kobject *kobj, in output_read() argument 83 dev_dbg(&kobj_to_w1_slave(kobj)->dev, in output_read() 85 bin_attr->attr.name, kobj, (unsigned int)off, count, buf); in output_read() 88 return _read_reg(kobj_to_w1_slave(kobj), in output_read() 92 static ssize_t activity_read(struct file *filp, struct kobject *kobj, in activity_read() argument 96 dev_dbg(&kobj_to_w1_slave(kobj)->dev, in activity_read() [all …]
|
| /linux/drivers/platform/x86/lenovo/ |
| H A D | think-lmi.c | 237 static inline struct tlmi_pwd_setting *to_tlmi_pwd_setting(struct kobject *kobj) in to_tlmi_pwd_setting() argument 239 return container_of(kobj, struct tlmi_pwd_setting, kobj); in to_tlmi_pwd_setting() 242 static inline struct tlmi_attr_setting *to_tlmi_attr_setting(struct kobject *kobj) in to_tlmi_attr_setting() argument 244 return container_of(kobj, struct tlmi_attr_setting, kobj); in to_tlmi_attr_setting() 424 static ssize_t is_enabled_show(struct kobject *kobj, struct kobj_attribute *attr, in is_enabled_show() argument 427 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in is_enabled_show() 434 static ssize_t current_password_store(struct kobject *kobj, in current_password_store() argument 438 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in current_password_store() 454 static ssize_t new_password_store(struct kobject *kobj, in new_password_store() argument 458 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in new_password_store() [all …]
|