Lines Matching refs:kset
36 - A kset is a group of kobjects. These kobjects can be of the same ktype
37 or belong to different ktypes. The kset is the basic container type for
39 safely ignore that implementation detail as the kset core code handles
43 of those directories corresponds to a kobject in the same kset.
131 properly. If the kobject is to be associated with a specific kset,
132 kobj->kset must be assigned before calling kobject_add(). If a kset is
135 kset itself.
320 A kset is merely a collection of kobjects that want to be associated with
324 A kset serves these functions:
326 - It serves as a bag containing a group of objects. A kset can be used by
329 - A kset is also a subdirectory in sysfs, where the associated kobjects
330 with the kset can show up. Every kset contains a kobject which can be
337 In object-oriented terms, "kset" is the top-level container class; ksets
338 contain their own kobject, but that kobject is managed by the kset code and
341 A kset keeps its children in a standard kernel linked list. Kobjects point
342 back to their containing kset via their kset field. In almost all cases,
343 the kobjects belonging to a kset have that kset (or, strictly, its embedded
346 As a kset contains a kobject within it, it should always be dynamically
348 kset use::
350 struct kset *kset_create_and_add(const char *name,
354 When you are finished with the kset, call::
356 void kset_unregister(struct kset *kset);
358 to destroy it. This removes the kset from sysfs and decrements its reference
359 count. When the reference count goes to zero, the kset will be released.
360 Because other references to the kset may still exist, the release may happen
363 An example of using a kset can be seen in the
364 samples/kobject/kset-example.c file in the kernel tree.
366 If a kset wishes to control the uevent operations of the kobjects
370 int (*filter)(struct kset *kset, struct kobject *kobj);
371 const char *(*name)(struct kset *kset, struct kobject *kobj);
372 int (*uevent)(struct kset *kset, struct kobject *kobj,
377 The filter function allows a kset to prevent a uevent from being emitted to
381 The name function will be called to override the default name of the kset
383 as the kset itself, but this function, if present, can override that name.
388 One might ask how, exactly, a kobject is added to a kset, given that no
391 kobject_add(), its kset member should point to the kset to which the
394 If the kobject belonging to a kset has no parent kobject set, it will be
395 added to the kset's directory. Not all members of a kset do necessarily
396 live in the kset directory. If an explicit parent kobject is assigned
397 before the kobject is added, the kobject is registered with the kset, but
429 example programs samples/kobject/{kobject-example.c,kset-example.c},