@@ -34,7 +34,6 @@ extern "C" {
#define BTRFS_SEND_STREAM_VERSION 1
#define BTRFS_SEND_BUF_SIZE_V1 (64 * 1024)
-#define BTRFS_SEND_READ_SIZE (1024 * 48)
enum btrfs_tlv_type {
BTRFS_TLV_U8,
@@ -70,6 +69,7 @@ struct btrfs_tlv_header {
enum btrfs_send_cmd {
BTRFS_SEND_C_UNSPEC,
+ /* Version 1 */
BTRFS_SEND_C_SUBVOL,
BTRFS_SEND_C_SNAPSHOT,
@@ -98,6 +98,15 @@ enum btrfs_send_cmd {
BTRFS_SEND_C_END,
BTRFS_SEND_C_UPDATE_EXTENT,
+ BTRFS_SEND_C_MAX_V1 = BTRFS_SEND_C_UPDATE_EXTENT,
+
+ /* Version 2 */
+ BTRFS_SEND_C_FALLOCATE,
+ BTRFS_SEND_C_SETFLAGS,
+ BTRFS_SEND_C_ENCODED_WRITE,
+ BTRFS_SEND_C_MAX_V2 = BTRFS_SEND_C_ENCODED_WRITE,
+
+ /* End */
__BTRFS_SEND_C_MAX,
};
#define BTRFS_SEND_C_MAX (__BTRFS_SEND_C_MAX - 1)
@@ -106,6 +115,7 @@ enum btrfs_send_cmd {
enum {
BTRFS_SEND_A_UNSPEC,
+ /* Version 1 */
BTRFS_SEND_A_UUID,
BTRFS_SEND_A_CTRANSID,
@@ -128,6 +138,11 @@ enum {
BTRFS_SEND_A_PATH_LINK,
BTRFS_SEND_A_FILE_OFFSET,
+ /*
+ * In send stream v2, this attribute is special: it must be the last
+ * attribute in a command, its header contains only the type, and its
+ * length is implicitly the remaining length of the command.
+ */
BTRFS_SEND_A_DATA,
BTRFS_SEND_A_CLONE_UUID,
@@ -135,7 +150,25 @@ enum {
BTRFS_SEND_A_CLONE_PATH,
BTRFS_SEND_A_CLONE_OFFSET,
BTRFS_SEND_A_CLONE_LEN,
+ BTRFS_SEND_A_MAX_V1 = BTRFS_SEND_A_CLONE_LEN,
+ /* Version 2 */
+ BTRFS_SEND_A_FALLOCATE_MODE,
+
+ BTRFS_SEND_A_SETFLAGS_FLAGS,
+
+ BTRFS_SEND_A_UNENCODED_FILE_LEN,
+ BTRFS_SEND_A_UNENCODED_LEN,
+ BTRFS_SEND_A_UNENCODED_OFFSET,
+ /*
+ * COMPRESSION and ENCRYPTION default to NONE (0) if omitted from
+ * BTRFS_SEND_C_ENCODED_WRITE.
+ */
+ BTRFS_SEND_A_COMPRESSION,
+ BTRFS_SEND_A_ENCRYPTION,
+ BTRFS_SEND_A_MAX_V2 = BTRFS_SEND_A_ENCRYPTION,
+
+ /* End */
__BTRFS_SEND_A_MAX,
};
#define BTRFS_SEND_A_MAX (__BTRFS_SEND_A_MAX - 1)