Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
configfs.h File Reference
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/list.h>
#include <linux/kref.h>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/atomic.h>

Go to the source code of this file.

Data Structures

struct  config_item
 
struct  config_item_type
 
struct  config_group
 
struct  configfs_attribute
 
struct  configfs_item_operations
 
struct  configfs_group_operations
 
struct  configfs_subsystem
 

Macros

#define CONFIGFS_ITEM_NAME_LEN   20
 
#define CONFIGFS_ATTR_STRUCT(_item)
 
#define __CONFIGFS_ATTR(_name, _mode, _show, _store)
 
#define __CONFIGFS_ATTR_RO(_name, _show)
 
#define CONFIGFS_ATTR_OPS(_item)
 

Functions

int config_item_set_name (struct config_item *, const char *,...)
 
void config_item_init (struct config_item *)
 
void config_item_init_type_name (struct config_item *item, const char *name, struct config_item_type *type)
 
struct config_itemconfig_item_get (struct config_item *)
 
void config_item_put (struct config_item *)
 
void config_group_init (struct config_group *group)
 
void config_group_init_type_name (struct config_group *group, const char *name, struct config_item_type *type)
 
struct config_itemconfig_group_find_item (struct config_group *, const char *)
 
int configfs_register_subsystem (struct configfs_subsystem *subsys)
 
void configfs_unregister_subsystem (struct configfs_subsystem *subsys)
 
int configfs_depend_item (struct configfs_subsystem *subsys, struct config_item *target)
 
void configfs_undepend_item (struct configfs_subsystem *subsys, struct config_item *target)
 

Macro Definition Documentation

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

Definition at line 153 of file configfs.h.

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

Definition at line 164 of file configfs.h.

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

Definition at line 182 of file configfs.h.

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

Definition at line 138 of file configfs.h.

#define CONFIGFS_ITEM_NAME_LEN   20

Definition at line 47 of file configfs.h.

Function Documentation

struct config_item* config_group_find_item ( struct config_group ,
const char  
)
read

Definition at line 195 of file item.c.

void config_group_init ( struct config_group group)

config_group_init - initialize a group for use : group

Definition at line 180 of file item.c.

void config_group_init_type_name ( struct config_group group,
const char name,
struct config_item_type type 
)

Definition at line 125 of file item.c.

struct config_item* config_item_get ( struct config_item )
read

Definition at line 134 of file item.c.

void config_item_init ( struct config_item item)

config_item_init - initialize item. : item in question.

Definition at line 50 of file item.c.

void config_item_init_type_name ( struct config_item item,
const char name,
struct config_item_type type 
)

Definition at line 115 of file item.c.

void config_item_put ( struct config_item item)

config_item_put - decrement refcount for item. : item.

Decrement the refcount, and if 0, call config_item_cleanup().

Definition at line 170 of file item.c.

int config_item_set_name ( struct config_item ,
const char ,
  ... 
)

Definition at line 65 of file item.c.

int configfs_depend_item ( struct configfs_subsystem subsys,
struct config_item target 
)

Definition at line 1066 of file dir.c.

int configfs_register_subsystem ( struct configfs_subsystem subsys)

Definition at line 1666 of file dir.c.

void configfs_undepend_item ( struct configfs_subsystem subsys,
struct config_item target 
)

Definition at line 1140 of file dir.c.

void configfs_unregister_subsystem ( struct configfs_subsystem subsys)

Definition at line 1719 of file dir.c.