mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
block: implement and enforce request peek/start/fetch
Till now block layer allowed two separate modes of request execution. A request is always acquired from the request queue via elv_next_request(). After that, drivers are free to either dequeue it or process it without dequeueing. Dequeue allows elv_next_request() to return the next request so that multiple requests can be in flight. Executing requests without dequeueing has its merits mostly in allowing drivers for simpler devices which can't do sg to deal with segments only without considering request boundary. However, the benefit this brings is dubious and declining while the cost of the API ambiguity is increasing. Segment based drivers are usually for very old or limited devices and as converting to dequeueing model isn't difficult, it doesn't justify the API overhead it puts on block layer and its more modern users. Previous patches converted all block low level drivers to dequeueing model. This patch completes the API transition by... * renaming elv_next_request() to blk_peek_request() * renaming blkdev_dequeue_request() to blk_start_request() * adding blk_fetch_request() which is combination of peek and start * disallowing completion of queued (not started) requests * applying new API to all LLDs Renamings are for consistency and to break out of tree code so that it's apparent that out of tree drivers need updating. [ Impact: block request issue API cleanup, no functional change ] Signed-off-by: Tejun Heo <[email protected]> Cc: Rusty Russell <[email protected]> Cc: James Bottomley <[email protected]> Cc: Mike Miller <[email protected]> Cc: unsik Kim <[email protected]> Cc: Paul Clements <[email protected]> Cc: Tim Waugh <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: David S. Miller <[email protected]> Cc: Laurent Vivier <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Cc: Grant Likely <[email protected]> Cc: Adrian McMenamin <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Sergei Shtylyov <[email protected]> Cc: Alex Dubov <[email protected]> Cc: Pierre Ossman <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Markus Lidel <[email protected]> Cc: Stefan Weinhuber <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Pete Zaitcev <[email protected]> Cc: FUJITA Tomonori <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
2343046826
commit
9934c8c045
45 changed files with 172 additions and 207 deletions
|
|
@ -877,7 +877,7 @@ static void i2o_block_request_fn(struct request_queue *q)
|
|||
struct request *req;
|
||||
|
||||
while (!blk_queue_plugged(q)) {
|
||||
req = elv_next_request(q);
|
||||
req = blk_peek_request(q);
|
||||
if (!req)
|
||||
break;
|
||||
|
||||
|
|
@ -890,7 +890,7 @@ static void i2o_block_request_fn(struct request_queue *q)
|
|||
|
||||
if (queue_depth < I2O_BLOCK_MAX_OPEN_REQUESTS) {
|
||||
if (!i2o_block_transfer(req)) {
|
||||
blkdev_dequeue_request(req);
|
||||
blk_start_request(req);
|
||||
continue;
|
||||
} else
|
||||
osm_info("transfer error\n");
|
||||
|
|
@ -917,7 +917,7 @@ static void i2o_block_request_fn(struct request_queue *q)
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
blkdev_dequeue_request(req);
|
||||
blk_start_request(req);
|
||||
__blk_end_request_all(req, -EIO);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue