btrfs: reduce the number of arguments to btrfs_run_delalloc_range
authorChristoph Hellwig <hch@lst.de>
Wed, 28 Jun 2023 15:31:31 +0000 (17:31 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:52:14 +0000 (14:52 +0200)
commitc56cbe90599338c0aaa84cab0e99a9e8a8501a38
tree07d952f0f0c727395aecf6247f16d15945877977
parent2c73162d649670045415537dc746f7524cda1405
btrfs: reduce the number of arguments to btrfs_run_delalloc_range

Instead of a separate page_started argument that tells the callers that
btrfs_run_delalloc_range already started writeback by itself, overload
the return value with a positive 1 in additio to 0 and a negative error
code to indicate that is has already started writeback, and remove the
nr_written argument as that caller can calculate it directly based on
the range, and in fact already does so for the case where writeback
wasn't started yet.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/extent_io.c
fs/btrfs/inode.c