Message ID | 20230216163437.2370948-8-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/12] btrfs: remove the force_bio_submit to submit_extent_page | expand |
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
On 2023/2/17 00:34, Christoph Hellwig wrote: > Rename this_bio_flag to compress_type to match the surrounding code > and better document the intent. Also use the proper enum type instead > of unsigned long. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Qu Wenruo <wqu@suse.com> Thanks, Qu > --- > fs/btrfs/extent_io.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c > index 4fe128d2895f88..24a1e988dd0fab 100644 > --- a/fs/btrfs/extent_io.c > +++ b/fs/btrfs/extent_io.c > @@ -1213,7 +1213,7 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached, > bio_ctrl->end_io_func = end_bio_extent_readpage; > begin_page_read(fs_info, page); > while (cur <= end) { > - unsigned long this_bio_flag = 0; > + enum btrfs_compression_type compress_type = BTRFS_COMPRESS_NONE; > bool force_bio_submit = false; > u64 disk_bytenr; > > @@ -1238,11 +1238,11 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached, > BUG_ON(end < cur); > > if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) > - this_bio_flag = em->compress_type; > + compress_type = em->compress_type; > > iosize = min(extent_map_end(em) - cur, end - cur + 1); > iosize = ALIGN(iosize, blocksize); > - if (this_bio_flag != BTRFS_COMPRESS_NONE) > + if (compress_type != BTRFS_COMPRESS_NONE) > disk_bytenr = em->block_start; > else > disk_bytenr = em->block_start + extent_offset; > @@ -1314,13 +1314,13 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached, > continue; > } > > - if (bio_ctrl->compress_type != this_bio_flag) > + if (bio_ctrl->compress_type != compress_type) > submit_one_bio(bio_ctrl); > > if (force_bio_submit) > submit_one_bio(bio_ctrl); > ret = submit_extent_page(bio_ctrl, disk_bytenr, page, iosize, > - pg_offset, this_bio_flag); > + pg_offset, compress_type); > if (ret) { > /* > * We have to unlock the remaining range, or the page
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 4fe128d2895f88..24a1e988dd0fab 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1213,7 +1213,7 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached, bio_ctrl->end_io_func = end_bio_extent_readpage; begin_page_read(fs_info, page); while (cur <= end) { - unsigned long this_bio_flag = 0; + enum btrfs_compression_type compress_type = BTRFS_COMPRESS_NONE; bool force_bio_submit = false; u64 disk_bytenr; @@ -1238,11 +1238,11 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached, BUG_ON(end < cur); if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) - this_bio_flag = em->compress_type; + compress_type = em->compress_type; iosize = min(extent_map_end(em) - cur, end - cur + 1); iosize = ALIGN(iosize, blocksize); - if (this_bio_flag != BTRFS_COMPRESS_NONE) + if (compress_type != BTRFS_COMPRESS_NONE) disk_bytenr = em->block_start; else disk_bytenr = em->block_start + extent_offset; @@ -1314,13 +1314,13 @@ static int btrfs_do_readpage(struct page *page, struct extent_map **em_cached, continue; } - if (bio_ctrl->compress_type != this_bio_flag) + if (bio_ctrl->compress_type != compress_type) submit_one_bio(bio_ctrl); if (force_bio_submit) submit_one_bio(bio_ctrl); ret = submit_extent_page(bio_ctrl, disk_bytenr, page, iosize, - pg_offset, this_bio_flag); + pg_offset, compress_type); if (ret) { /* * We have to unlock the remaining range, or the page
Rename this_bio_flag to compress_type to match the surrounding code and better document the intent. Also use the proper enum type instead of unsigned long. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/btrfs/extent_io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)