Commit 1848dd12 authored by Patrick Mansfield's avatar Patrick Mansfield Committed by James Bottomley

[PATCH] 2/7 add missing scsi_queue_next_request calls

Add missing scsi_queue_next_request calls.

Add missing scsi_put_command and scsi_get_command exports.
parent c607140b
...@@ -417,6 +417,7 @@ extern void scsi_setup_cmd_retry(Scsi_Cmnd *SCpnt); ...@@ -417,6 +417,7 @@ extern void scsi_setup_cmd_retry(Scsi_Cmnd *SCpnt);
extern void scsi_io_completion(Scsi_Cmnd * SCpnt, int good_sectors, extern void scsi_io_completion(Scsi_Cmnd * SCpnt, int good_sectors,
int block_sectors); int block_sectors);
extern int scsi_queue_insert(struct scsi_cmnd *cmd, int reason); extern int scsi_queue_insert(struct scsi_cmnd *cmd, int reason);
extern void scsi_queue_next_request(request_queue_t *q, struct scsi_cmnd *cmd);
extern request_queue_t *scsi_alloc_queue(struct Scsi_Host *shost); extern request_queue_t *scsi_alloc_queue(struct Scsi_Host *shost);
extern void scsi_free_queue(request_queue_t *q); extern void scsi_free_queue(request_queue_t *q);
extern int scsi_init_queue(void); extern int scsi_init_queue(void);
......
...@@ -1681,6 +1681,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag) ...@@ -1681,6 +1681,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
struct scsi_cmnd *scmd = scsi_get_command(dev, GFP_KERNEL); struct scsi_cmnd *scmd = scsi_get_command(dev, GFP_KERNEL);
struct request req; struct request req;
int rtn; int rtn;
struct request_queue *q;
scmd->request = &req; scmd->request = &req;
memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout));
...@@ -1735,6 +1736,8 @@ scsi_reset_provider(struct scsi_device *dev, int flag) ...@@ -1735,6 +1736,8 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
} }
scsi_delete_timer(scmd); scsi_delete_timer(scmd);
q = scmd->device->request_queue;
scsi_put_command(scmd); scsi_put_command(scmd);
scsi_queue_next_request(q, NULL);
return rtn; return rtn;
} }
...@@ -174,14 +174,18 @@ void scsi_do_req(struct scsi_request *sreq, const void *cmnd, ...@@ -174,14 +174,18 @@ void scsi_do_req(struct scsi_request *sreq, const void *cmnd,
void (*done)(struct scsi_cmnd *), void (*done)(struct scsi_cmnd *),
int timeout, int retries) int timeout, int retries)
{ {
struct request_queue *q;
/* /*
* If the upper level driver is reusing these things, then * If the upper level driver is reusing these things, then
* we should release the low-level block now. Another one will * we should release the low-level block now. Another one will
* be allocated later when this request is getting queued. * be allocated later when this request is getting queued.
*/ */
if (sreq->sr_command) { if (sreq->sr_command) {
q = sreq->sr_command->device->request_queue;
scsi_put_command(sreq->sr_command); scsi_put_command(sreq->sr_command);
sreq->sr_command = NULL; sreq->sr_command = NULL;
scsi_queue_next_request(q, NULL);
} }
/* /*
...@@ -228,6 +232,7 @@ static void scsi_wait_done(struct scsi_cmnd *cmd) ...@@ -228,6 +232,7 @@ static void scsi_wait_done(struct scsi_cmnd *cmd)
void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer, void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
unsigned bufflen, int timeout, int retries) unsigned bufflen, int timeout, int retries)
{ {
struct request_queue *q;
DECLARE_COMPLETION(wait); DECLARE_COMPLETION(wait);
sreq->sr_request->waiting = &wait; sreq->sr_request->waiting = &wait;
...@@ -239,7 +244,9 @@ void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer, ...@@ -239,7 +244,9 @@ void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
sreq->sr_request->waiting = NULL; sreq->sr_request->waiting = NULL;
if (sreq->sr_command) { if (sreq->sr_command) {
q = sreq->sr_command->device->request_queue;
scsi_put_command(sreq->sr_command); scsi_put_command(sreq->sr_command);
scsi_queue_next_request(q, NULL);
sreq->sr_command = NULL; sreq->sr_command = NULL;
} }
} }
...@@ -351,7 +358,7 @@ void scsi_setup_cmd_retry(struct scsi_cmnd *cmd) ...@@ -351,7 +358,7 @@ void scsi_setup_cmd_retry(struct scsi_cmnd *cmd)
* permutations grows as 2**N, and if too many more special cases * permutations grows as 2**N, and if too many more special cases
* get added, we start to get screwed. * get added, we start to get screwed.
*/ */
static void scsi_queue_next_request(request_queue_t *q, struct scsi_cmnd *cmd) void scsi_queue_next_request(request_queue_t *q, struct scsi_cmnd *cmd)
{ {
struct scsi_device *sdev, *sdev2; struct scsi_device *sdev, *sdev2;
struct Scsi_Host *shost; struct Scsi_Host *shost;
......
...@@ -60,6 +60,8 @@ EXPORT_SYMBOL(scsi_allocate_request); ...@@ -60,6 +60,8 @@ EXPORT_SYMBOL(scsi_allocate_request);
EXPORT_SYMBOL(scsi_release_request); EXPORT_SYMBOL(scsi_release_request);
EXPORT_SYMBOL(scsi_wait_req); EXPORT_SYMBOL(scsi_wait_req);
EXPORT_SYMBOL(scsi_do_req); EXPORT_SYMBOL(scsi_do_req);
EXPORT_SYMBOL(scsi_get_command);
EXPORT_SYMBOL(scsi_put_command);
EXPORT_SYMBOL(scsi_report_bus_reset); EXPORT_SYMBOL(scsi_report_bus_reset);
EXPORT_SYMBOL(scsi_block_requests); EXPORT_SYMBOL(scsi_block_requests);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment