]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: Factor out helper from raid5_make_request() loop
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 16 Jun 2022 19:19:36 +0000 (13:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:14:42 +0000 (17:14 -0600)
commita263444c3e3e1dabf9589471e03eac35580ddf33
tree9008ab7ce0afee8cae1b2f20a9fb472ece18a82f
parent20702df7d2539ddd94b5c7641f0a66c06f5f1cb9
md/raid5: Factor out helper from raid5_make_request() loop

Factor out the inner loop of raid5_make_request() into it's own helper
called make_stripe_request().

The helper returns a number of statuses: SUCCESS, RETRY,
SCHEDULE_AND_RETRY and FAIL. This makes the code a bit easier to
understand and allows the SCHEDULE_AND_RETRY path to be made common.

A context structure is added to contain do_flush. It will be used
more in subsequent patches for state that needs to be kept
outside the loop.

No functional changes intended. This will be cleaned up further in
subsequent patches to untangle the gen_lock and do_prepare logic
further.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid5.c