Home
last modified time | relevance | path

Searched refs:kobj (Results 1 – 25 of 842) sorted by relevance

12345678910>>...34

/Linux-v5.4/lib/
Dkobject.c28 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 …]
Dkobject_uevent.c192 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()
244 ns = kobj->ktype->namespace(kobj); in kobj_usermode_filter()
380 static int kobject_uevent_net_broadcast(struct kobject *kobj, in kobject_uevent_net_broadcast() argument
391 ops = kobj_ns_ops(kobj); in kobject_uevent_net_broadcast()
392 if (!ops && kobj->kset) { in kobject_uevent_net_broadcast()
[all …]
/Linux-v5.4/include/linux/
Dkobject.h84 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 …]
Dsysfs.h230 int __must_check sysfs_create_dir_ns(struct kobject *kobj, const void *ns);
231 void sysfs_remove_dir(struct kobject *kobj);
232 int __must_check sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name,
234 int __must_check sysfs_move_dir_ns(struct kobject *kobj,
242 int __must_check sysfs_create_file_ns(struct kobject *kobj,
245 int __must_check sysfs_create_files(struct kobject *kobj,
247 int __must_check sysfs_chmod_file(struct kobject *kobj,
249 struct kernfs_node *sysfs_break_active_protection(struct kobject *kobj,
252 void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr,
254 bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr);
[all …]
/Linux-v5.4/fs/sysfs/
Dgroup.c33 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 if (WARN_ON(!kobj || (!update && !kobj->sd))) in internal_create_group()
119 if (unlikely(update && !kobj->sd)) in internal_create_group()
123 kobj->name, grp->name ?: ""); in internal_create_group()
126 kobject_get_ownership(kobj, &uid, &gid); in internal_create_group()
129 kn = kernfs_find_and_get(kobj->sd, grp->name); in internal_create_group()
132 kobj->name, grp->name); in internal_create_group()
[all …]
Dfile.c27 struct kobject *kobj = kn->parent->priv; in sysfs_file_ops() local
31 return kobj->ktype ? kobj->ktype->sysfs_ops : NULL; in sysfs_file_ops()
42 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_seq_show() local
60 count = ops->show(kobj, of->kn->priv, buf); in sysfs_kf_seq_show()
83 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_read() local
99 return battr->read(of->file, kobj, battr, buf, pos, count); in sysfs_kf_bin_read()
107 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_read() local
116 len = ops->show(kobj, of->kn->priv, buf); in sysfs_kf_read()
133 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_write() local
138 return ops->store(kobj, of->kn->priv, buf, count); in sysfs_kf_write()
[all …]
Ddir.c40 int sysfs_create_dir_ns(struct kobject *kobj, const void *ns) in sysfs_create_dir_ns() argument
46 if (WARN_ON(!kobj)) in sysfs_create_dir_ns()
49 if (kobj->parent) in sysfs_create_dir_ns()
50 parent = kobj->parent->sd; in sysfs_create_dir_ns()
57 kobject_get_ownership(kobj, &uid, &gid); in sysfs_create_dir_ns()
59 kn = kernfs_create_dir_ns(parent, kobject_name(kobj), in sysfs_create_dir_ns()
61 kobj, ns); in sysfs_create_dir_ns()
64 sysfs_warn_dup(parent, kobject_name(kobj)); in sysfs_create_dir_ns()
68 kobj->sd = kn; in sysfs_create_dir_ns()
80 void sysfs_remove_dir(struct kobject *kobj) in sysfs_remove_dir() argument
[all …]
Dsymlink.c67 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-v5.4/drivers/cpuidle/
Dsysfs.c151 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-v5.4/drivers/vfio/mdev/
Dmdev_sysfs.c21 static ssize_t mdev_type_attr_show(struct kobject *kobj, in mdev_type_attr_show() argument
25 struct mdev_type *type = to_mdev_type(kobj); in mdev_type_attr_show()
29 ret = attr->show(kobj, type->parent->dev, buf); in mdev_type_attr_show()
33 static ssize_t mdev_type_attr_store(struct kobject *kobj, in mdev_type_attr_store() argument
38 struct mdev_type *type = to_mdev_type(kobj); in mdev_type_attr_store()
42 ret = attr->store(&type->kobj, type->parent->dev, buf, count); in mdev_type_attr_store()
51 static ssize_t create_store(struct kobject *kobj, struct device *dev, in create_store() argument
70 ret = mdev_device_create(kobj, dev, &uuid); in create_store()
79 static void mdev_type_release(struct kobject *kobj) in mdev_type_release() argument
81 struct mdev_type *type = to_mdev_type(kobj); in mdev_type_release()
[all …]
/Linux-v5.4/drivers/edac/
Dedac_device_sysfs.c23 #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-v5.4/block/
Dblk-mq-sysfs.c18 static void blk_mq_sysfs_release(struct kobject *kobj) in blk_mq_sysfs_release() argument
20 struct blk_mq_ctxs *ctxs = container_of(kobj, struct blk_mq_ctxs, kobj); in blk_mq_sysfs_release()
26 static void blk_mq_ctx_sysfs_release(struct kobject *kobj) in blk_mq_ctx_sysfs_release() argument
28 struct blk_mq_ctx *ctx = container_of(kobj, struct blk_mq_ctx, kobj); in blk_mq_ctx_sysfs_release()
31 kobject_put(&ctx->ctxs->kobj); in blk_mq_ctx_sysfs_release()
34 static void blk_mq_hw_sysfs_release(struct kobject *kobj) in blk_mq_hw_sysfs_release() argument
36 struct blk_mq_hw_ctx *hctx = container_of(kobj, struct blk_mq_hw_ctx, in blk_mq_hw_sysfs_release()
37 kobj); in blk_mq_hw_sysfs_release()
62 static ssize_t blk_mq_sysfs_show(struct kobject *kobj, struct attribute *attr, in blk_mq_sysfs_show() argument
71 ctx = container_of(kobj, struct blk_mq_ctx, kobj); in blk_mq_sysfs_show()
[all …]
/Linux-v5.4/fs/nfs/
Dsysfs.c23 static void nfs_netns_object_release(struct kobject *kobj) in nfs_netns_object_release() argument
25 kfree(kobj); in nfs_netns_object_release()
29 struct kobject *kobj) in nfs_netns_object_child_ns_type() argument
43 struct kobject *kobj; in nfs_netns_object_alloc() local
45 kobj = kzalloc(sizeof(*kobj), GFP_KERNEL); in nfs_netns_object_alloc()
46 if (kobj) { in nfs_netns_object_alloc()
47 kobj->kset = kset; in nfs_netns_object_alloc()
48 if (kobject_init_and_add(kobj, &nfs_netns_object_type, in nfs_netns_object_alloc()
50 return kobj; in nfs_netns_object_alloc()
51 kobject_put(kobj); in nfs_netns_object_alloc()
[all …]
/Linux-v5.4/fs/btrfs/
Dsysfs.c30 struct kobject kobj; member
69 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj);
70 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj);
143 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() argument
147 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show()
159 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() argument
169 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store()
227 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() argument
230 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_visible()
291 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show() argument
[all …]
/Linux-v5.4/net/batman-adv/
Dsysfs.c58 struct device *dev = container_of(obj->parent, struct device, kobj); in batadv_kobj_to_netdev()
104 if (vlan_tmp->kobj != obj) in batadv_kobj_to_vlan()
137 ssize_t batadv_store_##_name(struct kobject *kobj, \
141 struct net_device *net_dev = batadv_kobj_to_netdev(kobj); \
155 ssize_t batadv_show_##_name(struct kobject *kobj, \
158 struct batadv_priv *bat_priv = batadv_kobj_to_batpriv(kobj); \
176 ssize_t batadv_store_##_name(struct kobject *kobj, \
180 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-v5.4/drivers/of/
Dkobj.c10 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-v5.4/drivers/w1/slaves/
Dw1_ds2408.c67 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-v5.4/arch/powerpc/platforms/powernv/
Dopal-elog.c21 struct kobject kobj; member
28 #define to_elog_obj(x) container_of(x, struct elog_obj, kobj)
76 sysfs_remove_file_self(&elog_obj->kobj, &attr->attr); in elog_ack_store()
77 kobject_put(&elog_obj->kobj); in elog_ack_store()
90 static ssize_t elog_attr_show(struct kobject *kobj, in elog_attr_show() argument
98 elog = to_elog_obj(kobj); in elog_attr_show()
106 static ssize_t elog_attr_store(struct kobject *kobj, in elog_attr_store() argument
114 elog = to_elog_obj(kobj); in elog_attr_store()
127 static void elog_release(struct kobject *kobj) in elog_release() argument
131 elog = to_elog_obj(kobj); in elog_release()
[all …]
Dopal-dump.c21 struct kobject kobj; member
28 #define to_dump_obj(x) container_of(x, struct dump_obj, kobj)
92 sysfs_remove_file_self(&dump_obj->kobj, &attr->attr); in dump_ack_store()
93 kobject_put(&dump_obj->kobj); in dump_ack_store()
154 static ssize_t dump_attr_show(struct kobject *kobj, in dump_attr_show() argument
162 dump = to_dump_obj(kobj); in dump_attr_show()
170 static ssize_t dump_attr_store(struct kobject *kobj, in dump_attr_store() argument
178 dump = to_dump_obj(kobj); in dump_attr_store()
191 static void dump_release(struct kobject *kobj) in dump_release() argument
195 dump = to_dump_obj(kobj); in dump_release()
[all …]
/Linux-v5.4/fs/xfs/
Dxfs_sysfs.h24 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-v5.4/drivers/firmware/efi/
Druntime-map.c18 struct kobject kobj; /* kobject for each entry */ member
51 static inline struct efi_runtime_map_entry *to_map_entry(struct kobject *kobj) in to_map_entry() argument
53 return container_of(kobj, struct efi_runtime_map_entry, kobj); in to_map_entry()
56 static ssize_t map_attr_show(struct kobject *kobj, struct attribute *attr, in map_attr_show() argument
59 struct efi_runtime_map_entry *entry = to_map_entry(kobj); in map_attr_show()
87 static void map_release(struct kobject *kobj) in map_release() argument
91 entry = to_map_entry(kobj); in map_release()
104 add_sysfs_runtime_map_entry(struct kobject *kobj, int nr, in add_sysfs_runtime_map_entry() argument
111 map_kset = kset_create_and_add("runtime-map", NULL, kobj); in add_sysfs_runtime_map_entry()
125 kobject_init(&entry->kobj, &map_ktype); in add_sysfs_runtime_map_entry()
[all …]
/Linux-v5.4/drivers/base/
Dclass.c24 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 …]
Dcore.c960 static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr, in dev_attr_show() argument
964 struct device *dev = kobj_to_dev(kobj); in dev_attr_show()
976 static ssize_t dev_attr_store(struct kobject *kobj, struct attribute *attr, in dev_attr_store() argument
980 struct device *dev = kobj_to_dev(kobj); in dev_attr_store()
1080 static void device_release(struct kobject *kobj) in device_release() argument
1082 struct device *dev = kobj_to_dev(kobj); in device_release()
1108 static const void *device_namespace(struct kobject *kobj) in device_namespace() argument
1110 struct device *dev = kobj_to_dev(kobj); in device_namespace()
1119 static void device_get_ownership(struct kobject *kobj, kuid_t *uid, kgid_t *gid) in device_get_ownership() argument
1121 struct device *dev = kobj_to_dev(kobj); in device_get_ownership()
[all …]
/Linux-v5.4/drivers/pci/
Dslot.c18 static ssize_t pci_slot_attr_show(struct kobject *kobj, in pci_slot_attr_show() argument
21 struct pci_slot *slot = to_pci_slot(kobj); in pci_slot_attr_show()
26 static ssize_t pci_slot_attr_store(struct kobject *kobj, in pci_slot_attr_store() argument
29 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-v5.4/fs/
Dchar_dev.c286 kobject_set_name(&cdev->kobj, "%s", name); in __register_chrdev()
296 kobject_put(&cdev->kobj); in __register_chrdev()
351 struct kobject *kobj; in cdev_get() local
355 kobj = kobject_get(&p->kobj); in cdev_get()
356 if (!kobj) in cdev_get()
358 return kobj; in cdev_get()
365 kobject_put(&p->kobj); in cdev_put()
383 struct kobject *kobj; in chrdev_open() local
386 kobj = kobj_lookup(cdev_map, inode->i_rdev, &idx); in chrdev_open()
387 if (!kobj) in chrdev_open()
[all …]

12345678910>>...34