mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[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 <[email protected]> Signed-off-by: James Bottomley <[email protected]>
This commit is contained in:
parent
42e62a7437
commit
3ae31f6a7b
8 changed files with 42 additions and 20 deletions
|
|
@ -177,6 +177,7 @@ struct scsi_dh_devlist {
|
|||
char *model;
|
||||
};
|
||||
|
||||
typedef void (*activate_complete)(void *, int);
|
||||
struct scsi_device_handler {
|
||||
/* Used by the infrastructure */
|
||||
struct list_head list; /* list of scsi_device_handlers */
|
||||
|
|
@ -188,7 +189,7 @@ struct scsi_device_handler {
|
|||
int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *);
|
||||
int (*attach)(struct scsi_device *);
|
||||
void (*detach)(struct scsi_device *);
|
||||
int (*activate)(struct scsi_device *);
|
||||
int (*activate)(struct scsi_device *, activate_complete, void *);
|
||||
int (*prep_fn)(struct scsi_device *, struct request *);
|
||||
int (*set_params)(struct scsi_device *, const char *);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,14 +56,16 @@ enum {
|
|||
SCSI_DH_DRIVER_MAX,
|
||||
};
|
||||
#if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE)
|
||||
extern int scsi_dh_activate(struct request_queue *);
|
||||
extern int scsi_dh_activate(struct request_queue *, activate_complete, void *);
|
||||
extern int scsi_dh_handler_exist(const char *);
|
||||
extern int scsi_dh_attach(struct request_queue *, const char *);
|
||||
extern void scsi_dh_detach(struct request_queue *);
|
||||
extern int scsi_dh_set_params(struct request_queue *, const char *);
|
||||
#else
|
||||
static inline int scsi_dh_activate(struct request_queue *req)
|
||||
static inline int scsi_dh_activate(struct request_queue *req,
|
||||
activate_complete fn, void *data)
|
||||
{
|
||||
fn(data, 0);
|
||||
return 0;
|
||||
}
|
||||
static inline int scsi_dh_handler_exist(const char *name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue