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.
324 A kset is merely a collection of kobjects that want to be associated with
328 A kset serves these functions:
330 - It serves as a bag containing a group of objects. A kset can be used by
333 - A kset is also a subdirectory in sysfs, where the associated kobjects
334 with the kset can show up. Every kset contains a kobject which can be
341 In object-oriented terms, "kset" is the top-level container class; ksets
342 contain their own kobject, but that kobject is managed by the kset code and
345 A kset keeps its children in a standard kernel linked list. Kobjects point
346 back to their containing kset via their kset field. In almost all cases,
347 the kobjects belonging to a kset have that kset (or, strictly, its embedded
350 As a kset contains a kobject within it, it should always be dynamically
352 kset use::
354 struct kset *kset_create_and_add(const char *name,
358 When you are finished with the kset, call::
360 void kset_unregister(struct kset *kset);
362 to destroy it. This removes the kset from sysfs and decrements its reference
363 count. When the reference count goes to zero, the kset will be released.
364 Because other references to the kset may still exist, the release may happen
367 An example of using a kset can be seen in the
368 samples/kobject/kset-example.c file in the kernel tree.
370 If a kset wishes to control the uevent operations of the kobjects
374 int (*filter)(struct kset *kset, struct kobject *kobj);
375 const char *(*name)(struct kset *kset, struct kobject *kobj);
376 int (*uevent)(struct kset *kset, struct kobject *kobj,
381 The filter function allows a kset to prevent a uevent from being emitted to
385 The name function will be called to override the default name of the kset
387 as the kset itself, but this function, if present, can override that name.
392 One might ask how, exactly, a kobject is added to a kset, given that no
395 kobject_add(), its kset member should point to the kset to which the
398 If the kobject belonging to a kset has no parent kobject set, it will be
399 added to the kset's directory. Not all members of a kset do necessarily
400 live in the kset directory. If an explicit parent kobject is assigned
401 before the kobject is added, the kobject is registered with the kset, but
433 example programs samples/kobject/{kobject-example.c,kset-example.c},