btrfs: send: prepare for v2 protocol
authorDavid Sterba <dsterba@suse.com>
Fri, 22 Oct 2021 14:53:36 +0000 (16:53 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 29 Oct 2021 10:38:43 +0000 (12:38 +0200)
commite77fbf990316d47968a793d8aa920fd62385aec9
treef8bfc770245ccc649b54a16a5d976d64da2986cc
parent50780d9baa316fa773137d1802005932e9bae215
btrfs: send: prepare for v2 protocol

This is preparatory work for send protocol update to version 2 and
higher.

We have many pending protocol update requests but still don't have the
basic protocol rev in place, the first thing that must happen is to do
the actual versioning support.

The protocol version is u32 and is a new member in the send ioctl
struct. Validity of the version field is backed by a new flag bit. Old
kernels would fail when a higher version is requested. Version protocol
0 will pick the highest supported version, BTRFS_SEND_STREAM_VERSION,
  that's also exported in sysfs.

The version is still unchanged and will be increased once we have new
incompatible commands or stream updates.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c
fs/btrfs/send.c
fs/btrfs/send.h
include/uapi/linux/btrfs.h