diff options
| author | Qu Wenruo <wqu@suse.com> | 2026-03-03 11:15:10 +0300 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-04-07 19:56:00 +0300 |
| commit | 9d7db41000570e7a6bb2c7a16811532dae2ef986 (patch) | |
| tree | b980c8de555179736498e1636f1f830fc634db91 | |
| parent | 99fe7e57d3e4e29a37fc2b2f434716344aa3498b (diff) | |
| download | linux-9d7db41000570e7a6bb2c7a16811532dae2ef986.tar.xz | |
btrfs: move the mapping_set_error() out of the loop in end_bbio_data_write()
Previously we have to call mapping_set_error() inside the
for_each_folio_all() loop, because we do not have a better way to grab
an inode, other than through folio->mapping.
But nowadays every btrfs_bio has its inode member populated, thus we can
easily grab the inode and its i_mapping easily, without the help from a
folio.
Now we can move that mapping_set_error() out of the loop, and use
bbio->inode to grab the i_mapping.
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
| -rw-r--r-- | fs/btrfs/extent_io.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index c7309e8bcc53..9648fbd20137 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -530,14 +530,14 @@ static void end_bbio_data_write(struct btrfs_bio *bbio) u32 len = fi.length; bio_size += len; - if (error) - mapping_set_error(folio->mapping, error); - ASSERT(btrfs_folio_test_ordered(fs_info, folio, start, len)); btrfs_folio_clear_ordered(fs_info, folio, start, len); btrfs_folio_clear_writeback(fs_info, folio, start, len); } + if (error) + mapping_set_error(bbio->inode->vfs_inode.i_mapping, error); + btrfs_finish_ordered_extent(bbio->ordered, bbio->file_offset, bio_size, !error); bio_put(bio); } |
