mirror of https://github.com/torvalds/linux.git
block/mq-deadline: Introduce dd_start_request()
Prepare for adding a second caller of this function. No functionality has been changed. Cc: Damien Le Moal <dlemoal@kernel.org> Cc: Yu Kuai <yukuai@kernel.org> Cc: chengkaitao <chengkaitao@kylinos.cn> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
211ddde082
commit
93a358af59
|
|
@ -306,6 +306,19 @@ static bool started_after(struct deadline_data *dd, struct request *rq,
|
|||
return time_after(start_time, latest_start);
|
||||
}
|
||||
|
||||
static struct request *dd_start_request(struct deadline_data *dd,
|
||||
enum dd_data_dir data_dir,
|
||||
struct request *rq)
|
||||
{
|
||||
u8 ioprio_class = dd_rq_ioclass(rq);
|
||||
enum dd_prio prio = ioprio_class_to_prio[ioprio_class];
|
||||
|
||||
dd->per_prio[prio].latest_pos[data_dir] = blk_rq_pos(rq);
|
||||
dd->per_prio[prio].stats.dispatched++;
|
||||
rq->rq_flags |= RQF_STARTED;
|
||||
return rq;
|
||||
}
|
||||
|
||||
/*
|
||||
* deadline_dispatch_requests selects the best request according to
|
||||
* read/write expire, fifo_batch, etc and with a start time <= @latest_start.
|
||||
|
|
@ -316,8 +329,6 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd,
|
|||
{
|
||||
struct request *rq, *next_rq;
|
||||
enum dd_data_dir data_dir;
|
||||
enum dd_prio prio;
|
||||
u8 ioprio_class;
|
||||
|
||||
lockdep_assert_held(&dd->lock);
|
||||
|
||||
|
|
@ -411,12 +422,7 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd,
|
|||
dd->batching++;
|
||||
deadline_move_request(dd, per_prio, rq);
|
||||
done:
|
||||
ioprio_class = dd_rq_ioclass(rq);
|
||||
prio = ioprio_class_to_prio[ioprio_class];
|
||||
dd->per_prio[prio].latest_pos[data_dir] = blk_rq_pos(rq);
|
||||
dd->per_prio[prio].stats.dispatched++;
|
||||
rq->rq_flags |= RQF_STARTED;
|
||||
return rq;
|
||||
return dd_start_request(dd, data_dir, rq);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue