btrfs: zoned: consider zone as full when no more SB can be written
authorNaohiro Aota <naohiro.aota@wdc.com>
Thu, 19 Aug 2021 12:19:12 +0000 (21:19 +0900)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Oct 2021 17:07:59 +0000 (19:07 +0200)
commit5daaf552d18263adbdf385ce5c32da8277f8de02
tree7d7a8210aef586061b536d8ae5e9b33909c1e926
parentd8da0e85673a9512b2eb11cdeabc7523b3a46ce2
btrfs: zoned: consider zone as full when no more SB can be written

We cannot write beyond zone capacity. So, we should consider a zone as
"full" when the write pointer goes beyond capacity - the size of super
info.

Also, take this opportunity to replace a subtle duplicated code with a loop
and fix a typo in comment.

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