summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 64fcb31d7163..5b1c7090e546 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -160,7 +160,7 @@ static void btrfs_io_bio_endio_readpage(struct btrfs_io_bio *bio, int err)
160 kfree(bio->csum_allocated); 160 kfree(bio->csum_allocated);
161} 161}
162 162
163static int __btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio, 163static blk_status_t __btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio,
164 u64 logical_offset, u32 *dst, int dio) 164 u64 logical_offset, u32 *dst, int dio)
165{ 165{
166 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); 166 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
@@ -182,7 +182,7 @@ static int __btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio,
182 182
183 path = btrfs_alloc_path(); 183 path = btrfs_alloc_path();
184 if (!path) 184 if (!path)
185 return -ENOMEM; 185 return BLK_STS_RESOURCE;
186 186
187 nblocks = bio->bi_iter.bi_size >> inode->i_sb->s_blocksize_bits; 187 nblocks = bio->bi_iter.bi_size >> inode->i_sb->s_blocksize_bits;
188 if (!dst) { 188 if (!dst) {
@@ -191,7 +191,7 @@ static int __btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio,
191 csum_size, GFP_NOFS); 191 csum_size, GFP_NOFS);
192 if (!btrfs_bio->csum_allocated) { 192 if (!btrfs_bio->csum_allocated) {
193 btrfs_free_path(path); 193 btrfs_free_path(path);
194 return -ENOMEM; 194 return BLK_STS_RESOURCE;
195 } 195 }
196 btrfs_bio->csum = btrfs_bio->csum_allocated; 196 btrfs_bio->csum = btrfs_bio->csum_allocated;
197 btrfs_bio->end_io = btrfs_io_bio_endio_readpage; 197 btrfs_bio->end_io = btrfs_io_bio_endio_readpage;
@@ -303,12 +303,12 @@ next:
303 return 0; 303 return 0;
304} 304}
305 305
306int btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio, u32 *dst) 306blk_status_t btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio, u32 *dst)
307{ 307{
308 return __btrfs_lookup_bio_sums(inode, bio, 0, dst, 0); 308 return __btrfs_lookup_bio_sums(inode, bio, 0, dst, 0);
309} 309}
310 310
311int btrfs_lookup_bio_sums_dio(struct inode *inode, struct bio *bio, u64 offset) 311blk_status_t btrfs_lookup_bio_sums_dio(struct inode *inode, struct bio *bio, u64 offset)
312{ 312{
313 return __btrfs_lookup_bio_sums(inode, bio, offset, NULL, 1); 313 return __btrfs_lookup_bio_sums(inode, bio, offset, NULL, 1);
314} 314}
@@ -433,7 +433,7 @@ fail:
433 return ret; 433 return ret;
434} 434}
435 435
436int btrfs_csum_one_bio(struct inode *inode, struct bio *bio, 436blk_status_t btrfs_csum_one_bio(struct inode *inode, struct bio *bio,
437 u64 file_start, int contig) 437 u64 file_start, int contig)
438{ 438{
439 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); 439 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
@@ -452,7 +452,7 @@ int btrfs_csum_one_bio(struct inode *inode, struct bio *bio,
452 sums = kzalloc(btrfs_ordered_sum_size(fs_info, bio->bi_iter.bi_size), 452 sums = kzalloc(btrfs_ordered_sum_size(fs_info, bio->bi_iter.bi_size),
453 GFP_NOFS); 453 GFP_NOFS);
454 if (!sums) 454 if (!sums)
455 return -ENOMEM; 455 return BLK_STS_RESOURCE;
456 456
457 sums->len = bio->bi_iter.bi_size; 457 sums->len = bio->bi_iter.bi_size;
458 INIT_LIST_HEAD(&sums->list); 458 INIT_LIST_HEAD(&sums->list);