aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-03-28 14:19:52 +0900
committerDavid Sterba <dsterba@suse.com>2023-04-17 18:01:21 +0200
commit8f4af4b8e1227291bbeaee4b0f2e7f494d9dd2c1 (patch)
tree9fa8487fbc15db33db6ae814168d9abc6d625626 /fs/btrfs/inode.c
parent11d33ab6c1f3096194febc6b67c250b3476effa2 (diff)
btrfs: sink parameter len to btrfs_split_ordered_extent
btrfs_split_ordered_extent is only ever asked to split out the beginning of an ordered_extent (i.e. post == 0). Change it to only take a len to split out, and switch it to allocate the new extent for the beginning, as that helps with callers that want to keep a pointer to the ordered_extent that it is stealing from. Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com> 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>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 757706d0cb25..7155c70cfc6d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2646,17 +2646,11 @@ blk_status_t btrfs_extract_ordered_extent(struct btrfs_bio *bbio)
goto out;
}
- /* The bio must be entirely covered by the ordered extent. */
- if (WARN_ON_ONCE(len > ordered_len)) {
- ret = -EINVAL;
- goto out;
- }
-
/* No need to split if the ordered extent covers the entire bio. */
if (ordered->disk_num_bytes == len)
goto out;
- ret = btrfs_split_ordered_extent(ordered, len, 0);
+ ret = btrfs_split_ordered_extent(ordered, len);
if (ret)
goto out;
ret = split_zoned_em(inode, bbio->file_offset, ordered_len, len, 0);