]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: pass btrfs_inode to btrfs_writepage_endio_finish_ordered()
authorQu Wenruo <wqu@suse.com>
Thu, 8 Apr 2021 12:32:27 +0000 (20:32 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:08 +0000 (15:19 +0200)
commit38a39ac77e089515acbe85c6c70c3df1e728357d
treeee8afafcc415d18c967c9fbe7ca902f3d35101f5
parentfa04c16574c08ddea6885b5cd6a0ecb941bfa3c0
btrfs: pass btrfs_inode to btrfs_writepage_endio_finish_ordered()

There is a pretty bad abuse of btrfs_writepage_endio_finish_ordered() in
end_compressed_bio_write().

It passes compressed pages to btrfs_writepage_endio_finish_ordered(),
which is only supposed to accept inode pages.

Thankfully the important info here is the inode, so let's pass
btrfs_inode directly into btrfs_writepage_endio_finish_ordered(), and
make @page parameter optional.

By this, end_compressed_bio_write() can happily pass page=NULL while
still getting everything done properly.

Also, to cooperate with such modification, replace @page parameter for
trace_btrfs_writepage_end_io_hook() with btrfs_inode.
Although this removes page_index info, the existing start/len should be
enough for most usage.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/ctree.h
fs/btrfs/extent_io.c
fs/btrfs/inode.c
include/trace/events/btrfs.h