]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: move the mapping_set_error() out of the loop in end_bbio_data_write()
authorQu Wenruo <wqu@suse.com>
Tue, 3 Mar 2026 08:15:10 +0000 (18:45 +1030)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:56:00 +0000 (18:56 +0200)
commit9d7db41000570e7a6bb2c7a16811532dae2ef986
treeb980c8de555179736498e1636f1f830fc634db91
parent99fe7e57d3e4e29a37fc2b2f434716344aa3498b
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>
fs/btrfs/extent_io.c