aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/ll_rw_blk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/ll_rw_blk.c')
-rw-r--r--drivers/block/ll_rw_blk.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index 11ef9d9ea139..81fe3a0c1fe7 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -2038,7 +2038,6 @@ EXPORT_SYMBOL(blk_requeue_request);
2038 * @rq: request to be inserted 2038 * @rq: request to be inserted
2039 * @at_head: insert request at head or tail of queue 2039 * @at_head: insert request at head or tail of queue
2040 * @data: private data 2040 * @data: private data
2041 * @reinsert: true if request it a reinsertion of previously processed one
2042 * 2041 *
2043 * Description: 2042 * Description:
2044 * Many block devices need to execute commands asynchronously, so they don't 2043 * Many block devices need to execute commands asynchronously, so they don't
@@ -2053,8 +2052,9 @@ EXPORT_SYMBOL(blk_requeue_request);
2053 * host that is unable to accept a particular command. 2052 * host that is unable to accept a particular command.
2054 */ 2053 */
2055void blk_insert_request(request_queue_t *q, struct request *rq, 2054void blk_insert_request(request_queue_t *q, struct request *rq,
2056 int at_head, void *data, int reinsert) 2055 int at_head, void *data)
2057{ 2056{
2057 int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
2058 unsigned long flags; 2058 unsigned long flags;
2059 2059
2060 /* 2060 /*
@@ -2071,20 +2071,12 @@ void blk_insert_request(request_queue_t *q, struct request *rq,
2071 /* 2071 /*
2072 * If command is tagged, release the tag 2072 * If command is tagged, release the tag
2073 */ 2073 */
2074 if (reinsert) 2074 if (blk_rq_tagged(rq))
2075 blk_requeue_request(q, rq); 2075 blk_queue_end_tag(q, rq);
2076 else {
2077 int where = ELEVATOR_INSERT_BACK;
2078
2079 if (at_head)
2080 where = ELEVATOR_INSERT_FRONT;
2081 2076
2082 if (blk_rq_tagged(rq)) 2077 drive_stat_acct(rq, rq->nr_sectors, 1);
2083 blk_queue_end_tag(q, rq); 2078 __elv_add_request(q, rq, where, 0);
2084 2079
2085 drive_stat_acct(rq, rq->nr_sectors, 1);
2086 __elv_add_request(q, rq, where, 0);
2087 }
2088 if (blk_queue_plugged(q)) 2080 if (blk_queue_plugged(q))
2089 __generic_unplug_device(q); 2081 __generic_unplug_device(q);
2090 else 2082 else
@@ -3582,7 +3574,7 @@ queue_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
3582 3574
3583 q = container_of(kobj, struct request_queue, kobj); 3575 q = container_of(kobj, struct request_queue, kobj);
3584 if (!entry->show) 3576 if (!entry->show)
3585 return 0; 3577 return -EIO;
3586 3578
3587 return entry->show(q, page); 3579 return entry->show(q, page);
3588} 3580}
@@ -3596,7 +3588,7 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
3596 3588
3597 q = container_of(kobj, struct request_queue, kobj); 3589 q = container_of(kobj, struct request_queue, kobj);
3598 if (!entry->store) 3590 if (!entry->store)
3599 return -EINVAL; 3591 return -EIO;
3600 3592
3601 return entry->store(q, page, length); 3593 return entry->store(q, page, length);
3602} 3594}