btrfs: use a constant for the number of metadata units needed for an unlink
authorFilipe Manana <fdmanana@suse.com>
Tue, 21 Mar 2023 11:13:58 +0000 (11:13 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:20 +0000 (18:01 +0200)
commit5630e2bcfe22392611a88a2a1e6240ff910c480c
tree023f95f14b762e015b0f719bd1c964588efefea5
parentba4ec8fbce6c8b629a26d78cdd4a308cd0a503ca
btrfs: use a constant for the number of metadata units needed for an unlink

Instead of hard coding the number of metadata units for an unlink operation
in a couple places, define a macro and use it instead. This eliminates the
problem of one place getting out of sync with the other, such as recently
fixed by the previous patch in the series ("btrfs: fix calculation of the
global block reserve's size").

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-rsv.c
fs/btrfs/fs.h
fs/btrfs/inode.c