lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/4] configfs: implement committable items
On Mon, Nov 30, 2020 at 05:47:03PM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> This implements configfs committable items. We mostly follow the
> documentation except that we extend config_group_ops with uncommit_item()
> callback for reverting the changes made by commit_item().
>
> Each committable group has two sub-directories: pending and live. New
> items can only be created in pending/. Attributes can only be modified
> while the item is in pending/. Once it's ready to be committed, it must
> be moved over to live/ using the rename() system call. This is when the
> commit_item() function will be called.
>
> Implementation-wise: we reuse the default group mechanism to elegantly
> plug the new pseude-groups into configfs. The pending group inherits the
> parent group's operations so that config_items can be seamlesly created
> in it using the callbacks supplied by the user as part of the committable
> group itself.

This looks pretty awkward in the hierachy, but I can't really think
of anything else. One idea would be to require fsync to stage updates,
but that isn't really very well discoverable.

\
 
 \ /
  Last update: 2020-12-01 12:29    [W:0.087 / U:3.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site