mbox series

[v15,0/7] btrfs: add send/receive support for reading/writing compressed data

Message ID cover.1649092662.git.osandov@fb.com (mailing list archive)
Headers show
Series btrfs: add send/receive support for reading/writing compressed data | expand

Message

Omar Sandoval April 4, 2022, 5:29 p.m. UTC
From: Omar Sandoval <osandov@fb.com>

This series adds support for sending compressed data via Btrfs send and
btrfs-progs support for sending/receiving compressed data and writing it
with BTRFS_IOC_ENCODED_WRITE, which was previously merged into
misc-next. See the previous posting for more details and benchmarks [1].

Patches 1 and 2 are cleanups for Btrfs send. Patches 3-5 prepare some
protocol changes for send stream v2. Patch 6 implements compressed send.
Patch 7 enables send stream v2 and compressed send in the send ioctl
when requested.

Changes since v14 [2]:

- Added a comment about "put_data" to patch 4.
- Replaced hard-coded 2s with sizeof(__le16) in patch 4.
- Replaced patch 5 with new approach using vmalloc() + vmalloc_to_page()
  (instead of alloc_page() + vmap()) as suggested by Sweet Tea.
- Added Sweet Tea's reviewed-bys.
- Rebased on latest misc-next branch.

The btrfs-progs patches are unchanged since v14, so I'm not resending
them this time.

1: https://lore.kernel.org/linux-btrfs/cover.1615922753.git.osandov@fb.com/
2: https://lore.kernel.org/linux-btrfs/cover.1647537027.git.osandov@fb.com/

Omar Sandoval (7):
  btrfs: send: remove unused send_ctx::{total,cmd}_send_size
  btrfs: send: explicitly number commands and attributes
  btrfs: add send stream v2 definitions
  btrfs: send: write larger chunks when using stream v2
  btrfs: send: get send buffer pages for protocol v2
  btrfs: send: send compressed extents with encoded writes
  btrfs: send: enable support for stream v2 and compressed writes

 fs/btrfs/ctree.h           |   6 +
 fs/btrfs/inode.c           |  13 +-
 fs/btrfs/send.c            | 320 +++++++++++++++++++++++++++++++++----
 fs/btrfs/send.h            | 142 +++++++++-------
 include/uapi/linux/btrfs.h |  10 +-
 5 files changed, 392 insertions(+), 99 deletions(-)