2 * Copyright (C) 2012 Alexander Block. All rights reserved.
3 * Copyright (C) 2012 STRATO. All rights reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public
7 * License v2 as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 021110-1307, USA.
20 #ifndef __BTRFS_SEND_H__
21 #define __BTRFS_SEND_H__
29 #define BTRFS_SEND_STREAM_MAGIC "btrfs-stream"
30 #define BTRFS_SEND_STREAM_VERSION 1
32 #define BTRFS_SEND_BUF_SIZE (1024 * 64)
33 #define BTRFS_SEND_READ_SIZE (1024 * 48)
46 struct btrfs_stream_header
{
47 char magic
[sizeof(BTRFS_SEND_STREAM_MAGIC
)];
49 } __attribute__ ((__packed__
));
51 struct btrfs_cmd_header
{
52 /* len excluding the header */
55 /* crc including the header with zero crc field */
57 } __attribute__ ((__packed__
));
59 struct btrfs_tlv_header
{
61 /* len excluding the header */
63 } __attribute__ ((__packed__
));
70 BTRFS_SEND_C_SNAPSHOT
,
84 BTRFS_SEND_C_SET_XATTR
,
85 BTRFS_SEND_C_REMOVE_XATTR
,
90 BTRFS_SEND_C_TRUNCATE
,
96 BTRFS_SEND_C_UPDATE_EXTENT
,
99 #define BTRFS_SEND_C_MAX (__BTRFS_SEND_C_MAX - 1)
101 /* attributes in send stream */
106 BTRFS_SEND_A_CTRANSID
,
119 BTRFS_SEND_A_XATTR_NAME
,
120 BTRFS_SEND_A_XATTR_DATA
,
123 BTRFS_SEND_A_PATH_TO
,
124 BTRFS_SEND_A_PATH_LINK
,
126 BTRFS_SEND_A_FILE_OFFSET
,
129 BTRFS_SEND_A_CLONE_UUID
,
130 BTRFS_SEND_A_CLONE_CTRANSID
,
131 BTRFS_SEND_A_CLONE_PATH
,
132 BTRFS_SEND_A_CLONE_OFFSET
,
133 BTRFS_SEND_A_CLONE_LEN
,
137 #define BTRFS_SEND_A_MAX (__BTRFS_SEND_A_MAX - 1)
140 long btrfs_ioctl_send(struct file
*mnt_file
, void __user
*arg
);