1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2012 Alexander Block. All rights reserved.
4 * Copyright (C) 2012 STRATO. All rights reserved.
12 #define BTRFS_SEND_STREAM_MAGIC "btrfs-stream"
13 #define BTRFS_SEND_STREAM_VERSION 1
15 #define BTRFS_SEND_BUF_SIZE SZ_64K
28 struct btrfs_stream_header {
29 char magic[sizeof(BTRFS_SEND_STREAM_MAGIC)];
31 } __attribute__ ((__packed__));
33 struct btrfs_cmd_header {
34 /* len excluding the header */
37 /* crc including the header with zero crc field */
39 } __attribute__ ((__packed__));
41 struct btrfs_tlv_header {
43 /* len excluding the header */
45 } __attribute__ ((__packed__));
53 BTRFS_SEND_C_SNAPSHOT,
67 BTRFS_SEND_C_SET_XATTR,
68 BTRFS_SEND_C_REMOVE_XATTR,
73 BTRFS_SEND_C_TRUNCATE,
79 BTRFS_SEND_C_UPDATE_EXTENT,
80 __BTRFS_SEND_C_MAX_V1,
83 __BTRFS_SEND_C_MAX_V2,
88 #define BTRFS_SEND_C_MAX (__BTRFS_SEND_C_MAX - 1)
90 /* attributes in send stream */
95 BTRFS_SEND_A_CTRANSID,
108 BTRFS_SEND_A_XATTR_NAME,
109 BTRFS_SEND_A_XATTR_DATA,
112 BTRFS_SEND_A_PATH_TO,
113 BTRFS_SEND_A_PATH_LINK,
115 BTRFS_SEND_A_FILE_OFFSET,
118 BTRFS_SEND_A_CLONE_UUID,
119 BTRFS_SEND_A_CLONE_CTRANSID,
120 BTRFS_SEND_A_CLONE_PATH,
121 BTRFS_SEND_A_CLONE_OFFSET,
122 BTRFS_SEND_A_CLONE_LEN,
126 #define BTRFS_SEND_A_MAX (__BTRFS_SEND_A_MAX - 1)
129 long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg);