diff options
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r-- | Documentation/filesystems/configfs/configfs_example.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example.c index 3d4713a6c207..2d6a14a463e0 100644 --- a/Documentation/filesystems/configfs/configfs_example.c +++ b/Documentation/filesystems/configfs/configfs_example.c | |||
@@ -264,6 +264,15 @@ static struct config_item_type simple_child_type = { | |||
264 | }; | 264 | }; |
265 | 265 | ||
266 | 266 | ||
267 | struct simple_children { | ||
268 | struct config_group group; | ||
269 | }; | ||
270 | |||
271 | static inline struct simple_children *to_simple_children(struct config_item *item) | ||
272 | { | ||
273 | return item ? container_of(to_config_group(item), struct simple_children, group) : NULL; | ||
274 | } | ||
275 | |||
267 | static struct config_item *simple_children_make_item(struct config_group *group, const char *name) | 276 | static struct config_item *simple_children_make_item(struct config_group *group, const char *name) |
268 | { | 277 | { |
269 | struct simple_child *simple_child; | 278 | struct simple_child *simple_child; |
@@ -304,7 +313,13 @@ static ssize_t simple_children_attr_show(struct config_item *item, | |||
304 | "items have only one attribute that is readable and writeable.\n"); | 313 | "items have only one attribute that is readable and writeable.\n"); |
305 | } | 314 | } |
306 | 315 | ||
316 | static void simple_children_release(struct config_item *item) | ||
317 | { | ||
318 | kfree(to_simple_children(item)); | ||
319 | } | ||
320 | |||
307 | static struct configfs_item_operations simple_children_item_ops = { | 321 | static struct configfs_item_operations simple_children_item_ops = { |
322 | .release = simple_children_release, | ||
308 | .show_attribute = simple_children_attr_show, | 323 | .show_attribute = simple_children_attr_show, |
309 | }; | 324 | }; |
310 | 325 | ||
@@ -345,10 +360,6 @@ static struct configfs_subsystem simple_children_subsys = { | |||
345 | * children of its own. | 360 | * children of its own. |
346 | */ | 361 | */ |
347 | 362 | ||
348 | struct simple_children { | ||
349 | struct config_group group; | ||
350 | }; | ||
351 | |||
352 | static struct config_group *group_children_make_group(struct config_group *group, const char *name) | 363 | static struct config_group *group_children_make_group(struct config_group *group, const char *name) |
353 | { | 364 | { |
354 | struct simple_children *simple_children; | 365 | struct simple_children *simple_children; |