Skip to content

Commit 7dab245

Browse files
bvanasscheliu-song-6
authored andcommitted
md/raid1: Use blk_opf_t for read and write operations
Use the type blk_opf_t for read and write operations instead of int. This patch does not affect the generated code but fixes the following sparse warning: drivers/md/raid1.c:1993:60: sparse: sparse: incorrect type in argument 5 (different base types) expected restricted blk_opf_t [usertype] opf got int rw Cc: Song Liu <[email protected]> Cc: Jens Axboe <[email protected]> Fixes: 3c5e514 ("md/raid1: Use the new blk_opf_t type") Cc: [email protected] # v6.0+ Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f9cfe7e commit 7dab245

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/md/raid1.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,12 +1968,12 @@ static void end_sync_write(struct bio *bio)
19681968
}
19691969

19701970
static int r1_sync_page_io(struct md_rdev *rdev, sector_t sector,
1971-
int sectors, struct page *page, int rw)
1971+
int sectors, struct page *page, blk_opf_t rw)
19721972
{
19731973
if (sync_page_io(rdev, sector, sectors << 9, page, rw, false))
19741974
/* success */
19751975
return 1;
1976-
if (rw == WRITE) {
1976+
if (rw == REQ_OP_WRITE) {
19771977
set_bit(WriteErrorSeen, &rdev->flags);
19781978
if (!test_and_set_bit(WantReplacement,
19791979
&rdev->flags))
@@ -2090,7 +2090,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
20902090
rdev = conf->mirrors[d].rdev;
20912091
if (r1_sync_page_io(rdev, sect, s,
20922092
pages[idx],
2093-
WRITE) == 0) {
2093+
REQ_OP_WRITE) == 0) {
20942094
r1_bio->bios[d]->bi_end_io = NULL;
20952095
rdev_dec_pending(rdev, mddev);
20962096
}
@@ -2105,7 +2105,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
21052105
rdev = conf->mirrors[d].rdev;
21062106
if (r1_sync_page_io(rdev, sect, s,
21072107
pages[idx],
2108-
READ) != 0)
2108+
REQ_OP_READ) != 0)
21092109
atomic_add(s, &rdev->corrected_errors);
21102110
}
21112111
sectors -= s;
@@ -2321,7 +2321,7 @@ static void fix_read_error(struct r1conf *conf, struct r1bio *r1_bio)
23212321
!test_bit(Faulty, &rdev->flags)) {
23222322
atomic_inc(&rdev->nr_pending);
23232323
r1_sync_page_io(rdev, sect, s,
2324-
conf->tmppage, WRITE);
2324+
conf->tmppage, REQ_OP_WRITE);
23252325
rdev_dec_pending(rdev, mddev);
23262326
}
23272327
}
@@ -2335,7 +2335,7 @@ static void fix_read_error(struct r1conf *conf, struct r1bio *r1_bio)
23352335
!test_bit(Faulty, &rdev->flags)) {
23362336
atomic_inc(&rdev->nr_pending);
23372337
if (r1_sync_page_io(rdev, sect, s,
2338-
conf->tmppage, READ)) {
2338+
conf->tmppage, REQ_OP_READ)) {
23392339
atomic_add(s, &rdev->corrected_errors);
23402340
pr_info("md/raid1:%s: read error corrected (%d sectors at %llu on %pg)\n",
23412341
mdname(mddev), s,

0 commit comments

Comments
 (0)