Skip to content

Commit df6b0e2

Browse files
lsgunthaxboe
authored andcommitted
md/raid5: Move stripe_request_ctx up
Move stripe_request_ctx up. No functional changes intended. This will be necessary in the next patch to release the batch_last in the context before sleeping. Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Song Liu <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 9734fe7 commit df6b0e2

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

drivers/md/raid5.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,33 @@ static bool has_failed(struct r5conf *conf)
755755
return degraded > conf->max_degraded;
756756
}
757757

758+
enum stripe_result {
759+
STRIPE_SUCCESS = 0,
760+
STRIPE_RETRY,
761+
STRIPE_SCHEDULE_AND_RETRY,
762+
STRIPE_FAIL,
763+
};
764+
765+
struct stripe_request_ctx {
766+
/* a reference to the last stripe_head for batching */
767+
struct stripe_head *batch_last;
768+
769+
/* first sector in the request */
770+
sector_t first_sector;
771+
772+
/* last sector in the request */
773+
sector_t last_sector;
774+
775+
/*
776+
* bitmap to track stripe sectors that have been added to stripes
777+
* add one to account for unaligned requests
778+
*/
779+
DECLARE_BITMAP(sectors_to_do, RAID5_MAX_REQ_STRIPES + 1);
780+
781+
/* the request had REQ_PREFLUSH, cleared after the first stripe_head */
782+
bool do_flush;
783+
};
784+
758785
/*
759786
* Block until another thread clears R5_INACTIVE_BLOCKED or
760787
* there are fewer than 3/4 the maximum number of active stripes
@@ -5874,33 +5901,6 @@ static bool stripe_ahead_of_reshape(struct mddev *mddev, struct r5conf *conf,
58745901
return ret;
58755902
}
58765903

5877-
enum stripe_result {
5878-
STRIPE_SUCCESS = 0,
5879-
STRIPE_RETRY,
5880-
STRIPE_SCHEDULE_AND_RETRY,
5881-
STRIPE_FAIL,
5882-
};
5883-
5884-
struct stripe_request_ctx {
5885-
/* a reference to the last stripe_head for batching */
5886-
struct stripe_head *batch_last;
5887-
5888-
/* first sector in the request */
5889-
sector_t first_sector;
5890-
5891-
/* last sector in the request */
5892-
sector_t last_sector;
5893-
5894-
/*
5895-
* bitmap to track stripe sectors that have been added to stripes
5896-
* add one to account for unaligned requests
5897-
*/
5898-
DECLARE_BITMAP(sectors_to_do, RAID5_MAX_REQ_STRIPES + 1);
5899-
5900-
/* the request had REQ_PREFLUSH, cleared after the first stripe_head */
5901-
bool do_flush;
5902-
};
5903-
59045904
static int add_all_stripe_bios(struct r5conf *conf,
59055905
struct stripe_request_ctx *ctx, struct stripe_head *sh,
59065906
struct bio *bi, int forwrite, int previous)

0 commit comments

Comments
 (0)