summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2023-01-21 07:50:24 +0100
committerDavid Sterba <dsterba@suse.com>2023-02-15 19:38:52 +0100
commita34e4c3f884cc592f105d214d21baee9f9c6bae8 (patch)
treeeada6d05256a50cb40cf15819d7926420682a454 /fs
parent30493ff49f81d0ba42286b72498272db1a1ccae6 (diff)
downloadlinux-stable-a34e4c3f884cc592f105d214d21baee9f9c6bae8.tar.gz
linux-stable-a34e4c3f884cc592f105d214d21baee9f9c6bae8.tar.bz2
linux-stable-a34e4c3f884cc592f105d214d21baee9f9c6bae8.zip
btrfs: remove stripe boundary calculation for encoded I/O
Stop looking at the stripe boundary in btrfs_encoded_read_regular_fill_pages() now that btrfs_submit_bio can split bios. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/inode.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 4ac9b34ad377..0fd26719d321 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9971,7 +9971,6 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
u64 file_offset, u64 disk_bytenr,
u64 disk_io_size, struct page **pages)
{
- struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct btrfs_encoded_read_private priv = {
.inode = inode,
.file_offset = file_offset,
@@ -9979,33 +9978,13 @@ int btrfs_encoded_read_regular_fill_pages(struct btrfs_inode *inode,
};
unsigned long i = 0;
u64 cur = 0;
- int ret;
init_waitqueue_head(&priv.wait);
- /*
- * Submit bios for the extent, splitting due to bio or stripe limits as
- * necessary.
- */
+ /* Submit bios for the extent, splitting due to bio limits as necessary. */
while (cur < disk_io_size) {
- struct extent_map *em;
- struct btrfs_io_geometry geom;
struct bio *bio = NULL;
- u64 remaining;
+ u64 remaining = disk_io_size - cur;
- em = btrfs_get_chunk_map(fs_info, disk_bytenr + cur,
- disk_io_size - cur);
- if (IS_ERR(em)) {
- ret = PTR_ERR(em);
- } else {
- ret = btrfs_get_io_geometry(fs_info, em, BTRFS_MAP_READ,
- disk_bytenr + cur, &geom);
- free_extent_map(em);
- }
- if (ret) {
- WRITE_ONCE(priv.status, errno_to_blk_status(ret));
- break;
- }
- remaining = min(geom.len, disk_io_size - cur);
while (bio || remaining) {
size_t bytes = min_t(u64, remaining, PAGE_SIZE);