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_
21 struct btrfs_send_ops {
22 int (*subvol)(const char *path, const u8 *uuid, u64 ctransid,
24 int (*snapshot)(const char *path, const u8 *uuid, u64 ctransid,
25 const u8 *parent_uuid, u64 parent_ctransid,
27 int (*mkfile)(const char *path, void *user);
28 int (*mkdir)(const char *path, void *user);
29 int (*mknod)(const char *path, u64 mode, u64 dev, void *user);
30 int (*mkfifo)(const char *path, void *user);
31 int (*mksock)(const char *path, void *user);
32 int (*symlink)(const char *path, const char *lnk, void *user);
33 int (*rename)(const char *from, const char *to, void *user);
34 int (*link)(const char *path, const char *lnk, void *user);
35 int (*unlink)(const char *path, void *user);
36 int (*rmdir)(const char *path, void *user);
37 int (*write)(const char *path, const void *data, u64 offset, u64 len,
39 int (*clone)(const char *path, u64 offset, u64 len,
40 const u8 *clone_uuid, u64 clone_ctransid,
41 const char *clone_path, u64 clone_offset,
43 int (*set_xattr)(const char *path, const char *name, const void *data,
45 int (*remove_xattr)(const char *path, const char *name, void *user);
46 int (*truncate)(const char *path, u64 size, void *user);
47 int (*chmod)(const char *path, u64 mode, void *user);
48 int (*chown)(const char *path, u64 uid, u64 gid, void *user);
49 int (*utimes)(const char *path, struct timespec *at,
50 struct timespec *mt, struct timespec *ct,
52 int (*update_extent)(const char *path, u64 offset, u64 len, void *user);
55 int btrfs_read_and_process_send_stream(int fd,
56 struct btrfs_send_ops *ops, void *user);
59 #endif /* SEND_STREAM_H_ */