aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/configfs/configfs.txt
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-06-18 22:29:05 -0400
committerMark Fasheh <mfasheh@suse.com>2008-07-31 19:21:13 -0400
commitecb3d28c7edd58b54f16838c434b342ba9195bec (patch)
tree2babdc068dde924a905b0b25e673be0ca7a7dccd /Documentation/filesystems/configfs/configfs.txt
parent70526b67443a980d5029d9cf06903bef731a4e96 (diff)
[PATCH] configfs: Convenience macros for attribute definition.
Sysfs has the _ATTR() and _ATTR_RO() macros to make defining extended form attributes easier. configfs should have something similiar. - _CONFIGFS_ATTR() and _CONFIGFS_ATTR_RO() are the counterparts to the sysfs macros. - CONFIGFS_ATTR_STRUCT() creates the extended form attribute structure. - CONFIGFS_ATTR_OPS() defines the show_attribute()/store_attribute() operations that call the show()/store() operations of the extended form configfs_attributes. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'Documentation/filesystems/configfs/configfs.txt')
-rw-r--r--Documentation/filesystems/configfs/configfs.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt
index 44c97e6accb2..fabcb0e00f25 100644
--- a/Documentation/filesystems/configfs/configfs.txt
+++ b/Documentation/filesystems/configfs/configfs.txt
@@ -311,9 +311,20 @@ the subsystem must be ready for it.
311[An Example] 311[An Example]
312 312
313The best example of these basic concepts is the simple_children 313The best example of these basic concepts is the simple_children
314subsystem/group and the simple_child item in configfs_example.c It 314subsystem/group and the simple_child item in configfs_example_explicit.c
315shows a trivial object displaying and storing an attribute, and a simple 315and configfs_example_macros.c. It shows a trivial object displaying and
316group creating and destroying these children. 316storing an attribute, and a simple group creating and destroying these
317children.
318
319The only difference between configfs_example_explicit.c and
320configfs_example_macros.c is how the attributes of the childless item
321are defined. The childless item has extended attributes, each with
322their own show()/store() operation. This follows a convention commonly
323used in sysfs. configfs_example_explicit.c creates these attributes
324by explicitly defining the structures involved. Conversely
325configfs_example_macros.c uses some convenience macros from configfs.h
326to define the attributes. These macros are similar to their sysfs
327counterparts.
317 328
318[Hierarchy Navigation and the Subsystem Mutex] 329[Hierarchy Navigation and the Subsystem Mutex]
319 330