]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: read eb folio index right before loops
authorDavid Sterba <dsterba@suse.com>
Tue, 6 Jan 2026 16:20:27 +0000 (17:20 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:56:07 +0000 (18:56 +0200)
commitb8aa337121ddfb050199ecda57b0654d5e3d91e9
tree6a367c122eea5bd0f6de1ba47c547d5b5a445997
parentaae90421940a7c9a3bb783ec031435ba069fe3c5
btrfs: read eb folio index right before loops

There are generic helpers to access extent buffer folio data of any
length, potentially iterating over a few of them. This is a slow path,
either we use the type based accessors or the eb folio allocation is
contiguous and we can use the memcpy/memcmp helpers.

The initialization of 'i' is done at the beginning though it may not be
needed. Move it right before the folio loop, this has minor effect on
generated code in __write_extent_buffer().

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c