aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/configfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/configfs.h')
-rw-r--r--include/linux/configfs.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index 3d4a96eb0e9b..def7c83d43a2 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -130,6 +130,22 @@ struct configfs_attribute {
130 mode_t ca_mode; 130 mode_t ca_mode;
131}; 131};
132 132
133/*
134 * Users often need to create attribute structures for their configurable
135 * attributes, containing a configfs_attribute member and function pointers
136 * for the show() and store() operations on that attribute. They can use
137 * this macro (similar to sysfs' __ATTR) to make defining attributes easier.
138 */
139#define __CONFIGFS_ATTR(_name, _mode, _show, _store) \
140{ \
141 .attr = { \
142 .ca_name = __stringify(_name), \
143 .ca_mode = _mode, \
144 .ca_owner = THIS_MODULE, \
145 }, \
146 .show = _show, \
147 .store = _store, \
148}
133 149
134/* 150/*
135 * If allow_link() exists, the item can symlink(2) out to other 151 * If allow_link() exists, the item can symlink(2) out to other