diff options
author | Joel Becker <joel.becker@oracle.com> | 2006-10-06 20:33:23 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2007-07-10 20:11:01 -0400 |
commit | 299894cc9001b09e3e9685f2709b49e7e1092ccc (patch) | |
tree | 2a2e9bb69d2393bf620a34daea17e52ed9f9e5d7 /Documentation/filesystems | |
parent | 6d748924b753d63a57dad130fdf11f64c27ff54b (diff) |
configfs: accessing item hierarchy during rmdir(2)
Add a notification callback, ops->disconnect_notify(). It has the same
prototype as ->drop_item(), but it will be called just before the item
linkage is broken. This way, configfs users who want to do work while
the object is still in the heirarchy have a chance.
Client drivers will still need to config_item_put() in their
->drop_item(), if they implement it. They need do nothing in
->disconnect_notify(). They don't have to provide it if they don't
care. But someone who wants to be notified before ci_parent is set to
NULL can now be notified.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/configfs/configfs.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt index 21f038e66724..aef74cdecc21 100644 --- a/Documentation/filesystems/configfs/configfs.txt +++ b/Documentation/filesystems/configfs/configfs.txt | |||
@@ -238,6 +238,8 @@ config_item_type. | |||
238 | struct config_group *(*make_group)(struct config_group *group, | 238 | struct config_group *(*make_group)(struct config_group *group, |
239 | const char *name); | 239 | const char *name); |
240 | int (*commit_item)(struct config_item *item); | 240 | int (*commit_item)(struct config_item *item); |
241 | void (*disconnect_notify)(struct config_group *group, | ||
242 | struct config_item *item); | ||
241 | void (*drop_item)(struct config_group *group, | 243 | void (*drop_item)(struct config_group *group, |
242 | struct config_item *item); | 244 | struct config_item *item); |
243 | }; | 245 | }; |
@@ -268,6 +270,16 @@ the item in other threads, the memory is safe. It may take some time | |||
268 | for the item to actually disappear from the subsystem's usage. But it | 270 | for the item to actually disappear from the subsystem's usage. But it |
269 | is gone from configfs. | 271 | is gone from configfs. |
270 | 272 | ||
273 | When drop_item() is called, the item's linkage has already been torn | ||
274 | down. It no longer has a reference on its parent and has no place in | ||
275 | the item hierarchy. If a client needs to do some cleanup before this | ||
276 | teardown happens, the subsystem can implement the | ||
277 | ct_group_ops->disconnect_notify() method. The method is called after | ||
278 | configfs has removed the item from the filesystem view but before the | ||
279 | item is removed from its parent group. Like drop_item(), | ||
280 | disconnect_notify() is void and cannot fail. Client subsystems should | ||
281 | not drop any references here, as they still must do it in drop_item(). | ||
282 | |||
271 | A config_group cannot be removed while it still has child items. This | 283 | A config_group cannot be removed while it still has child items. This |
272 | is implemented in the configfs rmdir(2) code. ->drop_item() will not be | 284 | is implemented in the configfs rmdir(2) code. ->drop_item() will not be |
273 | called, as the item has not been dropped. rmdir(2) will fail, as the | 285 | called, as the item has not been dropped. rmdir(2) will fail, as the |