Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / fs / btrfs / send.h
blobde91488b7cd003de0d7822b2fc2a521062bcb052
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2012 Alexander Block. All rights reserved.
4 * Copyright (C) 2012 STRATO. All rights reserved.
5 */
7 #ifndef BTRFS_SEND_H
8 #define BTRFS_SEND_H
10 #include "ctree.h"
12 #define BTRFS_SEND_STREAM_MAGIC "btrfs-stream"
13 #define BTRFS_SEND_STREAM_VERSION 1
15 #define BTRFS_SEND_BUF_SIZE SZ_64K
17 enum btrfs_tlv_type {
18 BTRFS_TLV_U8,
19 BTRFS_TLV_U16,
20 BTRFS_TLV_U32,
21 BTRFS_TLV_U64,
22 BTRFS_TLV_BINARY,
23 BTRFS_TLV_STRING,
24 BTRFS_TLV_UUID,
25 BTRFS_TLV_TIMESPEC,
28 struct btrfs_stream_header {
29 char magic[sizeof(BTRFS_SEND_STREAM_MAGIC)];
30 __le32 version;
31 } __attribute__ ((__packed__));
33 struct btrfs_cmd_header {
34 /* len excluding the header */
35 __le32 len;
36 __le16 cmd;
37 /* crc including the header with zero crc field */
38 __le32 crc;
39 } __attribute__ ((__packed__));
41 struct btrfs_tlv_header {
42 __le16 tlv_type;
43 /* len excluding the header */
44 __le16 tlv_len;
45 } __attribute__ ((__packed__));
47 /* commands */
48 enum btrfs_send_cmd {
49 BTRFS_SEND_C_UNSPEC,
51 BTRFS_SEND_C_SUBVOL,
52 BTRFS_SEND_C_SNAPSHOT,
54 BTRFS_SEND_C_MKFILE,
55 BTRFS_SEND_C_MKDIR,
56 BTRFS_SEND_C_MKNOD,
57 BTRFS_SEND_C_MKFIFO,
58 BTRFS_SEND_C_MKSOCK,
59 BTRFS_SEND_C_SYMLINK,
61 BTRFS_SEND_C_RENAME,
62 BTRFS_SEND_C_LINK,
63 BTRFS_SEND_C_UNLINK,
64 BTRFS_SEND_C_RMDIR,
66 BTRFS_SEND_C_SET_XATTR,
67 BTRFS_SEND_C_REMOVE_XATTR,
69 BTRFS_SEND_C_WRITE,
70 BTRFS_SEND_C_CLONE,
72 BTRFS_SEND_C_TRUNCATE,
73 BTRFS_SEND_C_CHMOD,
74 BTRFS_SEND_C_CHOWN,
75 BTRFS_SEND_C_UTIMES,
77 BTRFS_SEND_C_END,
78 BTRFS_SEND_C_UPDATE_EXTENT,
79 __BTRFS_SEND_C_MAX,
81 #define BTRFS_SEND_C_MAX (__BTRFS_SEND_C_MAX - 1)
83 /* attributes in send stream */
84 enum {
85 BTRFS_SEND_A_UNSPEC,
87 BTRFS_SEND_A_UUID,
88 BTRFS_SEND_A_CTRANSID,
90 BTRFS_SEND_A_INO,
91 BTRFS_SEND_A_SIZE,
92 BTRFS_SEND_A_MODE,
93 BTRFS_SEND_A_UID,
94 BTRFS_SEND_A_GID,
95 BTRFS_SEND_A_RDEV,
96 BTRFS_SEND_A_CTIME,
97 BTRFS_SEND_A_MTIME,
98 BTRFS_SEND_A_ATIME,
99 BTRFS_SEND_A_OTIME,
101 BTRFS_SEND_A_XATTR_NAME,
102 BTRFS_SEND_A_XATTR_DATA,
104 BTRFS_SEND_A_PATH,
105 BTRFS_SEND_A_PATH_TO,
106 BTRFS_SEND_A_PATH_LINK,
108 BTRFS_SEND_A_FILE_OFFSET,
109 BTRFS_SEND_A_DATA,
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,
117 __BTRFS_SEND_A_MAX,
119 #define BTRFS_SEND_A_MAX (__BTRFS_SEND_A_MAX - 1)
121 #ifdef __KERNEL__
122 long btrfs_ioctl_send(struct file *mnt_file, struct btrfs_ioctl_send_args *arg);
123 #endif
125 #endif