Skip to content

Commit 9b20d24

Browse files
committed
btrfs: change return type of btrfs_csum_one_bio() 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 in btrfs_bio_csum(). Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 6f6e7e9 commit 9b20d24

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

fs/btrfs/bio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static blk_status_t btrfs_bio_csum(struct btrfs_bio *bbio)
516516
{
517517
if (bbio->bio.bi_opf & REQ_META)
518518
return btree_csum_one_bio(bbio);
519-
return btrfs_csum_one_bio(bbio);
519+
return errno_to_blk_status(btrfs_csum_one_bio(bbio));
520520
}
521521

522522
/*

fs/btrfs/file-item.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ int btrfs_lookup_csums_bitmap(struct btrfs_root *root, struct btrfs_path *path,
735735
/*
736736
* Calculate checksums of the data contained inside a bio.
737737
*/
738-
blk_status_t btrfs_csum_one_bio(struct btrfs_bio *bbio)
738+
int btrfs_csum_one_bio(struct btrfs_bio *bbio)
739739
{
740740
struct btrfs_ordered_extent *ordered = bbio->ordered;
741741
struct btrfs_inode *inode = bbio->inode;
@@ -757,7 +757,7 @@ blk_status_t btrfs_csum_one_bio(struct btrfs_bio *bbio)
757757
memalloc_nofs_restore(nofs_flag);
758758

759759
if (!sums)
760-
return BLK_STS_RESOURCE;
760+
return -ENOMEM;
761761

762762
sums->len = bio->bi_iter.bi_size;
763763
INIT_LIST_HEAD(&sums->list);

fs/btrfs/file-item.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans,
6464
int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
6565
struct btrfs_root *root,
6666
struct btrfs_ordered_sum *sums);
67-
blk_status_t btrfs_csum_one_bio(struct btrfs_bio *bbio);
67+
int btrfs_csum_one_bio(struct btrfs_bio *bbio);
6868
blk_status_t btrfs_alloc_dummy_sum(struct btrfs_bio *bbio);
6969
int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
7070
struct list_head *list, int search_commit,

0 commit comments

Comments
 (0)