btrfs: zoned: factor out prepare_allocation_zoned()

[ Upstream commit b271fee9a4 ]

Factor out prepare_allocation_zoned() for further extension. While at
it, optimize the if-branch a bit.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: 02444f2ac2 ("btrfs: zoned: optimize hint byte for zoned allocator")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Naohiro Aota 2023-12-19 01:02:28 +09:00 • committed by Greg Kroah-Hartman
commit b1e30e2ff6