2 * Copyright (C) 2012 Alexander Block. All rights reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 * Boston, MA 021110-1307, USA.
18 #ifndef SEND_STREAM_H_
19 #define SEND_STREAM_H_
25 struct btrfs_send_ops
{
26 int (*subvol
)(const char *path
, const u8
*uuid
, u64 ctransid
,
28 int (*snapshot
)(const char *path
, const u8
*uuid
, u64 ctransid
,
29 const u8
*parent_uuid
, u64 parent_ctransid
,
31 int (*mkfile
)(const char *path
, void *user
);
32 int (*mkdir
)(const char *path
, void *user
);
33 int (*mknod
)(const char *path
, u64 mode
, u64 dev
, void *user
);
34 int (*mkfifo
)(const char *path
, void *user
);
35 int (*mksock
)(const char *path
, void *user
);
36 int (*symlink
)(const char *path
, const char *lnk
, void *user
);
37 int (*rename
)(const char *from
, const char *to
, void *user
);
38 int (*link
)(const char *path
, const char *lnk
, void *user
);
39 int (*unlink
)(const char *path
, void *user
);
40 int (*rmdir
)(const char *path
, void *user
);
41 int (*write
)(const char *path
, const void *data
, u64 offset
, u64 len
,
43 int (*clone
)(const char *path
, u64 offset
, u64 len
,
44 const u8
*clone_uuid
, u64 clone_ctransid
,
45 const char *clone_path
, u64 clone_offset
,
47 int (*set_xattr
)(const char *path
, const char *name
, const void *data
,
49 int (*remove_xattr
)(const char *path
, const char *name
, void *user
);
50 int (*truncate
)(const char *path
, u64 size
, void *user
);
51 int (*chmod
)(const char *path
, u64 mode
, void *user
);
52 int (*chown
)(const char *path
, u64 uid
, u64 gid
, void *user
);
53 int (*utimes
)(const char *path
, struct timespec
*at
,
54 struct timespec
*mt
, struct timespec
*ct
,
56 int (*update_extent
)(const char *path
, u64 offset
, u64 len
, void *user
);
59 int btrfs_read_and_process_send_stream(int fd
,
60 struct btrfs_send_ops
*ops
, void *user
,
67 #endif /* SEND_STREAM_H_ */