[SCSI] remove requeue feature from blk_insert_request()
authorTejun Heo <htejun@gmail.com>
Sun, 24 Apr 2005 07:06:05 +0000 (02:06 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Fri, 20 May 2005 17:53:28 +0000 (12:53 -0500)
blk_insert_request() has a unobivous feature of requeuing a
request setting REQ_SPECIAL|REQ_SOFTBARRIER.  SCSI midlayer
was the only user and as previous patches removed the usage,
remove the feature from blk_insert_request().  Only special
requests should be queued with blk_insert_request().  All
requeueing should go through blk_requeue_request().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/block/ll_rw_blk.c
drivers/block/paride/pd.c
drivers/block/sx8.c
drivers/scsi/scsi_lib.c
include/linux/blkdev.h

index 11ef9d9ea139316e454cfae3d3b10f7aaab71959..f20eba22b14b254553933848e94f3f4192552603 100644 (file)
@@ -2038,7 +2038,6 @@ EXPORT_SYMBOL(blk_requeue_request);
  * @rq:                request to be inserted
  * @at_head:   insert request at head or tail of queue
  * @data:      private data
- * @reinsert:  true if request it a reinsertion of previously processed one
  *
  * Description:
  *    Many block devices need to execute commands asynchronously, so they don't
@@ -2053,8 +2052,9 @@ EXPORT_SYMBOL(blk_requeue_request);
  *    host that is unable to accept a particular command.
  */
 void blk_insert_request(request_queue_t *q, struct request *rq,
-                       int at_head, void *data, int reinsert)
+                       int at_head, void *data)
 {
+       int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
        unsigned long flags;
 
        /*
@@ -2071,20 +2071,12 @@ void blk_insert_request(request_queue_t *q, struct request *rq,
        /*
         * If command is tagged, release the tag
         */
-       if (reinsert)
-               blk_requeue_request(q, rq);
-       else {
-               int where = ELEVATOR_INSERT_BACK;
-
-               if (at_head)
-                       where = ELEVATOR_INSERT_FRONT;
+       if (blk_rq_tagged(rq))
+               blk_queue_end_tag(q, rq);
 
-               if (blk_rq_tagged(rq))
-                       blk_queue_end_tag(q, rq);
+       drive_stat_acct(rq, rq->nr_sectors, 1);
+       __elv_add_request(q, rq, where, 0);
 
-               drive_stat_acct(rq, rq->nr_sectors, 1);
-               __elv_add_request(q, rq, where, 0);
-       }
        if (blk_queue_plugged(q))
                __generic_unplug_device(q);
        else
index 202a5a74ad37ba6e3aee1edcac7ffe1c0482e4cf..fa49d62626ba12d1e8647993f48a4fa6e655d660 100644 (file)
@@ -723,7 +723,7 @@ static int pd_special_command(struct pd_unit *disk,
        rq.ref_count = 1;
        rq.waiting = &wait;
        rq.end_io = blk_end_sync_rq;
-       blk_insert_request(disk->gd->queue, &rq, 0, func, 0);
+       blk_insert_request(disk->gd->queue, &rq, 0, func);
        wait_for_completion(&wait);
        rq.waiting = NULL;
        if (rq.errors)
index 797f5988c2b574fb06b4b6005ae8a01afccbe78c..5ed3a63794522ae0fbca00d787daf6a780aaf717 100644 (file)
@@ -614,7 +614,7 @@ static int carm_array_info (struct carm_host *host, unsigned int array_idx)
        spin_unlock_irq(&host->lock);
 
        DPRINTK("blk_insert_request, tag == %u\n", idx);
-       blk_insert_request(host->oob_q, crq->rq, 1, crq, 0);
+       blk_insert_request(host->oob_q, crq->rq, 1, crq);
 
        return 0;
 
@@ -653,7 +653,7 @@ static int carm_send_special (struct carm_host *host, carm_sspc_t func)
        crq->msg_bucket = (u32) rc;
 
        DPRINTK("blk_insert_request, tag == %u\n", idx);
-       blk_insert_request(host->oob_q, crq->rq, 1, crq, 0);
+       blk_insert_request(host->oob_q, crq->rq, 1, crq);
 
        return 0;
 }
index 861d5f5c9722dc16ad57652b0e174db2afcb3ce3..47a4ad40bf4e4dae6aa5daa13fd98b92b857f905 100644 (file)
@@ -92,7 +92,7 @@ int scsi_insert_special_req(struct scsi_request *sreq, int at_head)
         */
        sreq->sr_request->flags &= ~REQ_DONTPREP;
        blk_insert_request(sreq->sr_device->request_queue, sreq->sr_request,
-                          at_head, sreq, 0);
+                          at_head, sreq);
        return 0;
 }
 
index ef1afc178c0a2df9569daf3312e33911a0e89bf2..4a99b76c5a338d027cfbb48b0a27e4a0dfe5fe4d 100644 (file)
@@ -544,7 +544,7 @@ extern void blk_end_sync_rq(struct request *rq);
 extern void blk_attempt_remerge(request_queue_t *, struct request *);
 extern void __blk_attempt_remerge(request_queue_t *, struct request *);
 extern struct request *blk_get_request(request_queue_t *, int, int);
-extern void blk_insert_request(request_queue_t *, struct request *, int, void *, int);
+extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
 extern void blk_requeue_request(request_queue_t *, struct request *);
 extern void blk_plug_device(request_queue_t *);
 extern int blk_remove_plug(request_queue_t *);