aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Pijewski <[email protected]>2012-05-09 15:05:14 -0700
committerBrian Behlendorf <[email protected]>2012-09-19 13:39:06 -0700
commit37abac6d559a1da8ab8e5379442f491b73998f6a (patch)
treeca8b1111122302e6151581c3524342dbb5cfff65 /include
parent1bd201e70d57464fd26bf9089ea4b44fd49e4f2d (diff)
Illumos #2703: add mechanism to report ZFS send progress
Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Robert Mustacchi <[email protected]> Reviewed by: Richard Lowe <[email protected]> Approved by: Eric Schrock <[email protected]> References: https://www.illumos.org/issues/2703 Ported by: Martin Matuska <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h4
-rw-r--r--include/sys/dmu.h5
-rw-r--r--include/sys/dmu_impl.h28
-rw-r--r--include/sys/dsl_dataset.h4
-rw-r--r--include/sys/fs/zfs.h2
-rw-r--r--include/sys/zfs_context.h2
6 files changed, 43 insertions, 2 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 9d0e8ce43..75e149334 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -23,6 +23,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBZFS_H
@@ -580,6 +581,9 @@ typedef struct sendflags {
/* parsable verbose output (ie. -P) */
boolean_t parsable;
+
+ /* show progress (ie. -v) */
+ boolean_t progress;
} sendflags_t;
typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *);
diff --git a/include/sys/dmu.h b/include/sys/dmu.h
index 5b2e25b78..fe317c835 100644
--- a/include/sys/dmu.h
+++ b/include/sys/dmu.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -705,8 +706,8 @@ typedef void (*dmu_traverse_cb_t)(objset_t *os, void *arg, struct blkptr *bp,
void dmu_traverse_objset(objset_t *os, uint64_t txg_start,
dmu_traverse_cb_t cb, void *arg);
-int dmu_sendbackup(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin,
- struct vnode *vp, offset_t *off);
+int dmu_send(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorigin,
+ int outfd, struct vnode *vp, offset_t *off);
int dmu_send_estimate(objset_t *tosnap, objset_t *fromsnap, boolean_t fromorign,
uint64_t *sizep);
diff --git a/include/sys/dmu_impl.h b/include/sys/dmu_impl.h
index 0b8748df1..f13a2a37c 100644
--- a/include/sys/dmu_impl.h
+++ b/include/sys/dmu_impl.h
@@ -21,6 +21,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_DMU_IMPL_H
@@ -30,6 +31,7 @@
#include <sys/zio.h>
#include <sys/dnode.h>
#include <sys/zfs_context.h>
+#include <sys/zfs_ioctl.h>
#ifdef __cplusplus
extern "C" {
@@ -239,6 +241,32 @@ typedef struct dmu_xuio {
iovec_t *iovp;
} dmu_xuio_t;
+/*
+ * The list of data whose inclusion in a send stream can be pending from
+ * one call to backup_cb to another. Multiple calls to dump_free() and
+ * dump_freeobjects() can be aggregated into a single DRR_FREE or
+ * DRR_FREEOBJECTS replay record.
+ */
+typedef enum {
+ PENDING_NONE,
+ PENDING_FREE,
+ PENDING_FREEOBJECTS
+} dmu_pendop_t;
+
+typedef struct dmu_sendarg {
+ list_node_t dsa_link;
+ dmu_replay_record_t *dsa_drr;
+ vnode_t *dsa_vp;
+ int dsa_outfd;
+ proc_t *dsa_proc;
+ offset_t *dsa_off;
+ objset_t *dsa_os;
+ zio_cksum_t dsa_zc;
+ uint64_t dsa_toguid;
+ int dsa_err;
+ dmu_pendop_t dsa_pending_op;
+} dmu_sendarg_t;
+
#ifdef __cplusplus
}
#endif
diff --git a/include/sys/dsl_dataset.h b/include/sys/dsl_dataset.h
index 948abb020..7cff7e3a0 100644
--- a/include/sys/dsl_dataset.h
+++ b/include/sys/dsl_dataset.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_DSL_DATASET_H
@@ -150,6 +151,9 @@ typedef struct dsl_dataset {
uint64_t ds_reserved; /* cached refreservation */
uint64_t ds_quota; /* cached refquota */
+ kmutex_t ds_sendstream_lock;
+ list_t ds_sendstreams;
+
/* Protected by ds_lock; keep at end of struct for better locality */
char ds_snapname[MAXNAMELEN];
} dsl_dataset_t;
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index 523837992..f72c74fc9 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -23,6 +23,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -803,6 +804,7 @@ typedef enum zfs_ioc {
ZFS_IOC_SPACE_WRITTEN,
ZFS_IOC_SPACE_SNAPS,
ZFS_IOC_POOL_REOPEN,
+ ZFS_IOC_SEND_PROGRESS,
} zfs_ioc_t;
/*
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index 8982c000b..de8b943be 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -24,6 +24,7 @@
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#ifndef _SYS_ZFS_CONTEXT_H
@@ -201,6 +202,7 @@ typedef struct proc {
} proc_t;
extern struct proc p0;
+#define curproc (&p0)
typedef void (*thread_func_t)(void *);
typedef void (*thread_func_arg_t)(void *);