diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2009-10-21 12:22:46 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:00:46 -0500 |
commit | 3ae31f6a7b6e442fc6a92f29330fbad230dc3992 (patch) | |
tree | 9ca152ac3412de2917c0486b64898e6a75f853d9 /include | |
parent | 42e62a74377bcbb526565a31aa18da8f712b93ee (diff) |
[SCSI] scsi_dh: Change the scsidh_activate interface to be asynchronous
Make scsi_dh_activate() function asynchronous, by taking in two additional
parameters, one is the callback function and the other is the data to call
the callback function with.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/scsi_device.h | 3 | ||||
-rw-r--r-- | include/scsi/scsi_dh.h | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 92c4c3bd916d..68d185c79bae 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -177,6 +177,7 @@ struct scsi_dh_devlist { | |||
177 | char *model; | 177 | char *model; |
178 | }; | 178 | }; |
179 | 179 | ||
180 | typedef void (*activate_complete)(void *, int); | ||
180 | struct scsi_device_handler { | 181 | struct scsi_device_handler { |
181 | /* Used by the infrastructure */ | 182 | /* Used by the infrastructure */ |
182 | struct list_head list; /* list of scsi_device_handlers */ | 183 | struct list_head list; /* list of scsi_device_handlers */ |
@@ -188,7 +189,7 @@ struct scsi_device_handler { | |||
188 | int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *); | 189 | int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *); |
189 | int (*attach)(struct scsi_device *); | 190 | int (*attach)(struct scsi_device *); |
190 | void (*detach)(struct scsi_device *); | 191 | void (*detach)(struct scsi_device *); |
191 | int (*activate)(struct scsi_device *); | 192 | int (*activate)(struct scsi_device *, activate_complete, void *); |
192 | int (*prep_fn)(struct scsi_device *, struct request *); | 193 | int (*prep_fn)(struct scsi_device *, struct request *); |
193 | int (*set_params)(struct scsi_device *, const char *); | 194 | int (*set_params)(struct scsi_device *, const char *); |
194 | }; | 195 | }; |
diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h index ff2407405b42..e3f2db212ddc 100644 --- a/include/scsi/scsi_dh.h +++ b/include/scsi/scsi_dh.h | |||
@@ -56,14 +56,16 @@ enum { | |||
56 | SCSI_DH_DRIVER_MAX, | 56 | SCSI_DH_DRIVER_MAX, |
57 | }; | 57 | }; |
58 | #if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE) | 58 | #if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE) |
59 | extern int scsi_dh_activate(struct request_queue *); | 59 | extern int scsi_dh_activate(struct request_queue *, activate_complete, void *); |
60 | extern int scsi_dh_handler_exist(const char *); | 60 | extern int scsi_dh_handler_exist(const char *); |
61 | extern int scsi_dh_attach(struct request_queue *, const char *); | 61 | extern int scsi_dh_attach(struct request_queue *, const char *); |
62 | extern void scsi_dh_detach(struct request_queue *); | 62 | extern void scsi_dh_detach(struct request_queue *); |
63 | extern int scsi_dh_set_params(struct request_queue *, const char *); | 63 | extern int scsi_dh_set_params(struct request_queue *, const char *); |
64 | #else | 64 | #else |
65 | static inline int scsi_dh_activate(struct request_queue *req) | 65 | static inline int scsi_dh_activate(struct request_queue *req, |
66 | activate_complete fn, void *data) | ||
66 | { | 67 | { |
68 | fn(data, 0); | ||
67 | return 0; | 69 | return 0; |
68 | } | 70 | } |
69 | static inline int scsi_dh_handler_exist(const char *name) | 71 | static inline int scsi_dh_handler_exist(const char *name) |