Skip to content

Commit 64c1319

Browse files
committed
btrfs: change return type of btrfs_bio_csum() to int
The type blk_status_t is from block layer and not related to checksums in our context. Use int internally and do the conversions to blk_status_t as needed. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent a24d185 commit 64c1319

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

fs/btrfs/bio.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,11 @@ static void btrfs_submit_bio(struct bio *bio, struct btrfs_io_context *bioc,
512512
}
513513
}
514514

515-
static blk_status_t btrfs_bio_csum(struct btrfs_bio *bbio)
515+
static int btrfs_bio_csum(struct btrfs_bio *bbio)
516516
{
517517
if (bbio->bio.bi_opf & REQ_META)
518-
return errno_to_blk_status(btree_csum_one_bio(bbio));
519-
return errno_to_blk_status(btrfs_csum_one_bio(bbio));
518+
return btree_csum_one_bio(bbio);
519+
return btrfs_csum_one_bio(bbio);
520520
}
521521

522522
/*
@@ -543,11 +543,11 @@ static void run_one_async_start(struct btrfs_work *work)
543543
{
544544
struct async_submit_bio *async =
545545
container_of(work, struct async_submit_bio, work);
546-
blk_status_t ret;
546+
int ret;
547547

548548
ret = btrfs_bio_csum(async->bbio);
549549
if (ret)
550-
async->bbio->bio.bi_status = ret;
550+
async->bbio->bio.bi_status = errno_to_blk_status(ret);
551551
}
552552

553553
/*
@@ -748,7 +748,8 @@ static bool btrfs_submit_chunk(struct btrfs_bio *bbio, int mirror_num)
748748
btrfs_wq_submit_bio(bbio, bioc, &smap, mirror_num))
749749
goto done;
750750

751-
ret = btrfs_bio_csum(bbio);
751+
error = btrfs_bio_csum(bbio);
752+
ret = errno_to_blk_status(error);
752753
if (ret)
753754
goto fail;
754755
} else if (use_append ||

0 commit comments

Comments
 (0)