btrfs-progs/kernel-shared
Boris Burkov a82996e1b6 btrfs-progs: receive: dynamically allocate sctx->read_buf
In send stream v2, write commands can now be an arbitrary size. For that
reason, we can no longer allocate a fixed array in sctx for read_cmd.
Instead, read_cmd dynamically allocates sctx->read_buf. To avoid
needless reallocations, we reuse read_buf between read_cmd calls by also
keeping track of the size of the allocated buffer in sctx->read_buf_sz.

We do the first allocation of the old default size at the start of
processing the stream, and we only reallocate if we encounter a command
that needs a larger buffer.

Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-06-07 13:59:31 +02:00
..
backref.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
backref.h
ctree.c btrfs-progs: remove extent_buffer::fd and extent_buffer::dev_bytes 2022-04-25 19:08:30 +02:00
ctree.h btrfs-progs: libbtrfs: drop ifdef BTRFS_FLAT_INCLUDES where not necessary 2022-06-06 15:48:52 +02:00
delayed-ref.c
delayed-ref.h
dir-item.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
disk-io.c btrfs-progs: use read_data_from_disk() to replace read_extent_from_disk() and replace read_extent_data() 2022-04-25 19:08:30 +02:00
disk-io.h btrfs-progs: use read_data_from_disk() to replace read_extent_from_disk() and replace read_extent_data() 2022-04-25 19:08:30 +02:00
extent-tree.c btrfs-progs: properly initialize block group thresholds 2022-05-20 15:54:20 +02:00
extent_io.c btrfs-progs: allow read_data_from_disk() to rebuild RAID56 using P/Q 2022-04-25 19:08:30 +02:00
extent_io.h btrfs-progs: libbtrfs: drop ifdef BTRFS_FLAT_INCLUDES where not necessary 2022-06-06 15:48:52 +02:00
file-item.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
file.c btrfs-progs: use read_data_from_disk() to replace read_extent_from_disk() and replace read_extent_data() 2022-04-25 19:08:30 +02:00
free-space-cache.c btrfs-progs: use read_data_from_disk() to replace read_extent_from_disk() and replace read_extent_data() 2022-04-25 19:08:30 +02:00
free-space-cache.h
free-space-tree.c btrfs-progs: properly initialize block group thresholds 2022-05-20 15:54:20 +02:00
free-space-tree.h btrfs-progs: properly initialize block group thresholds 2022-05-20 15:54:20 +02:00
inode-item.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
inode.c
print-tree.c btrfs-progs: btrfstune: fix build-time detection of experimental features 2022-05-10 15:42:13 +02:00
print-tree.h
root-tree.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
send.h btrfs-progs: receive: dynamically allocate sctx->read_buf 2022-06-07 13:59:31 +02:00
transaction.c btrfs-progs: fix a memory leak when starting a transaction on fs with error 2022-04-25 18:32:17 +02:00
transaction.h
ulist.c
ulist.h
uuid-tree.c btrfs-progs: remove the _nr from the item helpers 2022-03-09 15:13:13 +01:00
volumes.c btrfs-progs: do not use btrfs_commit_transaction() just to update super blocks 2022-05-20 15:54:16 +02:00
volumes.h btrfs-progs: remove the unused btrfs_fs_info::seeding member 2022-04-29 22:13:22 +02:00
zoned.c btrfs-progs: zoned: add upper and lower zone size boundaries 2022-06-06 15:47:50 +02:00
zoned.h btrfs-progs: zoned: export sb_zone_number() and related constants 2022-04-08 23:17:35 +02:00