aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/attribute_container.h4
-rw-r--r--include/linux/raid_class.h59
-rw-r--r--include/scsi/scsi_eh.h3
-rw-r--r--include/scsi/scsi_host.h2
4 files changed, 61 insertions, 7 deletions
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index ee83fe64a102..93bfb0beb62a 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -11,12 +11,12 @@
11 11
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/klist.h>
14#include <linux/spinlock.h> 15#include <linux/spinlock.h>
15 16
16struct attribute_container { 17struct attribute_container {
17 struct list_head node; 18 struct list_head node;
18 struct list_head containers; 19 struct klist containers;
19 spinlock_t containers_lock;
20 struct class *class; 20 struct class *class;
21 struct class_device_attribute **attrs; 21 struct class_device_attribute **attrs;
22 int (*match)(struct attribute_container *, struct device *); 22 int (*match)(struct attribute_container *, struct device *);
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
new file mode 100644
index 000000000000..a71123c28272
--- /dev/null
+++ b/include/linux/raid_class.h
@@ -0,0 +1,59 @@
1/*
2 */
3#include <linux/transport_class.h>
4
5struct raid_template {
6 struct transport_container raid_attrs;
7};
8
9struct raid_function_template {
10 void *cookie;
11 int (*is_raid)(struct device *);
12 void (*get_resync)(struct device *);
13 void (*get_state)(struct device *);
14};
15
16enum raid_state {
17 RAID_ACTIVE = 1,
18 RAID_DEGRADED,
19 RAID_RESYNCING,
20 RAID_OFFLINE,
21};
22
23struct raid_data {
24 struct list_head component_list;
25 int component_count;
26 int level;
27 enum raid_state state;
28 int resync;
29};
30
31#define DEFINE_RAID_ATTRIBUTE(type, attr) \
32static inline void \
33raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
34 struct class_device *cdev = \
35 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
36 struct raid_data *rd; \
37 BUG_ON(!cdev); \
38 rd = class_get_devdata(cdev); \
39 rd->attr = value; \
40} \
41static inline type \
42raid_get_##attr(struct raid_template *r, struct device *dev) { \
43 struct class_device *cdev = \
44 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
45 struct raid_data *rd; \
46 BUG_ON(!cdev); \
47 rd = class_get_devdata(cdev); \
48 return rd->attr; \
49}
50
51DEFINE_RAID_ATTRIBUTE(int, level)
52DEFINE_RAID_ATTRIBUTE(int, resync)
53DEFINE_RAID_ATTRIBUTE(enum raid_state, state)
54
55struct raid_template *raid_class_attach(struct raid_function_template *);
56void raid_class_release(struct raid_template *);
57
58void raid_component_add(struct raid_template *, struct device *,
59 struct device *);
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index b24d224281bd..fabd879c2f2e 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -35,9 +35,6 @@ static inline int scsi_sense_valid(struct scsi_sense_hdr *sshdr)
35} 35}
36 36
37 37
38extern void scsi_add_timer(struct scsi_cmnd *, int,
39 void (*)(struct scsi_cmnd *));
40extern int scsi_delete_timer(struct scsi_cmnd *);
41extern void scsi_report_bus_reset(struct Scsi_Host *, int); 38extern void scsi_report_bus_reset(struct Scsi_Host *, int);
42extern void scsi_report_device_reset(struct Scsi_Host *, int, int); 39extern void scsi_report_device_reset(struct Scsi_Host *, int, int);
43extern int scsi_block_when_processing_errors(struct scsi_device *); 40extern int scsi_block_when_processing_errors(struct scsi_device *);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index ac1b6125e3ae..916144be208b 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -467,12 +467,10 @@ struct Scsi_Host {
467 struct task_struct * ehandler; /* Error recovery thread. */ 467 struct task_struct * ehandler; /* Error recovery thread. */
468 struct semaphore * eh_wait; /* The error recovery thread waits 468 struct semaphore * eh_wait; /* The error recovery thread waits
469 on this. */ 469 on this. */
470 struct completion * eh_notify; /* wait for eh to begin or end */
471 struct semaphore * eh_action; /* Wait for specific actions on the 470 struct semaphore * eh_action; /* Wait for specific actions on the
472 host. */ 471 host. */
473 unsigned int eh_active:1; /* Indicates the eh thread is awake and active if 472 unsigned int eh_active:1; /* Indicates the eh thread is awake and active if
474 this is true. */ 473 this is true. */
475 unsigned int eh_kill:1; /* set when killing the eh thread */
476 wait_queue_head_t host_wait; 474 wait_queue_head_t host_wait;
477 struct scsi_host_template *hostt; 475 struct scsi_host_template *hostt;
478 struct scsi_transport_template *transportt; 476 struct scsi_transport_template *transportt;