Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
configfs_macros.h File Reference
#include <linux/configfs.h>

Go to the source code of this file.

Macros

#define CONFIGFS_EATTR_STRUCT(_name, _item)
 
#define __CONFIGFS_EATTR(_name, _mode, _show, _store)
 
#define __CONFIGFS_EATTR_RO(_name, _show)
 
#define CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member)
 
#define CONFIGFS_EATTR_OPS_SHOW(_name, _item)
 
#define CONFIGFS_EATTR_OPS_STORE(_name, _item)
 
#define CONFIGFS_EATTR_OPS(_name, _item, _item_member)
 
#define CONFIGFS_EATTR_OPS_RO(_name, _item, _item_member)
 

Macro Definition Documentation

#define __CONFIGFS_EATTR (   _name,
  _mode,
  _show,
  _store 
)
Value:
{ \
.attr = { \
.ca_name = __stringify(_name), \
.ca_mode = _mode, \
.ca_owner = THIS_MODULE, \
}, \
.show = _show, \
.store = _store, \
}

Definition at line 68 of file configfs_macros.h.

#define __CONFIGFS_EATTR_RO (   _name,
  _show 
)
Value:
{ \
.attr = { \
.ca_name = __stringify(_name), \
.ca_mode = 0444, \
.ca_owner = THIS_MODULE, \
}, \
.show = _show, \
}

Definition at line 79 of file configfs_macros.h.

#define CONFIGFS_EATTR_OPS (   _name,
  _item,
  _item_member 
)
Value:
CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member); \
CONFIGFS_EATTR_OPS_SHOW(_name, _item); \
CONFIGFS_EATTR_OPS_STORE(_name, _item);

Definition at line 138 of file configfs_macros.h.

#define CONFIGFS_EATTR_OPS_RO (   _name,
  _item,
  _item_member 
)
Value:
CONFIGFS_EATTR_OPS_TO_FUNC(_name, _item, _item_member); \
CONFIGFS_EATTR_OPS_SHOW(_name, _item);

Definition at line 143 of file configfs_macros.h.

#define CONFIGFS_EATTR_OPS_SHOW (   _name,
  _item 
)
Value:
static ssize_t _name##_attr_show(struct config_item *item, \
char *page) \
{ \
struct _item *_item = to_##_name(item); \
struct _name##_attribute * _name##_attr = \
container_of(attr, struct _name##_attribute, attr); \
if (_name##_attr->show) \
ret = _name##_attr->show(_item, page); \
return ret; \
}

Definition at line 108 of file configfs_macros.h.

#define CONFIGFS_EATTR_OPS_STORE (   _name,
  _item 
)
Value:
static ssize_t _name##_attr_store(struct config_item *item, \
const char *page, size_t count) \
{ \
struct _item *_item = to_##_name(item); \
struct _name##_attribute * _name##_attr = \
container_of(attr, struct _name##_attribute, attr); \
if (_name##_attr->store) \
ret = _name##_attr->store(_item, page, count); \
return ret; \
}

Definition at line 123 of file configfs_macros.h.

#define CONFIGFS_EATTR_OPS_TO_FUNC (   _name,
  _item,
  _item_member 
)
Value:
static struct _item *to_##_name(struct config_item *ci) \
{ \
return (ci) ? container_of(to_config_group(ci), struct _item, \
_item_member) : NULL; \
}

Definition at line 101 of file configfs_macros.h.

#define CONFIGFS_EATTR_STRUCT (   _name,
  _item 
)
Value:
struct _name##_attribute { \
ssize_t (*show)(struct _item *, char *); \
ssize_t (*store)(struct _item *, const char *, size_t); \
}

Definition at line 53 of file configfs_macros.h.