Lines Matching +full:group +full:- +full:default
2 Configfs - Userspace-driven Kernel Object Configuration
16 configfs is a ram-based filesystem that provides the converse of
17 sysfs's functionality. Where sysfs is a filesystem-based view of
18 kernel objects, configfs is a filesystem-based manager of kernel
33 symlink(2) can be used to group items together. Unlike sysfs, the
46 mount -t configfs none /config
56 read(2) can query their default values, and write(2) can store new
74 imperative for user-space to check the return code of close(2) in order to
76 To avoid a malicious user OOMing the kernel, there's a per-binary attribute
109 read-only or read-write::
127 Items are created and destroyed inside a config_group. A group is a
130 handles that. The group has a set of operations to perform these tasks
202 allocated dynamically will need to provide the ct_item_ops->release()
221 It then adds the attribute to the NULL-terminated array
222 config_item_type->ct_attrs. When the item appears in configfs, the
223 attribute file will appear with the configfs_attribute->ca_name
224 filename. configfs_attribute->ca_mode specifies the file permissions.
226 If an attribute is readable and provides a ->show method, that method will
228 attribute is writable and provides a ->store method, that method will be
244 To do so add the binary attribute to the NULL-terminated array
245 config_item_type->ct_bin_attrs, and the item appears in configfs, the
246 attribute file will appear with the configfs_bin_attribute->cb_attr.ca_name
247 filename. configfs_bin_attribute->cb_attr.ca_mode specifies the file
254 ct_item_ops->read_bin_attribute() method, that method will be called
275 void config_group_init(struct config_group *group);
276 void config_group_init_type_name(struct config_group *group,
282 that item means that a group can behave as an item in its own right.
284 accomplished via the group operations specified on the group's
288 struct config_item *(*make_item)(struct config_group *group,
290 struct config_group *(*make_group)(struct config_group *group,
292 void (*disconnect_notify)(struct config_group *group,
294 void (*drop_item)(struct config_group *group,
298 A group creates child items by providing the
299 ct_group_ops->make_item() method. If provided, this method is called from
300 mkdir(2) in the group's directory. The subsystem allocates a new
305 If the subsystem wants the child to be a group itself, the subsystem
306 provides ct_group_ops->make_group(). Everything else behaves the same,
307 using the group _init() functions on the group.
309 Finally, when userspace calls rmdir(2) on the item or group,
310 ct_group_ops->drop_item() is called. As a config_group is also a
314 the ct_group_ops->drop_item() method, and configfs will call
330 ct_group_ops->disconnect_notify() method. The method is called after
332 item is removed from its parent group. Like drop_item(),
337 is implemented in the configfs rmdir(2) code. ->drop_item() will not be
356 The group is where child config_items are created. For a subsystem,
357 this group is usually defined statically. Before calling
359 group via the usual group _init() functions, and it must also have
370 subsystem/group and the simple_child item in
372 and storing an attribute, and a simple group creating and destroying
382 this reason, the hierarchy is mirrored via the config_group->cg_children
383 and config_item->ci_parent structure members.
404 configfs provides a simple group via the group->item parent/child
409 A config_item may provide the ct_item_ops->allow_link() and
410 ct_item_ops->drop_link() methods. If the ->allow_link() method exists,
415 When symlink(2) is called, the source config_item's ->allow_link()
422 notified via the ->drop_link() method. Like the ->drop_item() method,
434 While this could be codified by magic names in ->make_item(), it is much
437 Rather than have a group where some items behave differently than
445 These automatic subgroups, or default groups, do not preclude other
446 children of the parent group. If ct_group_ops->make_group() exists,
447 other child groups can be created on the parent group directly.
449 A configfs subsystem specifies default groups by adding them using the
451 structure. Each added group is populated in the configfs tree at the same
452 time as the parent group. Similarly, they are removed at the same time
453 as the parent. No extra notification is provided. When a ->drop_item()
454 method call notifies the subsystem the parent group is going away, it
455 also means every default group child associated with that parent group.
457 As a consequence of this, default groups cannot be removed directly via
459 group is checking for children.
472 depended on. configfs will then return -EBUSY from rmdir(2) for that