summaryrefslogtreecommitdiff
path: root/cmds-receive.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-06-11 19:31:01 +0200
committerDavid Sterba <dsterba@suse.cz>2015-06-12 14:39:57 +0200
commit14de97259be14d8c0f384dd24c5b1f85a66c0936 (patch)
treeb7191be1dba2e152bee897f1bfaa25b0e69e9d38 /cmds-receive.c
parentb47fdc73c317ab9737304ab52ce09d8a1191ea88 (diff)
btrfs-progs: receive: implement the update_extent callback
The callback for the NO_FILE_DATA send flag is missing and would crash if such stream is received. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-receive.c')
-rw-r--r--cmds-receive.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmds-receive.c b/cmds-receive.c
index 67e066ce..61d7ed89 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -876,6 +876,20 @@ out:
return ret;
}
+static int process_update_extent(const char *path, u64 offset, u64 len,
+ void *user)
+{
+ if (g_verbose >= 2)
+ fprintf(stderr, "update_extent %s: offset=%llu, len=%llu\n",
+ path, (unsigned long long)offset,
+ (unsigned long long)len);
+
+ /*
+ * Sent with BTRFS_SEND_FLAG_NO_FILE_DATA, nothing to do.
+ */
+
+ return 0;
+}
static struct btrfs_send_ops send_ops = {
.subvol = process_subvol,
@@ -898,6 +912,7 @@ static struct btrfs_send_ops send_ops = {
.chmod = process_chmod,
.chown = process_chown,
.utimes = process_utimes,
+ .update_extent = process_update_extent,
};
static int do_receive(struct btrfs_receive *r, const char *tomnt,