blk-mq: Initialize .rq_flags in blk_mq_rq_ctx_init()
authorBart Van Assche <bart.vanassche@sandisk.com>
Tue, 20 Jun 2017 18:15:43 +0000 (11:15 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Jun 2017 01:27:14 +0000 (19:27 -0600)
commitc3a148d20affcc334348402865169a61000d3905
tree62212e8c99043deb1ab66785211ddb87408fab2d
parentc8d9cf22cf0f89d1249a57ade5a1949c62075ce6
blk-mq: Initialize .rq_flags in blk_mq_rq_ctx_init()

Initialization of blk-mq requests is a bit weird: blk_mq_rq_ctx_init()
is called after a value has been assigned to .rq_flags and .rq_flags
is initialized in __blk_mq_finish_request(). Initialize .rq_flags in
blk_mq_rq_ctx_init() instead of relying on __blk_mq_finish_request().
Moving the initialization of .rq_flags is fine because all changes
and tests of .rq_flags occur between blk_get_request() and finishing
a request.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c