OSDN Git Service

btrfs: drop unnecessary offset_in_page in extent buffer helpers
authorDavid Sterba <dsterba@suse.com>
Wed, 29 Apr 2020 21:41:20 +0000 (23:41 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:34 +0000 (11:25 +0200)
commitc60ac0ffd682fc04f564dd6f4cc1a77c0f94608b
tree44994c92b04864076da2a01decf618c1bcb7a809
parent2b48966a4da4bcb35f0883bc23dcaf63fcb8557f
btrfs: drop unnecessary offset_in_page in extent buffer helpers

Helpers that iterate over extent buffer pages set up several variables,
one of them is finding out offset of the extent buffer start within a
page. Right now we have extent buffers aligned to page sizes so this is
effectively storing zero. This makes the code harder the follow and can
be simplified.

The same change is done in all the helpers:

* remove: size_t start_offset = offset_in_page(eb->start);
* simplify code using start_offset

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c