Searched refs:kset (Results 1 - 64 of 64) sorted by relevance

/linux-4.4.14/include/linux/
H A Dkobject.h67 struct kset *kset; member in struct:kobject
133 int (* const filter)(struct kset *kset, struct kobject *kobj);
134 const char *(* const name)(struct kset *kset, struct kobject *kobj);
135 int (* const uevent)(struct kset *kset, struct kobject *kobj,
152 * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
154 * A kset defines a group of kobjects. They can be individually
160 * @list: the list of all kobjects for this kset
162 * @kobj: the embedded kobject for this kset (recursion, isn't it fun...)
163 * @uevent_ops: the set of uevent operations for this kset. These are
164 * called whenever a kobject has something happen to it so that the kset
168 struct kset { struct
175 extern void kset_init(struct kset *kset);
176 extern int __must_check kset_register(struct kset *kset);
177 extern void kset_unregister(struct kset *kset);
178 extern struct kset * __must_check kset_create_and_add(const char *name,
182 static inline struct kset *to_kset(struct kobject *kobj) to_kset()
184 return kobj ? container_of(kobj, struct kset, kobj) : NULL; to_kset()
187 static inline struct kset *kset_get(struct kset *k) kset_get()
192 static inline void kset_put(struct kset *k) kset_put()
202 extern struct kobject *kset_find_obj(struct kset *, const char *);
H A Discsi_boot_sysfs.h106 struct kset *kset; member in struct:iscsi_boot_kset
H A Dslub_def.h91 struct kset *memcg_kset;
H A Defi.h1105 struct kset *kset; member in struct:efivars
H A Dmodule.h758 extern struct kset *module_kset;
H A Ddevice.h195 extern struct kset *bus_get_kset(struct bus_type *bus);
H A Dnetdevice.h1642 struct kset *queues_kset;
/linux-4.4.14/lib/
H A Dkobject.c139 * kobject_get_path - generate and return the path associated with a given kobj and kset pair.
163 /* add the kobject to its kset's list */ kobj_kset_join()
166 if (!kobj->kset) kobj_kset_join()
169 kset_get(kobj->kset); kobj_kset_join()
170 spin_lock(&kobj->kset->list_lock); kobj_kset_join()
171 list_add_tail(&kobj->entry, &kobj->kset->list); kobj_kset_join()
172 spin_unlock(&kobj->kset->list_lock); kobj_kset_join()
175 /* remove the kobject from its kset's list */ kobj_kset_leave()
178 if (!kobj->kset) kobj_kset_leave()
181 spin_lock(&kobj->kset->list_lock); kobj_kset_leave()
183 spin_unlock(&kobj->kset->list_lock); kobj_kset_leave()
184 kset_put(kobj->kset); kobj_kset_leave()
216 /* join kset if set, use it as parent if we do not already have one */ kobject_add_internal()
217 if (kobj->kset) { kobject_add_internal()
219 parent = kobject_get(&kobj->kset->kobj); kobject_add_internal()
227 kobj->kset ? kobject_name(&kobj->kset->kobj) : "<NULL>"); kobject_add_internal()
380 * kobject associated with the kset assigned to this kobject. If no kset
530 if (kobj->kset) kobject_move()
531 new_parent = kobject_get(&kobj->kset->kobj); kobject_move()
764 * kset_init - initialize a kset for use
765 * @k: kset
767 void kset_init(struct kset *k) kset_init()
806 * kset_register - initialize and add a kset.
807 * @k: kset.
809 int kset_register(struct kset *k) kset_register()
826 * kset_unregister - remove a kset.
827 * @k: kset.
829 void kset_unregister(struct kset *k) kset_unregister()
839 * kset_find_obj - search for object in kset.
840 * @kset: kset we're looking in.
843 * Lock kset via @kset->subsys, and iterate over @kset->list,
847 struct kobject *kset_find_obj(struct kset *kset, const char *name) kset_find_obj() argument
852 spin_lock(&kset->list_lock); kset_find_obj()
854 list_for_each_entry(k, &kset->list, entry) { kset_find_obj()
861 spin_unlock(&kset->list_lock); kset_find_obj()
867 struct kset *kset = container_of(kobj, struct kset, kobj); kset_release() local
870 kfree(kset); kset_release()
879 * kset_create - create a struct kset dynamically
881 * @name: the name for the kset
882 * @uevent_ops: a struct kset_uevent_ops for the kset
883 * @parent_kobj: the parent kobject of this kset, if any.
885 * This function creates a kset structure dynamically. This structure can
891 * If the kset was not able to be created, NULL will be returned.
893 static struct kset *kset_create(const char *name, kset_create()
897 struct kset *kset; kset_create() local
900 kset = kzalloc(sizeof(*kset), GFP_KERNEL); kset_create()
901 if (!kset) kset_create()
903 retval = kobject_set_name(&kset->kobj, "%s", name); kset_create()
905 kfree(kset); kset_create()
908 kset->uevent_ops = uevent_ops; kset_create()
909 kset->kobj.parent = parent_kobj; kset_create()
912 * The kobject of this kset will have a type of kset_ktype and belong to kset_create()
913 * no kset itself. That way we can properly free it when it is kset_create()
916 kset->kobj.ktype = &kset_ktype; kset_create()
917 kset->kobj.kset = NULL; kset_create()
919 return kset; kset_create()
923 * kset_create_and_add - create a struct kset dynamically and add it to sysfs
925 * @name: the name for the kset
926 * @uevent_ops: a struct kset_uevent_ops for the kset
927 * @parent_kobj: the parent kobject of this kset, if any.
929 * This function creates a kset structure dynamically and registers it
934 * If the kset was not able to be created, NULL will be returned.
936 struct kset *kset_create_and_add(const char *name, kset_create_and_add()
940 struct kset *kset; kset_create_and_add() local
943 kset = kset_create(name, uevent_ops, parent_kobj); kset_create_and_add()
944 if (!kset) kset_create_and_add()
946 error = kset_register(kset); kset_create_and_add()
948 kfree(kset); kset_create_and_add()
951 return kset; kset_create_and_add()
H A Dkobject_uevent.c96 if (!ops && kobj->kset) { kobj_bcast_filter()
97 ksobj = &kobj->kset->kobj; kobj_bcast_filter()
172 struct kset *kset; kobject_uevent_env() local
183 /* search the kset we belong to */ kobject_uevent_env()
185 while (!top_kobj->kset && top_kobj->parent) kobject_uevent_env()
188 if (!top_kobj->kset) { kobject_uevent_env()
190 "without kset!\n", kobject_name(kobj), kobj, kobject_uevent_env()
195 kset = top_kobj->kset; kobject_uevent_env()
196 uevent_ops = kset->uevent_ops; kobject_uevent_env()
207 if (!uevent_ops->filter(kset, kobj)) { kobject_uevent_env()
216 subsystem = uevent_ops->name(kset, kobj); kobject_uevent_env()
218 subsystem = kobject_name(&kset->kobj); kobject_uevent_env()
258 /* let the kset specific function add its stuff */ kobject_uevent_env()
260 retval = uevent_ops->uevent(kset, kobj, env); kobject_uevent_env()
/linux-4.4.14/samples/kobject/
H A Dkset-example.c2 * Sample kset and ktype implementation
18 * This module shows how to create a kset in sysfs called
19 * /sys/kernel/kset-example
20 * Then tree kobjects are created and assigned to this kset, "foo", "baz",
195 static struct kset *example_kset;
211 * As we have a kset for this kobject, we need to set it before calling create_foo_obj()
214 foo->kobj.kset = example_kset; create_foo_obj()
218 * will be created here. As we have already specified a kset for this create_foo_obj()
220 * will be placed beneath that kset automatically. create_foo_obj()
245 * Create a kset with the name of "kset_example", example_init()
253 * Create three objects and register them with our kset example_init()
/linux-4.4.14/drivers/base/
H A Dbase.h6 * @subsys - the struct kset that defines this subsystem
29 struct kset subsys;
30 struct kset *devices_kset;
34 struct kset *drivers_kset;
41 struct kset glue_dirs;
136 extern struct kset *devices_kset;
H A Dcore.c273 static int dev_uevent_filter(struct kset *kset, struct kobject *kobj) dev_uevent_filter() argument
287 static const char *dev_uevent_name(struct kset *kset, struct kobject *kobj) dev_uevent_name() argument
298 static int dev_uevent(struct kset *kset, struct kobject *kobj, dev_uevent() argument
375 struct kset *kset; uevent_show() local
381 /* search the kset, the device belongs to */ uevent_show()
383 while (!top_kobj->kset && top_kobj->parent) uevent_show()
385 if (!top_kobj->kset) uevent_show()
388 kset = top_kobj->kset; uevent_show()
389 if (!kset->uevent_ops || !kset->uevent_ops->uevent) uevent_show()
393 if (kset->uevent_ops && kset->uevent_ops->filter) uevent_show()
394 if (!kset->uevent_ops->filter(kset, &dev->kobj)) uevent_show()
401 /* let the kset specific function add its keys */ uevent_show()
402 retval = kset->uevent_ops->uevent(kset, &dev->kobj, env); uevent_show()
534 struct kset *devices_kset;
702 dev->kobj.kset = devices_kset; device_initialize()
767 dir->kobj.kset = &class->p->glue_dirs; class_dir_create_and_add()
843 glue_dir->kset != &dev->class->p->glue_dirs) cleanup_glue_dir()
2063 * Make sure the device is off the kset list, in the device_shutdown()
H A Dbus.c26 static struct kset *system_kset;
165 static int bus_uevent_filter(struct kset *kset, struct kobject *kobj) bus_uevent_filter() argument
178 static struct kset *bus_kset;
695 priv->kobj.kset = bus->p->drivers_kset; bus_add_driver()
907 priv->subsys.kobj.kset = bus_kset; bus_register()
999 struct kset *bus_get_kset(struct bus_type *bus) bus_get_kset()
H A Dclass.c86 static struct kset *class_kset;
193 cp->subsys.kobj.kset = class_kset; __class_register()
195 cp->subsys.kobj.kset = class_kset; __class_register()
/linux-4.4.14/drivers/scsi/
H A Discsi_boot_sysfs.c319 boot_kobj->kobj.kset = boot_kset->kset; iscsi_boot_create_kobj()
358 * @boot_kset: boot kset
383 * @boot_kset: boot kset
409 * @boot_kset: boot kset
445 boot_kset->kset = kset_create_and_add(set_name, NULL, firmware_kobj); iscsi_boot_create_kset()
446 if (!boot_kset->kset) { iscsi_boot_create_kset()
476 * iscsi_boot_destroy_kset() - destroy kset and kobjects under it
477 * @boot_kset: boot kset
479 * This will remove the kset and kobjects and attrs under it.
492 kset_unregister(boot_kset->kset); iscsi_boot_destroy_kset()
/linux-4.4.14/fs/exofs/
H A Dsys.c57 static struct kset *exofs_kset;
161 s_kobj->kset = exofs_kset; exofs_sysfs_sb_add()
181 d_kobj->kset = exofs_kset; exofs_sysfs_odev_add()
/linux-4.4.14/fs/ocfs2/cluster/
H A Dmasklog.c167 static struct kset mlog_kset = {
171 int mlog_sys_init(struct kset *o2cb_kset) mlog_sys_init()
182 mlog_kset.kobj.kset = o2cb_kset; mlog_sys_init()
H A Dsys.c55 static struct kset *o2cb_kset;
H A Dmasklog.h200 int mlog_sys_init(struct kset *o2cb_subsys);
/linux-4.4.14/drivers/firmware/efi/
H A Druntime-map.c106 static struct kset *map_kset;
131 entry->kobj.kset = map_kset; add_sysfs_runtime_map_entry()
H A Desrt.c165 static struct kset *esrt_kset;
178 entry->kobj.kset = esrt_kset; esre_create_sysfs_entry()
426 pr_err("kset creation failed.\n"); esrt_sysfs_init()
H A Defivars.c86 static struct kset *efivars_kset;
569 new_var->kobj.kset = efivars_kset; efivar_create_sysfs_entry()
/linux-4.4.14/fs/ext4/
H A Dsysfs.c342 static struct kset ext4_kset = {
352 .kset = &ext4_kset,
391 sbi->s_kobj.kset = &ext4_kset; ext4_register_sysfs()
/linux-4.4.14/arch/powerpc/platforms/powernv/
H A Dopal-elog.c92 static struct kset *elog_kset;
195 elog->kobj.kset = elog_kset; create_elog_obj()
290 pr_warn("%s: failed to create elog kset\n", __func__); opal_elog_init()
H A Dopal-dump.c156 static struct kset *dump_kset;
332 dump->kobj.kset = dump_kset; create_dump_obj()
405 pr_warn("%s: Failed to create dump kset\n", __func__); opal_platform_dump_init()
/linux-4.4.14/drivers/pci/
H A Dslot.c15 struct kset *pci_slots_kset;
301 slot->kobj.kset = pci_slots_kset; pci_create_slot()
400 struct kset *pci_bus_kset; pci_slot_init()
H A Dpci.h214 extern struct kset *pci_slots_kset;
/linux-4.4.14/drivers/s390/char/
H A Dsclp_ocf.c34 static struct kset *ocf_kset;
H A Dsclp_cpi_sys.c384 static struct kset *cpi_kset;
/linux-4.4.14/drivers/of/
H A Dof_private.h36 extern struct kset *of_kset;
H A Dbase.c42 struct kset *of_kset;
171 np->kobj.kset = of_kset; __of_attach_node_sysfs()
196 /* Create the kset, and register existing nodes */ of_core_init()
/linux-4.4.14/fs/dlm/
H A Dlockspace.c195 static struct kset *dlm_kset;
227 static int dlm_uevent(struct kset *kset, struct kobject *kobj, dlm_uevent() argument
249 printk(KERN_WARNING "%s: can not create kset\n", __func__); dlm_lockspace_init()
629 ls->ls_kobj.kset = dlm_kset; new_lockspace()
/linux-4.4.14/fs/gfs2/
H A Dsys.c60 static struct kset *gfs2_kset;
661 sdp->sd_kobj.kset = gfs2_kset; gfs2_sys_fs_add()
709 static int gfs2_uevent(struct kset *kset, struct kobject *kobj, gfs2_uevent() argument
/linux-4.4.14/drivers/staging/most/mostcore/
H A Dcore.c524 static struct kset *most_channel_kset;
543 c->kobj.kset = most_channel_kset; create_most_c_obj()
723 static struct kset *most_inst_kset;
729 * This allocates memory for an instance structure, assigns the proper kset
742 inst->kobj.kset = most_inst_kset; create_most_inst_obj()
1084 static struct kset *most_aim_kset;
1090 * This creates an AIM object assigns the proper kset and registers
1102 most_aim->kobj.kset = most_aim_kset; create_most_aim_obj()
/linux-4.4.14/arch/s390/kernel/
H A Dipl.c562 static struct kset *ipl_kset;
1040 static struct kset *reipl_kset;
1041 static struct kset *reipl_fcp_kset;
1239 /* sysfs: create fcp kset for mixing attr group and bin attrs */ reipl_fcp_init()
1420 static struct kset *dump_kset;
1595 static struct kset *vmcmd_kset;
1658 static struct kset *shutdown_actions_kset;
/linux-4.4.14/drivers/parisc/
H A Dpdc_stable.c962 static struct kset *paths_kset;
992 entry->kobj.kset = paths_kset; pdcs_register_pathentries()
1069 /* register the paths kset as a child of the stable kset */ pdc_stable_init()
1076 /* now we create all "files" for the paths kset */ pdc_stable_init()
/linux-4.4.14/kernel/
H A Dparams.c812 mk->kobj.kset = module_kset; locate_module_kobject()
968 static int uevent_filter(struct kset *kset, struct kobject *kobj) uevent_filter() argument
981 struct kset *module_kset;
1002 printk(KERN_WARNING "%s (%d): error creating kset\n", param_sysfs_init()
H A Dmodule.c1774 mod->mkobj.kobj.kset = module_kset; mod_sysfs_init()
/linux-4.4.14/drivers/firmware/
H A Ddmi-sysfs.c569 static struct kset *dmi_kset;
599 entry->kobj.kset = dmi_kset; dmi_sysfs_register_handle()
H A Dmemmap.c187 static struct kset *mmap_kset; add_sysfs_fw_map_entry()
198 entry->kobj.kset = mmap_kset; add_sysfs_fw_map_entry()
H A Dedd.c634 static struct kset *edd_kset;
724 edev->kobj.kset = edd_kset; edd_device_register()
/linux-4.4.14/crypto/
H A Dpcrypt.c61 static struct kset *pcrypt_kset;
394 pinst->kobj.kset = pcrypt_kset; pcrypt_sysfs_add()
/linux-4.4.14/drivers/staging/lustre/lustre/ptlrpc/
H A Dptlrpc_internal.h83 int ptlrpc_sysfs_register_service(struct kset *parent,
H A Dlproc_ptlrpc.c1055 if (svc->srv_kobj.kset) { ptlrpc_sysfs_unregister_service()
1061 int ptlrpc_sysfs_register_service(struct kset *parent, ptlrpc_sysfs_register_service()
1066 svc->srv_kobj.kset = parent; ptlrpc_sysfs_register_service()
H A Dservice.c540 struct kset *parent, ptlrpc_register_service()
/linux-4.4.14/fs/nilfs2/
H A Dsysfs.c29 static struct kset *nilfs_kset;
101 kobj->kset = nilfs_kset; \
206 root->snapshot_kobj.kset = nilfs_kset; nilfs_sysfs_create_snapshot_group()
1006 nilfs->ns_dev_kobj.kset = nilfs_kset; nilfs_sysfs_create_device_group()
/linux-4.4.14/arch/arm/mach-omap1/
H A Dpm.h118 extern struct kset power_subsys;
/linux-4.4.14/fs/btrfs/
H A Dsysfs.c715 static struct kset *btrfs_kset;
733 fs_devs->fsid_kobj.kset = btrfs_kset; btrfs_sysfs_add_fsid()
/linux-4.4.14/drivers/staging/lustre/lustre/ldlm/
H A Dldlm_internal.h163 extern struct kset *ldlm_ns_kset;
H A Dldlm_lockd.c62 struct kset *ldlm_ns_kset;
63 static struct kset *ldlm_svc_kset;
H A Dldlm_resource.c397 ns->ns_kobj.kset = ldlm_ns_kset; ldlm_namespace_sysfs_register()
/linux-4.4.14/fs/xfs/
H A Dxfs_super.c63 static struct kset *xfs_kset; /* top-level xfs sysfs dir */
1455 mp->m_kobj.kobject.kset = xfs_kset; xfs_fs_fill_super()
1865 xfsstats.xs_kobj.kobject.kset = xfs_kset; init_xfs_fs()
1879 xfs_dbg_kobj.kobject.kset = xfs_kset; init_xfs_fs()
/linux-4.4.14/fs/ocfs2/
H A Dstackglue.c632 static struct kset *ocfs2_kset;
/linux-4.4.14/fs/f2fs/
H A Dsuper.c40 static struct kset *f2fs_kset;
1307 sbi->s_kobj.kset = f2fs_kset; f2fs_fill_super()
/linux-4.4.14/net/core/
H A Dnet-sysfs.c892 kobj->kset = dev->queues_kset; rx_queue_add_kobject()
1284 kobj->kset = dev->queues_kset; netdev_queue_add_kobject()
/linux-4.4.14/fs/ecryptfs/
H A Dmain.c796 printk(KERN_ERR "Unable to create ecryptfs kset\n"); do_sysfs_registration()
/linux-4.4.14/drivers/iommu/
H A Diommu.c36 static struct kset *iommu_group_kset;
184 group->kobj.kset = iommu_group_kset; iommu_group_alloc()
/linux-4.4.14/mm/
H A Dslub.c5312 static int uevent_filter(struct kset *kset, struct kobject *kobj) uevent_filter() argument
5325 static struct kset *slab_kset;
5327 static inline struct kset *cache_kset(struct kmem_cache *s) cache_kset()
5395 s->kobj.kset = cache_kset(s); sysfs_slab_add()
/linux-4.4.14/drivers/staging/lustre/lustre/llite/
H A Dlproc_llite.c1061 sbi->ll_kobj.kset = llite_kset; ldebugfs_register_mountpoint()
H A Dllite_internal.h637 extern struct kset *llite_kset;
H A Dllite_lib.c61 struct kset *llite_kset;
/linux-4.4.14/drivers/acpi/
H A Dbus.c1083 printk(KERN_WARNING "%s: kset create error\n", __func__); acpi_init()
/linux-4.4.14/drivers/md/bcache/
H A Dsuper.c871 * only class / kset properties are persistent */ bch_cached_dev_run()
/linux-4.4.14/drivers/staging/lustre/lustre/include/
H A Dlustre_net.h2505 struct kset *parent,

Completed in 2038 milliseconds