Message ID | 69c652507c19ec6bff940dc1da1fe2b847cf9d24.1704679242.git.wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: remove unused variable bio_offset from end_bbio_data_read() | expand |
looks good.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thx, Anand
On Mon, Jan 08, 2024 at 12:30:44PM +1030, Qu Wenruo wrote: > The variable @bio_offset is introduced in commit 7ffd27e378d2 ("btrfs: > pass bio_offset to check_data_csum() directly"), when we are still using > the same endio function for both data and metadata. > > Later we have several changes to data and metadata endio functions: > > - Data verification is handled by btrfs bio layer > > - Split data and metadata endio paths > > Now for data path we no longer do any verification in > end_bbio_data_read(), as the verification is handled by btrfs bio layer > already. > > Thus there is no need for such bio_offset variable. > > Signed-off-by: Qu Wenruo <wqu@suse.com> Added to misc-next, thanks.
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 635d3ae32d08..22946e849d28 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -596,11 +596,6 @@ static void end_bbio_data_read(struct btrfs_bio *bbio) struct bio *bio = &bbio->bio; struct processed_extent processed = { 0 }; struct folio_iter fi; - /* - * The offset to the beginning of a bio, since one bio can never be - * larger than UINT_MAX, u32 here is enough. - */ - u32 bio_offset = 0; ASSERT(!bio_flagged(bio, BIO_CLONED)); bio_for_each_folio_all(fi, &bbio->bio) { @@ -667,10 +662,6 @@ static void end_bbio_data_read(struct btrfs_bio *bbio) end_page_read(folio_page(folio, 0), uptodate, start, len); endio_readpage_release_extent(&processed, BTRFS_I(inode), start, end, uptodate); - - ASSERT(bio_offset + len > bio_offset); - bio_offset += len; - } /* Release the last extent */ endio_readpage_release_extent(&processed, NULL, 0, 0, false);
The variable @bio_offset is introduced in commit 7ffd27e378d2 ("btrfs: pass bio_offset to check_data_csum() directly"), when we are still using the same endio function for both data and metadata. Later we have several changes to data and metadata endio functions: - Data verification is handled by btrfs bio layer - Split data and metadata endio paths Now for data path we no longer do any verification in end_bbio_data_read(), as the verification is handled by btrfs bio layer already. Thus there is no need for such bio_offset variable. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/extent_io.c | 9 --------- 1 file changed, 9 deletions(-)