btrfs: use BLK_STS defines where needed
authorAnand Jain <anand.jain@oracle.com>
Sat, 14 Oct 2017 00:35:56 +0000 (08:35 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 30 Oct 2017 11:28:01 +0000 (12:28 +0100)
At few places we could use BLK_STS_OK and BLK_STS_NOSUPP.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Satoru Taekeuchi <satoru.takeuchi@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ dropped first hunk btrfs_endio_direct_read ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/inode.c
fs/btrfs/volumes.c

index 280384bf34f13b20b7a0817a36fe49a53d618285..8bdd3dc6c4dc4f43f0f6895b19c8e4e65d33dc85 100644 (file)
@@ -255,7 +255,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);
index a11f87fa79d089dfc19de08ecaf2af62f432e567..f2787cab6f3b907d9d95f035de01ffcf1dd9faea 100644 (file)
@@ -8485,7 +8485,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:
index 4931b2df4043c9871df079b87fc85c1789f82967..56ed01f8d4df9cf1428402250d13410995d207a3 100644 (file)
@@ -6029,7 +6029,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);