summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2020-01-10 13:16:58 -0500
committerBrian Behlendorf <[email protected]>2020-01-10 10:16:58 -0800
commitba0ba69e50efeda7190b59f27c23ada0edf6f36b (patch)
tree15a28e7c05e9265cd3c54c08c287abdf994ea507 /include
parent9ab6109fb51c88e9dc43622432b300efed036995 (diff)
Add 'zfs send --saved' flag
This commit adds the --saved (-S) to the 'zfs send' command. This flag allows a user to send a partially received dataset, which can be useful when migrating a backup server to new hardware. This flag is compatible with resumable receives, so even if the saved send is interrupted, it can be resumed. The flag does not require any user / kernel ABI changes or any new feature flags in the send stream format. Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Alek Pinchuk <[email protected]> Reviewed-by: Paul Zuchowski <[email protected]> Reviewed-by: Christian Schwarz <[email protected]> Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #9007
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h4
-rw-r--r--include/libzfs_core.h1
-rw-r--r--include/sys/dmu_send.h10
3 files changed, 11 insertions, 4 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 0518c800e..8069d4cd4 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -677,6 +677,9 @@ typedef struct sendflags {
/* include snapshot holds in send stream */
boolean_t holds;
+
+ /* stream represents a partially received dataset */
+ boolean_t saved;
} sendflags_t;
typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *);
@@ -688,6 +691,7 @@ extern int zfs_send_one(zfs_handle_t *, const char *, int, sendflags_t *,
extern int zfs_send_progress(zfs_handle_t *, int, uint64_t *, uint64_t *);
extern int zfs_send_resume(libzfs_handle_t *, sendflags_t *, int outfd,
const char *);
+extern int zfs_send_saved(zfs_handle_t *, sendflags_t *, int, const char *);
extern nvlist_t *zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl,
const char *token);
diff --git a/include/libzfs_core.h b/include/libzfs_core.h
index bd0b0c4f7..c4b4f8e71 100644
--- a/include/libzfs_core.h
+++ b/include/libzfs_core.h
@@ -79,6 +79,7 @@ enum lzc_send_flags {
LZC_SEND_FLAG_LARGE_BLOCK = 1 << 1,
LZC_SEND_FLAG_COMPRESS = 1 << 2,
LZC_SEND_FLAG_RAW = 1 << 3,
+ LZC_SEND_FLAG_SAVED = 1 << 4,
};
int lzc_send(const char *, const char *, int, enum lzc_send_flags);
diff --git a/include/sys/dmu_send.h b/include/sys/dmu_send.h
index 2f3dfc39f..d6d050e01 100644
--- a/include/sys/dmu_send.h
+++ b/include/sys/dmu_send.h
@@ -51,14 +51,16 @@ struct dmu_send_outparams;
int
dmu_send(const char *tosnap, const char *fromsnap, boolean_t embedok,
boolean_t large_block_ok, boolean_t compressok, boolean_t rawok,
- uint64_t resumeobj, uint64_t resumeoff, const char *redactbook, int outfd,
- offset_t *off, struct dmu_send_outparams *dsop);
+ boolean_t savedok, uint64_t resumeobj, uint64_t resumeoff,
+ const char *redactbook, int outfd, offset_t *off,
+ struct dmu_send_outparams *dsop);
int dmu_send_estimate_fast(struct dsl_dataset *ds, struct dsl_dataset *fromds,
zfs_bookmark_phys_t *frombook, boolean_t stream_compressed,
- uint64_t *sizep);
+ boolean_t saved, uint64_t *sizep);
int dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap,
boolean_t embedok, boolean_t large_block_ok, boolean_t compressok,
- boolean_t rawok, int outfd, offset_t *off, struct dmu_send_outparams *dso);
+ boolean_t rawok, boolean_t savedok, int outfd, offset_t *off,
+ struct dmu_send_outparams *dso);
typedef int (*dmu_send_outfunc_t)(objset_t *os, void *buf, int len, void *arg);
typedef struct dmu_send_outparams {