]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: zoned: move non-changing condition check out of the loop
authorNaohiro Aota <naohiro.aota@wdc.com>
Tue, 3 May 2022 21:10:04 +0000 (14:10 -0700)
committerDavid Sterba <dsterba@suse.com>
Thu, 5 May 2022 19:05:56 +0000 (21:05 +0200)
commit3b1062dcce04ba544dacf4845c1bbe07a353a07e
tree68327ecbe3d8e78ddcbbb5c2305992a94c78defa
parent07b06e7cdba487a646e65c1f972319d0601ae680
btrfs: zoned: move non-changing condition check out of the loop

btrfs_zone_activate() checks if block_group->alloc_offset ==
block_group->zone_capacity every time it iterates the loop. But, it is
not depending on the index. Move out the check and do it only once.

Fixes: a7a0fc24224d ("btrfs: zoned: make zone activation multi stripe capable")
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zoned.c