diff options
author | Filipe Manana <fdmanana@suse.com> | 2024-01-31 17:18:04 +0000 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2024-02-13 18:36:35 +0100 |
commit | feefe1f49d26bad9d8997096e3a200280fa7b1c5 (patch) | |
tree | beebaee9d360b2b4f399dae22c2f887c071616f0 /tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c | |
parent | 12c5128f101bfa47a08e4c0e1a75cfa2d0872bcd (diff) |
btrfs: don't reserve space for checksums when writing to nocow files
Currently when doing a write to a file we always reserve metadata space
for inserting data checksums. However we don't need to do it if we have
a nodatacow file (-o nodatacow mount option or chattr +C) or if checksums
are disabled (-o nodatasum mount option), as in that case we are only
adding unnecessary pressure to metadata reservations.
For example on x86_64, with the default node size of 16K, a 4K buffered
write into a nodatacow file is reserving 655360 bytes of metadata space,
as it's accounting for checksums. After this change, which stops reserving
space for checksums if we have a nodatacow file or checksums are disabled,
we only need to reserve 393216 bytes of metadata.
CC: stable@vger.kernel.org # 6.1+
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 'tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c')
0 files changed, 0 insertions, 0 deletions