Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107387
b: refs/heads/master
c: ecb3d28
h: refs/heads/master
i:
  107385: b691663
  107383: 4bcf38f
v: v3
  • Loading branch information
Joel Becker authored and Mark Fasheh committed Jul 31, 2008
1 parent 1f276ab commit b53b568
Show file tree
Hide file tree
Showing 5 changed files with 537 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70526b67443a980d5029d9cf06903bef731a4e96
refs/heads/master: ecb3d28c7edd58b54f16838c434b342ba9195bec
17 changes: 14 additions & 3 deletions trunk/Documentation/filesystems/configfs/configfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,20 @@ the subsystem must be ready for it.
[An Example]

The best example of these basic concepts is the simple_children
subsystem/group and the simple_child item in configfs_example.c It
shows a trivial object displaying and storing an attribute, and a simple
group creating and destroying these children.
subsystem/group and the simple_child item in configfs_example_explicit.c
and configfs_example_macros.c. It shows a trivial object displaying and
storing an attribute, and a simple group creating and destroying these
children.

The only difference between configfs_example_explicit.c and
configfs_example_macros.c is how the attributes of the childless item
are defined. The childless item has extended attributes, each with
their own show()/store() operation. This follows a convention commonly
used in sysfs. configfs_example_explicit.c creates these attributes
by explicitly defining the structures involved. Conversely
configfs_example_macros.c uses some convenience macros from configfs.h
to define the attributes. These macros are similar to their sysfs
counterparts.

[Hierarchy Navigation and the Subsystem Mutex]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/*
* vim: noexpandtab ts=8 sts=0 sw=8:
*
* configfs_example.c - This file is a demonstration module containing
* a number of configfs subsystems.
* configfs_example_explicit.c - This file is a demonstration module
* containing a number of configfs subsystems. It explicitly defines
* each structure without using the helper macros defined in
* configfs.h.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
Expand Down Expand Up @@ -281,7 +283,6 @@ static struct config_item *simple_children_make_item(struct config_group *group,
if (!simple_child)
return ERR_PTR(-ENOMEM);


config_item_init_type_name(&simple_child->item, name,
&simple_child_type);

Expand All @@ -302,8 +303,8 @@ static struct configfs_attribute *simple_children_attrs[] = {
};

static ssize_t simple_children_attr_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
struct configfs_attribute *attr,
char *page)
{
return sprintf(page,
"[02-simple-children]\n"
Expand All @@ -318,7 +319,7 @@ static void simple_children_release(struct config_item *item)
}

static struct configfs_item_operations simple_children_item_ops = {
.release = simple_children_release,
.release = simple_children_release,
.show_attribute = simple_children_attr_show,
};

Expand Down Expand Up @@ -368,7 +369,6 @@ static struct config_group *group_children_make_group(struct config_group *group
if (!simple_children)
return ERR_PTR(-ENOMEM);


config_group_init_type_name(&simple_children->group, name,
&simple_children_type);

Expand All @@ -387,8 +387,8 @@ static struct configfs_attribute *group_children_attrs[] = {
};

static ssize_t group_children_attr_show(struct config_item *item,
struct configfs_attribute *attr,
char *page)
struct configfs_attribute *attr,
char *page)
{
return sprintf(page,
"[03-group-children]\n"
Expand Down
Loading

0 comments on commit b53b568

Please sign in to comment.