Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Qu Wenruo and committed by
David Sterba
9d7db410 99fe7e57

+3 -3
+3 -3
fs/btrfs/extent_io.c
··· 530 530 u32 len = fi.length; 531 531 532 532 bio_size += len; 533 - if (error) 534 - mapping_set_error(folio->mapping, error); 535 - 536 533 ASSERT(btrfs_folio_test_ordered(fs_info, folio, start, len)); 537 534 btrfs_folio_clear_ordered(fs_info, folio, start, len); 538 535 btrfs_folio_clear_writeback(fs_info, folio, start, len); 539 536 } 537 + 538 + if (error) 539 + mapping_set_error(bbio->inode->vfs_inode.i_mapping, error); 540 540 541 541 btrfs_finish_ordered_extent(bbio->ordered, bbio->file_offset, bio_size, !error); 542 542 bio_put(bio);