FROMGIT: block/mq-deadline: Add several comments
Make the code easier to read by adding more comments. Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: Ming Lei <ming.lei@redhat.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> BUG: 187357408 Change-Id: If62eb600614d2883d72ee3bd7e7859ae66b24512 (cherry picked from commit 16c3afdb127bbff7d3552e076e568281765674b7 git://git.kernel.dk/linux-block/ for-5.14/block) Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
parent
46d6ae07a7
commit
dfc5e14a36
@ -137,6 +137,9 @@ static void dd_request_merged(struct request_queue *q, struct request *req,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback function that is invoked after @next has been merged into @req.
|
||||
*/
|
||||
static void dd_merged_requests(struct request_queue *q, struct request *req,
|
||||
struct request *next)
|
||||
{
|
||||
@ -373,6 +376,8 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd)
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from blk_mq_run_hw_queue() -> __blk_mq_sched_dispatch_requests().
|
||||
*
|
||||
* One confusing aspect here is that we get called for a specific
|
||||
* hardware queue, but we may return a request that is for a
|
||||
* different hardware queue. This is because mq-deadline has shared
|
||||
@ -436,6 +441,10 @@ static int dd_init_queue(struct request_queue *q, struct elevator_type *e)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to merge @bio into an existing request. If @bio has been merged into
|
||||
* an existing request, store the pointer to that request into *@rq.
|
||||
*/
|
||||
static int dd_request_merge(struct request_queue *q, struct request **rq,
|
||||
struct bio *bio)
|
||||
{
|
||||
@ -459,6 +468,10 @@ static int dd_request_merge(struct request_queue *q, struct request **rq,
|
||||
return ELEVATOR_NO_MERGE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to merge a bio into an existing request. This function is called
|
||||
* before @bio is associated with a request.
|
||||
*/
|
||||
static bool dd_bio_merge(struct request_queue *q, struct bio *bio,
|
||||
unsigned int nr_segs)
|
||||
{
|
||||
@ -516,6 +529,9 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from blk_mq_sched_insert_request() or blk_mq_sched_insert_requests().
|
||||
*/
|
||||
static void dd_insert_requests(struct blk_mq_hw_ctx *hctx,
|
||||
struct list_head *list, bool at_head)
|
||||
{
|
||||
@ -542,6 +558,8 @@ static void dd_prepare_request(struct request *rq)
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback from inside blk_mq_free_request().
|
||||
*
|
||||
* For zoned block devices, write unlock the target zone of
|
||||
* completed write requests. Do this while holding the zone lock
|
||||
* spinlock so that the zone is never unlocked while deadline_fifo_request()
|
||||
|
Loading…
Reference in New Issue
Block a user