Go to the documentation of this file.
38 #include <linux/kernel.h>
39 #include <linux/types.h>
40 #include <linux/list.h>
47 #define CONFIGFS_ITEM_NAME_LEN 20
115 static inline void config_group_put(
struct config_group *group)
138 #define CONFIGFS_ATTR_STRUCT(_item) \
139 struct _item##_attribute { \
140 struct configfs_attribute attr; \
141 ssize_t (*show)(struct _item *, char *); \
142 ssize_t (*store)(struct _item *, const char *, size_t); \
153 #define __CONFIGFS_ATTR(_name, _mode, _show, _store) \
156 .ca_name = __stringify(_name), \
158 .ca_owner = THIS_MODULE, \
164 #define __CONFIGFS_ATTR_RO(_name, _show) \
167 .ca_name = __stringify(_name), \
169 .ca_owner = THIS_MODULE, \
182 #define CONFIGFS_ATTR_OPS(_item) \
183 static ssize_t _item##_attr_show(struct config_item *item, \
184 struct configfs_attribute *attr, \
187 struct _item *_item = to_##_item(item); \
188 struct _item##_attribute *_item##_attr = \
189 container_of(attr, struct _item##_attribute, attr); \
192 if (_item##_attr->show) \
193 ret = _item##_attr->show(_item, page); \
196 static ssize_t _item##_attr_store(struct config_item *item, \
197 struct configfs_attribute *attr, \
198 const char *page, size_t count) \
200 struct _item *_item = to_##_item(item); \
201 struct _item##_attribute *_item##_attr = \
202 container_of(attr, struct _item##_attribute, attr); \
203 ssize_t ret = -EINVAL; \
205 if (_item##_attr->store) \
206 ret = _item##_attr->store(_item, page, count); \