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.
19 #ifndef __BTRFS_SEND_STREAM_H__
20 #define __BTRFS_SEND_STREAM_H__
23 * NOTE: this file is public API, any incompatible change has to update
31 struct btrfs_send_ops {
32 int (*subvol)(const char *path, const u8 *uuid, u64 ctransid,
34 int (*snapshot)(const char *path, const u8 *uuid, u64 ctransid,
35 const u8 *parent_uuid, u64 parent_ctransid,
37 int (*mkfile)(const char *path, void *user);
38 int (*mkdir)(const char *path, void *user);
39 int (*mknod)(const char *path, u64 mode, u64 dev, void *user);
40 int (*mkfifo)(const char *path, void *user);
41 int (*mksock)(const char *path, void *user);
42 int (*symlink)(const char *path, const char *lnk, void *user);
43 int (*rename)(const char *from, const char *to, void *user);
44 int (*link)(const char *path, const char *lnk, void *user);
45 int (*unlink)(const char *path, void *user);
46 int (*rmdir)(const char *path, void *user);
47 int (*write)(const char *path, const void *data, u64 offset, u64 len,
49 int (*clone)(const char *path, u64 offset, u64 len,
50 const u8 *clone_uuid, u64 clone_ctransid,
51 const char *clone_path, u64 clone_offset,
53 int (*set_xattr)(const char *path, const char *name, const void *data,
55 int (*remove_xattr)(const char *path, const char *name, void *user);
56 int (*truncate)(const char *path, u64 size, void *user);
57 int (*chmod)(const char *path, u64 mode, void *user);
58 int (*chown)(const char *path, u64 uid, u64 gid, void *user);
59 int (*utimes)(const char *path, struct timespec *at,
60 struct timespec *mt, struct timespec *ct,
62 int (*update_extent)(const char *path, u64 offset, u64 len, void *user);
65 int btrfs_read_and_process_send_stream(int fd,
66 struct btrfs_send_ops *ops, void *user,