btrfs: remove the return value from extent_write_locked_range

The return value from extent_write_locked_range is ignored, and that's
fine because the error reporting happens through the mapping and
ordered_extent.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Christoph Hellwig 2023-06-28 17:31:29 +02:00 committed by David Sterba
parent ff20d6a4a9
commit 0835d1e66e
2 changed files with 5 additions and 12 deletions

View File

@ -2180,11 +2180,10 @@ retry:
* already been ran (aka, ordered extent inserted) and all pages are still * already been ran (aka, ordered extent inserted) and all pages are still
* locked. * locked.
*/ */
int extent_write_locked_range(struct inode *inode, u64 start, u64 end, void extent_write_locked_range(struct inode *inode, u64 start, u64 end,
struct writeback_control *wbc) struct writeback_control *wbc)
{ {
bool found_error = false; bool found_error = false;
int first_error = 0;
int ret = 0; int ret = 0;
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
@ -2234,20 +2233,14 @@ int extent_write_locked_range(struct inode *inode, u64 start, u64 end,
mapping_set_error(page->mapping, ret); mapping_set_error(page->mapping, ret);
} }
btrfs_page_unlock_writer(fs_info, page, cur, cur_len); btrfs_page_unlock_writer(fs_info, page, cur, cur_len);
if (ret < 0) { if (ret < 0)
found_error = true; found_error = true;
first_error = ret;
}
next_page: next_page:
put_page(page); put_page(page);
cur = cur_end + 1; cur = cur_end + 1;
} }
submit_write_bio(&bio_ctrl, found_error ? ret : 0); submit_write_bio(&bio_ctrl, found_error ? ret : 0);
if (found_error)
return first_error;
return ret;
} }
int extent_writepages(struct address_space *mapping, int extent_writepages(struct address_space *mapping,

View File

@ -177,8 +177,8 @@ int try_release_extent_mapping(struct page *page, gfp_t mask);
int try_release_extent_buffer(struct page *page); int try_release_extent_buffer(struct page *page);
int btrfs_read_folio(struct file *file, struct folio *folio); int btrfs_read_folio(struct file *file, struct folio *folio);
int extent_write_locked_range(struct inode *inode, u64 start, u64 end, void extent_write_locked_range(struct inode *inode, u64 start, u64 end,
struct writeback_control *wbc); struct writeback_control *wbc);
int extent_writepages(struct address_space *mapping, int extent_writepages(struct address_space *mapping,
struct writeback_control *wbc); struct writeback_control *wbc);
int btree_write_cache_pages(struct address_space *mapping, int btree_write_cache_pages(struct address_space *mapping,