mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
block: blk_rq_[cur_]_{sectors|bytes}() usage cleanup
With the previous changes, the followings are now guaranteed for all requests in any valid state. * blk_rq_sectors() == blk_rq_bytes() >> 9 * blk_rq_cur_sectors() == blk_rq_cur_bytes() >> 9 Clean up accessor usages. Notable changes are * nbd,i2o_block: end_all used instead of explicit byte count * scsi_lib: unnecessary conditional on request type removed [ Impact: cleanup ] Signed-off-by: Tejun Heo <[email protected]> Cc: Paul Clements <[email protected]> Cc: Pete Zaitcev <[email protected]> Cc: Alex Dubov <[email protected]> Cc: Markus Lidel <[email protected]> Cc: David Woodhouse <[email protected]> Cc: James Bottomley <[email protected]> Cc: Boaz Harrosh <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
a2dec7b363
commit
1011c1b9f2
9 changed files with 18 additions and 30 deletions
|
|
@ -189,7 +189,7 @@ static void jsfd_do_request(struct request_queue *q)
|
|||
while ((req = elv_next_request(q)) != NULL) {
|
||||
struct jsfd_part *jdp = req->rq_disk->private_data;
|
||||
unsigned long offset = blk_rq_pos(req) << 9;
|
||||
size_t len = blk_rq_cur_sectors(req) << 9;
|
||||
size_t len = blk_rq_cur_bytes(req);
|
||||
|
||||
if ((offset + len) > jdp->dsize) {
|
||||
__blk_end_request_cur(req, -EIO);
|
||||
|
|
|
|||
Loading…
Reference in a new issue