btrfs: allow extent buffer helpers to skip cross-page handling
authorQu Wenruo <wqu@suse.com>
Thu, 16 Nov 2023 05:19:06 +0000 (15:49 +1030)
committerDavid Sterba <dsterba@suse.com>
Fri, 15 Dec 2023 19:27:03 +0000 (20:27 +0100)
commit397239ed6a6c88b002fbba0b25ed5a719c578c2f
treeac99eeb41e8b9cc942a88720bb35b69dd3f8806f
parent3ba2d3648f9dcd6af6326352bb2775e8b31372e0
btrfs: allow extent buffer helpers to skip cross-page handling

Currently btrfs extent buffer helpers are doing all the cross-page
handling, as there is no guarantee that all those eb pages are
contiguous.

However on systems with enough memory, there is a very high chance the
page cache for btree_inode are allocated with physically contiguous
pages.

In that case, we can skip all the complex cross-page handling, thus
speeding up the code.

This patch adds a new member, extent_buffer::addr, which is only set to
non-NULL if all the extent buffer pages are physically contiguous.

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/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h