Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

configfs: remove mentions of committable items

A proposition of implementation of committable items has been rejected
due to the gpio-sim module being the only user and configfs not getting
much development in general. In that case, let's remove the notion
of committable items from docs and headers.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Bartosz Golaszewski and committed by
Christoph Hellwig
77992f89 c65234b2

-51
-48
Documentation/filesystems/configfs.rst
··· 289 289 const char *name); 290 290 struct config_group *(*make_group)(struct config_group *group, 291 291 const char *name); 292 - int (*commit_item)(struct config_item *item); 293 292 void (*disconnect_notify)(struct config_group *group, 294 293 struct config_item *item); 295 294 void (*drop_item)(struct config_group *group, ··· 485 486 succeeds, then heartbeat knows the region is safe to give to ocfs2. 486 487 If it fails, it was being torn down anyway, and heartbeat can gracefully 487 488 pass up an error. 488 - 489 - Committable Items 490 - ================= 491 - 492 - Note: 493 - Committable items are currently unimplemented. 494 - 495 - Some config_items cannot have a valid initial state. That is, no 496 - default values can be specified for the item's attributes such that the 497 - item can do its work. Userspace must configure one or more attributes, 498 - after which the subsystem can start whatever entity this item 499 - represents. 500 - 501 - Consider the FakeNBD device from above. Without a target address *and* 502 - a target device, the subsystem has no idea what block device to import. 503 - The simple example assumes that the subsystem merely waits until all the 504 - appropriate attributes are configured, and then connects. This will, 505 - indeed, work, but now every attribute store must check if the attributes 506 - are initialized. Every attribute store must fire off the connection if 507 - that condition is met. 508 - 509 - Far better would be an explicit action notifying the subsystem that the 510 - config_item is ready to go. More importantly, an explicit action allows 511 - the subsystem to provide feedback as to whether the attributes are 512 - initialized in a way that makes sense. configfs provides this as 513 - committable items. 514 - 515 - configfs still uses only normal filesystem operations. An item is 516 - committed via rename(2). The item is moved from a directory where it 517 - can be modified to a directory where it cannot. 518 - 519 - Any group that provides the ct_group_ops->commit_item() method has 520 - committable items. When this group appears in configfs, mkdir(2) will 521 - not work directly in the group. Instead, the group will have two 522 - subdirectories: "live" and "pending". The "live" directory does not 523 - support mkdir(2) or rmdir(2) either. It only allows rename(2). The 524 - "pending" directory does allow mkdir(2) and rmdir(2). An item is 525 - created in the "pending" directory. Its attributes can be modified at 526 - will. Userspace commits the item by renaming it into the "live" 527 - directory. At this point, the subsystem receives the ->commit_item() 528 - callback. If all required attributes are filled to satisfaction, the 529 - method returns zero and the item is moved to the "live" directory. 530 - 531 - As rmdir(2) does not work in the "live" directory, an item must be 532 - shutdown, or "uncommitted". Again, this is done via rename(2), this 533 - time from the "live" directory back to the "pending" one. The subsystem 534 - is notified by the ct_group_ops->uncommit_object() method.
-3
include/linux/configfs.h
··· 204 204 * group children. default_groups may coexist alongsize make_group() or 205 205 * make_item(), but if the group wishes to have only default_groups 206 206 * children (disallowing mkdir(2)), it need not provide either function. 207 - * If the group has commit(), it supports pending and committed (active) 208 - * items. 209 207 */ 210 208 struct configfs_item_operations { 211 209 void (*release)(struct config_item *); ··· 214 216 struct configfs_group_operations { 215 217 struct config_item *(*make_item)(struct config_group *group, const char *name); 216 218 struct config_group *(*make_group)(struct config_group *group, const char *name); 217 - int (*commit_item)(struct config_item *item); 218 219 void (*disconnect_notify)(struct config_group *group, struct config_item *item); 219 220 void (*drop_item)(struct config_group *group, struct config_item *item); 220 221 };