OSDN Git Service

md/raid10: Use the new blk_opf_t type
authorBart Van Assche <bvanassche@acm.org>
Thu, 14 Jul 2022 18:07:01 +0000 (11:07 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Jul 2022 18:14:32 +0000 (12:14 -0600)
Improve static type checking by using the new blk_opf_t type for
variables that represent a request flags.

Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20220714180729.1065367-36-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid10.c

index 3b80120..2654595 100644 (file)
@@ -1136,8 +1136,8 @@ static void raid10_read_request(struct mddev *mddev, struct bio *bio,
 {
        struct r10conf *conf = mddev->private;
        struct bio *read_bio;
-       const int op = bio_op(bio);
-       const unsigned long do_sync = (bio->bi_opf & REQ_SYNC);
+       const enum req_op op = bio_op(bio);
+       const blk_opf_t do_sync = bio->bi_opf & REQ_SYNC;
        int max_sectors;
        struct md_rdev *rdev;
        char b[BDEVNAME_SIZE];
@@ -1230,9 +1230,9 @@ static void raid10_write_one_disk(struct mddev *mddev, struct r10bio *r10_bio,
                                  struct bio *bio, bool replacement,
                                  int n_copy)
 {
-       const int op = bio_op(bio);
-       const unsigned long do_sync = (bio->bi_opf & REQ_SYNC);
-       const unsigned long do_fua = (bio->bi_opf & REQ_FUA);
+       const enum req_op op = bio_op(bio);
+       const blk_opf_t do_sync = bio->bi_opf & REQ_SYNC;
+       const blk_opf_t do_fua = bio->bi_opf & REQ_FUA;
        unsigned long flags;
        struct blk_plug_cb *cb;
        struct raid1_plug_cb *plug = NULL;