Skip to contentSkip to conversation

btrfs: use BLK_STS defines where needed

PATCH In review Anand Jain 3 participants 3 messages Oct 14, 2017 – Oct 16, 2017 Btrfs file system

lore
Share & tools
lore

Anand Jain

author
#0 lore raw

PATCH 1/1 btrfs: use BLK_STS defines where needed

At few places we could use BLK_STS_OK and BLK_STS_NOSUPP.

---
 fs/btrfs/compression.c | 3 ++-
 fs/btrfs/inode.c       | 4 ++--
 fs/btrfs/volumes.c     | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)
fs/btrfs/compression.c +2 -1
index b51d23f5cafa..43d4b51556ec 100644
@@ -239,7 +239,8 @@ static void end_compressed_bio_write(struct bio *bio)
 					 cb->start,
 					 cb->start + cb->len - 1,
 					 NULL,
-					 bio->bi_status ? 0 : 1);
+					 bio->bi_status ?
+					 BLK_STS_OK : BLK_STS_NOTSUPP);
 	cb->compressed_pages[0]->mapping = NULL;
 
 	end_compressed_writeback(inode, cb);
fs/btrfs/inode.c +2 -2
index 128f3e58634f..9aa03c89ad86 100644
@@ -8360,7 +8360,7 @@ static void btrfs_endio_direct_read(struct bio *bio)
 	if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED) {
 		err = btrfs_subio_endio_read(inode, io_bio, err);
 		if (!err)
-			bio->bi_status = 0;
+			bio->bi_status = BLK_STS_OK;
 	}
 
 	unlock_extent(&BTRFS_I(inode)->io_tree, dip->logical_offset,
@@ -8478,7 +8478,7 @@ static void btrfs_end_dio_bio(struct bio *bio)
 	if (dip->errors) {
 		bio_io_error(dip->orig_bio);
 	} else {
-		dip->dio_bio->bi_status = 0;
+		dip->dio_bio->bi_status = BLK_STS_OK;
 		bio_endio(dip->orig_bio);
 	}
 out:
fs/btrfs/volumes.c +1 -1
index a61405c2cd31..15e017af756c 100644
@@ -6020,7 +6020,7 @@ static void btrfs_end_bio(struct bio *bio)
 			 * this bio is actually up to date, we didn't
 			 * go over the max number of errors
 			 */
-			bio->bi_status = 0;
+			bio->bi_status = BLK_STS_OK;
 		}
 
 		btrfs_end_bbio(bbio, bio);
Signature · 1 line
2.13.1
Reviewed-by on v1 1/1
#1 lore raw

At Sat, 14 Oct 2017 08:35:56 +0800,

Quoted 4 lines · Anand Jain

At few places we could use BLK_STS_OK and BLK_STS_NOSUPP.

Quoted 62 lines
---
 fs/btrfs/compression.c | 3 ++-
 fs/btrfs/inode.c       | 4 ++--
 fs/btrfs/volumes.c     | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)
fs/btrfs/compression.c +2 -1
index b51d23f5cafa..43d4b51556ec 100644
@@ -239,7 +239,8 @@ static void end_compressed_bio_write(struct bio *bio)
 					 cb->start,
 					 cb->start + cb->len - 1,
 					 NULL,
-					 bio->bi_status ? 0 : 1);
+					 bio->bi_status ?
+					 BLK_STS_OK : BLK_STS_NOTSUPP);
 	cb->compressed_pages[0]->mapping = NULL;
 
 	end_compressed_writeback(inode, cb);
fs/btrfs/inode.c +2 -2
index 128f3e58634f..9aa03c89ad86 100644
@@ -8360,7 +8360,7 @@ static void btrfs_endio_direct_read(struct bio *bio)
 	if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED) {
 		err = btrfs_subio_endio_read(inode, io_bio, err);
 		if (!err)
-			bio->bi_status = 0;
+			bio->bi_status = BLK_STS_OK;
 	}
 
 	unlock_extent(&BTRFS_I(inode)->io_tree, dip->logical_offset,
@@ -8478,7 +8478,7 @@ static void btrfs_end_dio_bio(struct bio *bio)
 	if (dip->errors) {
 		bio_io_error(dip->orig_bio);
 	} else {
-		dip->dio_bio->bi_status = 0;
+		dip->dio_bio->bi_status = BLK_STS_OK;
 		bio_endio(dip->orig_bio);
 	}
 out:
fs/btrfs/volumes.c +1 -1
index a61405c2cd31..15e017af756c 100644
@@ -6020,7 +6020,7 @@ static void btrfs_end_bio(struct bio *bio)
 			 * this bio is actually up to date, we didn't
 			 * go over the max number of errors
 			 */
-			bio->bi_status = 0;
+			bio->bi_status = BLK_STS_OK;
 		}
 
 		btrfs_end_bbio(bbio, bio);
Signature · 6 lines
2.13.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to Anand Jain
Quoted 28 lines · Anand Jain

At few places we could use BLK_STS_OK and BLK_STS_NOSUPP.

---
 fs/btrfs/compression.c | 3 ++-
 fs/btrfs/inode.c       | 4 ++--
 fs/btrfs/volumes.c     | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)
fs/btrfs/compression.c +2 -1
index b51d23f5cafa..43d4b51556ec 100644
@@ -239,7 +239,8 @@ static void end_compressed_bio_write(struct bio *bio)
 					 cb->start,
 					 cb->start + cb->len - 1,
 					 NULL,
-					 bio->bi_status ? 0 : 1);
+					 bio->bi_status ?
+					 BLK_STS_OK : BLK_STS_NOTSUPP);
 	cb->compressed_pages[0]->mapping = NULL;
 
 	end_compressed_writeback(inode, cb);
fs/btrfs/inode.c +0 -0
index 128f3e58634f..9aa03c89ad86 100644

fs/btrfs/inode.c static void btrfs_endio_direct_read(struct bio *bio) · line 8363

Quoted 5 lines
fs/btrfs/inode.c +1 -1
@@ -8360,7 +8360,7 @@ static void btrfs_endio_direct_read(struct bio *bio)
 	if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED) {
 		err = btrfs_subio_endio_read(inode, io_bio, err);
 		if (!err)
-			bio->bi_status = 0;
+			bio->bi_status = BLK_STS_OK;

This hunk does not apply to current devel queue (ie. something close to for-next), dropped and applied.