Skip to content

Commit

Permalink
block: mq-deadline: Simplify deadline_skip_seq_writes()
Browse files Browse the repository at this point in the history
Make the deadline_skip_seq_writes() code shorter without changing its
functionality.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230517174230.897144-8-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Bart Van Assche authored and Jens Axboe committed May 19, 2023
1 parent e0d85cd commit 3b463cb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions block/mq-deadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,11 @@ static struct request *deadline_skip_seq_writes(struct deadline_data *dd,
struct request *rq)
{
sector_t pos = blk_rq_pos(rq);
sector_t skipped_sectors = 0;

while (rq) {
if (blk_rq_pos(rq) != pos + skipped_sectors)
break;
skipped_sectors += blk_rq_sectors(rq);
do {
pos += blk_rq_sectors(rq);
rq = deadline_latter_request(rq);
}
} while (rq && blk_rq_pos(rq) == pos);

return rq;
}
Expand Down

0 comments on commit 3b463cb

Please sign in to comment.