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__));
52 BTRFS_SEND_C_SNAPSHOT,
66 BTRFS_SEND_C_SET_XATTR,
67 BTRFS_SEND_C_REMOVE_XATTR,
72 BTRFS_SEND_C_TRUNCATE,
78 BTRFS_SEND_C_UPDATE_EXTENT,
81 #define BTRFS_SEND_C_MAX (__BTRFS_SEND_C_MAX - 1)
83 /* attributes in send stream */
88 BTRFS_SEND_A_CTRANSID,
101 BTRFS_SEND_A_XATTR_NAME,
102 BTRFS_SEND_A_XATTR_DATA,
105 BTRFS_SEND_A_PATH_TO,
106 BTRFS_SEND_A_PATH_LINK,
108 BTRFS_SEND_A_FILE_OFFSET,
111 BTRFS_SEND_A_CLONE_UUID,
112 BTRFS_SEND_A_CLONE_CTRANSID,
113 BTRFS_SEND_A_CLONE_PATH,
114 BTRFS_SEND_A_CLONE_OFFSET,
115 BTRFS_SEND_A_CLONE_LEN,
119 #define BTRFS_SEND_A_MAX (__BTRFS_SEND_A_MAX - 1)
122 long btrfs_ioctl_send(struct file *mnt_file, struct btrfs_ioctl_send_args *arg);