linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xianting Tian <xianting_tian@126.com>
To: colyli@suse.de, kent.overstreet@gmail.com, agk@redhat.com,
	snitzer@redhat.com, dm-devel@redhat.com, song@kernel.org
Cc: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-raid@vger.kernel.org,
	Xianting Tian <xianting.tian@linux.alibaba.com>
Subject: [PATCH] md: use BLK_STS_OK instead of hardcode
Date: Tue, 22 Jun 2021 11:54:01 -0400	[thread overview]
Message-ID: <1624377241-8642-1-git-send-email-xianting_tian@126.com> (raw)

When setting io status, sometimes it uses BLK_STS_*, sometimes,
it uses hardcode 0.
Use the macro to replace hardcode in multiple places.

Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
---
 drivers/md/bcache/request.c  | 2 +-
 drivers/md/dm-clone-target.c | 2 +-
 drivers/md/dm-integrity.c    | 2 +-
 drivers/md/dm-mpath.c        | 2 +-
 drivers/md/dm-raid1.c        | 2 +-
 drivers/md/dm.c              | 2 +-
 drivers/md/raid1.c           | 4 ++--
 drivers/md/raid10.c          | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 6d1de88..73ba5a6 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -790,7 +790,7 @@ static void cached_dev_read_error(struct closure *cl)
 		/* Retry from the backing device: */
 		trace_bcache_read_retry(s->orig_bio);
 
-		s->iop.status = 0;
+		s->iop.status = BLK_STS_OK;
 		do_bio_hook(s, s->orig_bio, backing_request_endio);
 
 		/* XXX: invalidate cache */
diff --git a/drivers/md/dm-clone-target.c b/drivers/md/dm-clone-target.c
index a90bdf9..d3f1c67 100644
--- a/drivers/md/dm-clone-target.c
+++ b/drivers/md/dm-clone-target.c
@@ -684,7 +684,7 @@ static void hydration_init(struct dm_clone_region_hydration *hd, unsigned long r
 	hd->region_nr = region_nr;
 	hd->overwrite_bio = NULL;
 	bio_list_init(&hd->deferred_bios);
-	hd->status = 0;
+	hd->status = BLK_STS_OK;
 
 	INIT_LIST_HEAD(&hd->list);
 	INIT_HLIST_NODE(&hd->h);
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index 20f2510..179e126 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -1848,7 +1848,7 @@ static int dm_integrity_map(struct dm_target *ti, struct bio *bio)
 	sector_t area, offset;
 
 	dio->ic = ic;
-	dio->bi_status = 0;
+	dio->bi_status = BLK_STS_OK;
 	dio->op = bio_op(bio);
 
 	if (unlikely(dio->op == REQ_OP_DISCARD)) {
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index bced42f..50f5945 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -648,7 +648,7 @@ static int __multipath_map_bio(struct multipath *m, struct bio *bio,
 
 	mpio->pgpath = pgpath;
 
-	bio->bi_status = 0;
+	bio->bi_status = BLK_STS_OK;
 	bio_set_dev(bio, pgpath->path.dev->bdev);
 	bio->bi_opf |= REQ_FAILFAST_TRANSPORT;
 
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index b0a82f2..bf4d875 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -1283,7 +1283,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
 
 			dm_bio_restore(bd, bio);
 			bio_record->details.bi_bdev = NULL;
-			bio->bi_status = 0;
+			bio->bi_status = BLK_STS_OK;
 
 			queue_bio(ms, bio, rw);
 			return DM_ENDIO_INCOMPLETE;
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index ca2aedd..3d2fe23 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -649,7 +649,7 @@ static struct dm_io *alloc_io(struct mapped_device *md, struct bio *bio)
 
 	io = container_of(tio, struct dm_io, tio);
 	io->magic = DM_IO_MAGIC;
-	io->status = 0;
+	io->status = BLK_STS_OK;
 	atomic_set(&io->io_count, 1);
 	io->orig_bio = bio;
 	io->md = md;
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index ced076b..418d789 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2081,7 +2081,7 @@ static int fix_sync_read_error(struct r1bio *r1_bio)
 		idx ++;
 	}
 	set_bit(R1BIO_Uptodate, &r1_bio->state);
-	bio->bi_status = 0;
+	bio->bi_status = BLK_STS_OK;
 	return 1;
 }
 
@@ -2144,7 +2144,7 @@ static void process_checks(struct r1bio *r1_bio)
 		if (sbio->bi_end_io != end_sync_read)
 			continue;
 		/* Now we can 'fixup' the error value */
-		sbio->bi_status = 0;
+		sbio->bi_status = BLK_STS_OK;
 
 		bio_for_each_segment_all(bi, sbio, iter_all)
 			page_len[j++] = bi->bv_len;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 13f5e6b..c9a146b 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3797,7 +3797,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
 
 		if (bio->bi_end_io == end_sync_read) {
 			md_sync_acct_bio(bio, nr_sectors);
-			bio->bi_status = 0;
+			bio->bi_status = BLK_STS_OK;
 			submit_bio_noacct(bio);
 		}
 	}
-- 
1.8.3.1


             reply	other threads:[~2021-06-22 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 15:54 Xianting Tian [this message]
2021-06-22 16:10 ` [PATCH] md: use BLK_STS_OK instead of hardcode Coly Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1624377241-8642-1-git-send-email-xianting_tian@126.com \
    --to=xianting_tian@126.com \
    --cc=agk@redhat.com \
    --cc=colyli@suse.de \
    --cc=dm-devel@redhat.com \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=snitzer@redhat.com \
    --cc=song@kernel.org \
    --cc=xianting.tian@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).