Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bart Van Assche and committed by
Jens Axboe
93a358af 211ddde0

+14 -8
+14 -8
block/mq-deadline.c
··· 306 306 return time_after(start_time, latest_start); 307 307 } 308 308 309 + static struct request *dd_start_request(struct deadline_data *dd, 310 + enum dd_data_dir data_dir, 311 + struct request *rq) 312 + { 313 + u8 ioprio_class = dd_rq_ioclass(rq); 314 + enum dd_prio prio = ioprio_class_to_prio[ioprio_class]; 315 + 316 + dd->per_prio[prio].latest_pos[data_dir] = blk_rq_pos(rq); 317 + dd->per_prio[prio].stats.dispatched++; 318 + rq->rq_flags |= RQF_STARTED; 319 + return rq; 320 + } 321 + 309 322 /* 310 323 * deadline_dispatch_requests selects the best request according to 311 324 * read/write expire, fifo_batch, etc and with a start time <= @latest_start. ··· 329 316 { 330 317 struct request *rq, *next_rq; 331 318 enum dd_data_dir data_dir; 332 - enum dd_prio prio; 333 - u8 ioprio_class; 334 319 335 320 lockdep_assert_held(&dd->lock); 336 321 ··· 422 411 dd->batching++; 423 412 deadline_move_request(dd, per_prio, rq); 424 413 done: 425 - ioprio_class = dd_rq_ioclass(rq); 426 - prio = ioprio_class_to_prio[ioprio_class]; 427 - dd->per_prio[prio].latest_pos[data_dir] = blk_rq_pos(rq); 428 - dd->per_prio[prio].stats.dispatched++; 429 - rq->rq_flags |= RQF_STARTED; 430 - return rq; 414 + return dd_start_request(dd, data_dir, rq); 431 415 } 432 416 433 417 /*