Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
raid_class.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/raid_class.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>

Go to the source code of this file.

Data Structures

struct  raid_internal
 
struct  raid_component
 

Macros

#define RAID_NUM_ATTRS   3
 
#define to_raid_internal(tmpl)   container_of(tmpl, struct raid_internal, r)
 
#define tc_to_raid_internal(tcont)
 
#define ac_to_raid_internal(acont)
 
#define device_to_raid_internal(dev)
 
#define raid_attr_show_internal(attr, fmt, var, code)
 
#define raid_attr_ro_states(attr, states, code)
 
#define raid_attr_ro_internal(attr, code)
 
#define ATTR_CODE(attr)
 
#define raid_attr_ro(attr)   raid_attr_ro_internal(attr, )
 
#define raid_attr_ro_fn(attr)   raid_attr_ro_internal(attr, ATTR_CODE(attr))
 
#define raid_attr_ro_state(attr)   raid_attr_ro_states(attr, attr, )
 
#define raid_attr_ro_state_fn(attr)   raid_attr_ro_states(attr, attr, ATTR_CODE(attr))
 

Functions

 raid_attr_ro_state (level)
 
 raid_attr_ro_fn (resync)
 
 raid_attr_ro_state_fn (state)
 
int raid_component_add (struct raid_template *r, struct device *raid_dev, struct device *component_dev)
 
 EXPORT_SYMBOL (raid_component_add)
 
struct raid_templateraid_class_attach (struct raid_function_template *ft)
 
 EXPORT_SYMBOL (raid_class_attach)
 
void raid_class_release (struct raid_template *r)
 
 EXPORT_SYMBOL (raid_class_release)
 
 MODULE_AUTHOR ("James Bottomley")
 
 MODULE_DESCRIPTION ("RAID device class")
 
 MODULE_LICENSE ("GPL")
 
 module_init (raid_init)
 
 module_exit (raid_exit)
 

Macro Definition Documentation

#define ac_to_raid_internal (   acont)
Value:
({ \
container_of(acont, struct transport_container, ac); \
tc_to_raid_internal(tc); \
})

Definition at line 47 of file raid_class.c.

#define ATTR_CODE (   attr)
Value:
if (i->f->get_##attr) \
i->f->get_##attr(dev->parent);

Definition at line 199 of file raid_class.c.

#define device_to_raid_internal (   dev)
Value:
({ \
attribute_container_classdev_to_container(dev); \
ac_to_raid_internal(ac); \
})

Definition at line 53 of file raid_class.c.

#define raid_attr_ro (   attr)    raid_attr_ro_internal(attr, )

Definition at line 204 of file raid_class.c.

#define raid_attr_ro_fn (   attr)    raid_attr_ro_internal(attr, ATTR_CODE(attr))

Definition at line 205 of file raid_class.c.

#define raid_attr_ro_internal (   attr,
  code 
)
Value:
static DEVICE_ATTR(attr, S_IRUGO, raid_show_##attr, NULL)

Definition at line 195 of file raid_class.c.

#define raid_attr_ro_state (   attr)    raid_attr_ro_states(attr, attr, )

Definition at line 206 of file raid_class.c.

#define raid_attr_ro_state_fn (   attr)    raid_attr_ro_states(attr, attr, ATTR_CODE(attr))

Definition at line 207 of file raid_class.c.

#define raid_attr_ro_states (   attr,
  states,
  code 
)
Value:
const char *name; \
code \
name = raid_##states##_name(rd->attr); \
) \
static DEVICE_ATTR(attr, S_IRUGO, raid_show_##attr, NULL)

Definition at line 186 of file raid_class.c.

#define raid_attr_show_internal (   attr,
  fmt,
  var,
  code 
)
Value:
static ssize_t raid_show_##attr(struct device *dev, \
char *buf) \
{ \
code \
return snprintf(buf, 20, #fmt "\n", var); \
}

Definition at line 176 of file raid_class.c.

#define RAID_NUM_ATTRS   3

Definition at line 21 of file raid_class.c.

#define tc_to_raid_internal (   tcont)
Value:
({ \
container_of(tcont, struct raid_template, raid_attrs); \
to_raid_internal(r); \
})

Definition at line 41 of file raid_class.c.

#define to_raid_internal (   tmpl)    container_of(tmpl, struct raid_internal, r)

Definition at line 39 of file raid_class.c.

Function Documentation

EXPORT_SYMBOL ( raid_component_add  )
EXPORT_SYMBOL ( raid_class_attach  )
EXPORT_SYMBOL ( raid_class_release  )
MODULE_AUTHOR ( "James Bottomley"  )
MODULE_DESCRIPTION ( "RAID device class )
module_exit ( raid_exit  )
module_init ( raid_init  )
MODULE_LICENSE ( "GPL"  )
raid_attr_ro_fn ( resync  )
raid_attr_ro_state ( level  )
raid_attr_ro_state_fn ( state  )
struct raid_template* raid_class_attach ( struct raid_function_template ft)
read

Definition at line 262 of file raid_class.c.

void raid_class_release ( struct raid_template r)

Definition at line 291 of file raid_class.c.

int raid_component_add ( struct raid_template r,
struct device raid_dev,
struct device component_dev 
)

Definition at line 223 of file raid_class.c.

Variable Documentation

char* name

Definition at line 122 of file raid_class.c.

enum raid_level value

Definition at line 121 of file raid_class.c.