btrfs: simplify splitting logic in btrfs_extract_ordered_extent
authorChristoph Hellwig <hch@lst.de>
Tue, 28 Mar 2023 05:19:51 +0000 (14:19 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:21 +0000 (18:01 +0200)
commit11d33ab6c1f3096194febc6b67c250b3476effa2
treedb573b9f60810953a660def26cffc6a4469f2169
parente44ca71cfe07c5133a35102f2aeb200370614bb2
btrfs: simplify splitting logic in btrfs_extract_ordered_extent

btrfs_extract_ordered_extent is always used to split an ordered_extent
and extent_map into two parts, so it doesn't need to deal with a three
way split.

Simplify it by only allowing for a single split point, and always split
out the beginning of the extent, as that is what we'll later need to
be able to hold on to a reference to the original ordered_extent that
the first part is split off for submission.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Tested-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c