Skip to content

Commit 43e52ed

Browse files
committed
Implement zfs_ioc_recv_new() for OpenZFS 2605
Adds ZFS_IOC_RECV_NEW for resumable streams and preserves the legacy ZFS_IOC_RECV user/kernel interface. The new interface supports all stream options but is currently only used for resumable streams. This way updated user space utilities will interoperate with older kernel modules. ZFS_IOC_RECV_NEW is modeled after the existing ZFS_IOC_SEND_NEW handler. Non-Linux OpenZFS platforms have opted to change the legacy interface in an incompatible fashion instead of adding a new ioctl. Signed-off-by: Brian Behlendorf <[email protected]>
1 parent 8c62a0d commit 43e52ed

File tree

6 files changed

+518
-265
lines changed

6 files changed

+518
-265
lines changed

include/libzfs_core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ int lzc_receive_resumable(const char *, nvlist_t *, const char *,
6969
boolean_t, int);
7070
int lzc_receive_with_header(const char *, nvlist_t *, const char *, boolean_t,
7171
boolean_t, int, const struct dmu_replay_record *);
72+
int lzc_receive_one(const char *, nvlist_t *, const char *, boolean_t,
73+
boolean_t, int, const struct dmu_replay_record *, int, uint64_t *,
74+
uint64_t *, uint64_t *, nvlist_t **);
7275

7376
boolean_t lzc_exists(const char *);
7477

include/sys/fs/zfs.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ typedef enum {
232232

233233
#define ZPROP_SOURCE_VAL_RECVD "$recvd"
234234
#define ZPROP_N_MORE_ERRORS "N_MORE_ERRORS"
235+
235236
/*
236237
* Dataset flag implemented as a special entry in the props zap object
237238
* indicating that the dataset has received properties on or after
@@ -923,7 +924,7 @@ typedef struct ddt_histogram {
923924
*/
924925
typedef enum zfs_ioc {
925926
/*
926-
* Illumos - 70/128 numbers reserved.
927+
* Illumos - 71/128 numbers reserved.
927928
*/
928929
ZFS_IOC_FIRST = ('Z' << 8),
929930
ZFS_IOC = ZFS_IOC_FIRST,
@@ -997,6 +998,7 @@ typedef enum zfs_ioc {
997998
ZFS_IOC_BOOKMARK,
998999
ZFS_IOC_GET_BOOKMARKS,
9991000
ZFS_IOC_DESTROY_BOOKMARKS,
1001+
ZFS_IOC_RECV_NEW,
10001002

10011003
/*
10021004
* Linux - 3/64 numbers reserved.

include/sys/zfs_ioctl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,14 @@ typedef struct zfs_cmd {
389389
uint64_t zc_iflags; /* internal to zfs(7fs) */
390390
zfs_share_t zc_share;
391391
dmu_objset_stats_t zc_objset_stats;
392-
dmu_replay_record_t zc_begin_record;
392+
struct drr_begin zc_begin_record;
393393
zinject_record_t zc_inject_record;
394394
uint32_t zc_defer_destroy;
395395
uint32_t zc_flags;
396396
uint64_t zc_action_handle;
397397
int zc_cleanup_fd;
398398
uint8_t zc_simple;
399-
boolean_t zc_resumable;
400-
uint8_t zc_pad[2]; /* alignment */
399+
uint8_t zc_pad[3]; /* alignment */
401400
uint64_t zc_sendobj;
402401
uint64_t zc_fromobj;
403402
uint64_t zc_createtxg;

0 commit comments

Comments
 (0)