aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/fs.h
diff options
context:
space:
mode:
authorGravatar Filipe Manana <fdmanana@suse.com> 2023-03-21 11:13:52 +0000
committerGravatar David Sterba <dsterba@suse.com> 2023-04-17 18:01:19 +0200
commit007145ff644cc9a2b2b0c3c88ba68824274fcb12 (patch)
tree2ba2d92f0fbd5d3587f53cf814875e1efe80154d /fs/btrfs/fs.h
parentbtrfs: calculate the right space for a single delayed ref when refilling (diff)
downloadlinux-007145ff644cc9a2b2b0c3c88ba68824274fcb12.tar.gz
linux-007145ff644cc9a2b2b0c3c88ba68824274fcb12.tar.bz2
linux-007145ff644cc9a2b2b0c3c88ba68824274fcb12.zip
btrfs: accurately calculate number of delayed refs when flushing
When flushing a limited number of delayed references (FLUSH_DELAYED_REFS_NR state), we are assuming each delayed reference is holding a number of bytes matching the needed space for inserting for a single metadata item (the result of btrfs_calc_insert_metadata_size()). That is not correct when using the free space tree, as in that case we have to multiply that value by 2 since we need to touch the free space tree as well. This is the same computation as we do at btrfs_update_delayed_refs_rsv() and at btrfs_delayed_refs_rsv_release(). So correct the computation for the amount of delayed references we need to flush in case we have the free space tree. This does not fix a functional issue, instead it makes the flush code flush less delayed references, only the minimum necessary to satisfy a ticket. 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>
Diffstat (limited to 'fs/btrfs/fs.h')
0 files changed, 0 insertions, 0 deletions