Print this page
2605 want to resume interrupted zfs send
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Xin Li <delphij@freebsd.org>
Reviewed by: Arne Jansen <sensille@gmx.net>
Approved by: Dan McDonald <danmcd@omniti.com>
5765 add support for estimating send stream size with lzc_send_space when source is a bookmark
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Albert Lee <trisk@nexenta.com>
NEX-3558 KRRP Integration
Fixup merge results


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  25  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  26  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  27  * Copyright (c) 2014 Integros [integros.com]

  28  */
  29 
  30 #ifndef _DMU_SEND_H
  31 #define _DMU_SEND_H
  32 
  33 #include <sys/inttypes.h>
  34 #include <sys/spa.h>




  35 
  36 struct vnode;
  37 struct dsl_dataset;
  38 struct drr_begin;
  39 struct avl_tree;
  40 struct dmu_replay_record;
  41 
  42 extern const char *recv_clone_name;
  43 
  44 int dmu_send(const char *tosnap, const char *fromsnap, boolean_t embedok,
  45     boolean_t large_block_ok, boolean_t compressok, int outfd,
  46     uint64_t resumeobj, uint64_t resumeoff,
  47     struct vnode *vp, offset_t *off);
  48 int dmu_send_estimate(struct dsl_dataset *ds, struct dsl_dataset *fromds,
  49     boolean_t stream_compressed, uint64_t *sizep);
  50 int dmu_send_estimate_from_txg(struct dsl_dataset *ds, uint64_t fromtxg,
  51     boolean_t stream_compressed, uint64_t *sizep);
  52 int dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap,
  53     boolean_t embedok, boolean_t large_block_ok, boolean_t compressok,
  54     int outfd, struct vnode *vp, offset_t *off);
  55 
  56 typedef struct dmu_recv_cookie {
  57         struct dsl_dataset *drc_ds;
  58         struct dmu_replay_record *drc_drr_begin;
  59         struct drr_begin *drc_drrb;
  60         const char *drc_tofs;
  61         const char *drc_tosnap;
  62         boolean_t drc_newfs;
  63         boolean_t drc_byteswap;
  64         boolean_t drc_force;
  65         boolean_t drc_resumable;
  66         struct avl_tree *drc_guid_to_ds_map;
  67         zio_cksum_t drc_cksum;
  68         uint64_t drc_newsnapobj;
  69         void *drc_owner;
  70         cred_t *drc_cred;

  71 } dmu_recv_cookie_t;
  72 










  73 int dmu_recv_begin(char *tofs, char *tosnap,
  74     struct dmu_replay_record *drr_begin,
  75     boolean_t force, boolean_t resumable, char *origin, dmu_recv_cookie_t *drc);

  76 int dmu_recv_stream(dmu_recv_cookie_t *drc, struct vnode *vp, offset_t *voffp,
  77     int cleanup_fd, uint64_t *action_handlep);

  78 int dmu_recv_end(dmu_recv_cookie_t *drc, void *owner);
  79 boolean_t dmu_objset_is_receiving(objset_t *os);
  80 
  81 #endif /* _DMU_SEND_H */


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2012, 2014 by Delphix. All rights reserved.

  25  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  26  * Copyright (c) 2014 Integros [integros.com]
  27  * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
  28  */
  29 
  30 #ifndef _DMU_SEND_H
  31 #define _DMU_SEND_H
  32 
  33 #include <sys/inttypes.h>
  34 #include <sys/spa.h>
  35 #include <sys/dmu_impl.h>
  36 #include <sys/dmu_krrp.h>
  37 #include <sys/dsl_dataset.h>
  38 #include <sys/dsl_bookmark.h>
  39 
  40 struct vnode;
  41 struct dsl_dataset;
  42 struct drr_begin;
  43 struct avl_tree;
  44 struct dmu_replay_record;
  45 
  46 extern const char *recv_clone_name;
  47 
  48 int dmu_send(const char *tosnap, const char *fromsnap, boolean_t embedok,
  49     boolean_t large_block_ok, boolean_t compressok, int outfd,
  50     uint64_t resumeobj, uint64_t resumeoff,
  51     struct vnode *vp, offset_t *off);
  52 int dmu_send_estimate(struct dsl_dataset *ds, struct dsl_dataset *fromds,
  53     boolean_t stream_compressed, uint64_t *sizep);
  54 int dmu_send_estimate_from_txg(struct dsl_dataset *ds, uint64_t fromtxg,
  55     boolean_t stream_compressed, uint64_t *sizep);
  56 int dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap,
  57     boolean_t embedok, boolean_t large_block_ok, boolean_t compressok,
  58     int outfd, struct vnode *vp, offset_t *off, boolean_t sendsize);
  59 
  60 typedef struct dmu_recv_cookie {
  61         struct dsl_dataset *drc_ds;
  62         struct dmu_replay_record *drc_drr_begin;
  63         struct drr_begin *drc_drrb;
  64         const char *drc_tofs;
  65         const char *drc_tosnap;
  66         boolean_t drc_newfs;
  67         boolean_t drc_byteswap;
  68         boolean_t drc_force;
  69         boolean_t drc_resumable;
  70         struct avl_tree *drc_guid_to_ds_map;
  71         zio_cksum_t drc_cksum;
  72         uint64_t drc_newsnapobj;
  73         void *drc_owner;
  74         cred_t *drc_cred;
  75         dmu_krrp_task_t *drc_krrp_task;
  76 } dmu_recv_cookie_t;
  77 
  78 int dmu_recv_impl(int fd, char *tofs, char *tosnap, char *origin,
  79     dmu_replay_record_t *drr_begin, boolean_t is_resumable, nvlist_t *props,
  80     nvlist_t *errors, uint64_t *errf,
  81     int cfd, uint64_t *ahdl, uint64_t *sz, boolean_t force,
  82     dmu_krrp_task_t *krrp_task);
  83 int dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *to_ds,
  84     zfs_bookmark_phys_t *ancestor_zb, boolean_t is_clone, boolean_t embedok,
  85     boolean_t large_block_ok, boolean_t compressok, int outfd,
  86     uint64_t resumeobj, uint64_t resumeoff, vnode_t *vp, offset_t *off,
  87     dmu_krrp_task_t *krrp_task);
  88 int dmu_recv_begin(char *tofs, char *tosnap,
  89     struct dmu_replay_record *drr_begin,
  90     boolean_t force, boolean_t resumable, boolean_t force_cksum, char *origin,
  91     dmu_recv_cookie_t *drc);
  92 int dmu_recv_stream(dmu_recv_cookie_t *drc, struct vnode *vp, offset_t *voffp,
  93     int cleanup_fd, uint64_t *action_handlep,
  94     dmu_krrp_task_t *krrp_task);
  95 int dmu_recv_end(dmu_recv_cookie_t *drc, void *owner);
  96 boolean_t dmu_objset_is_receiving(objset_t *os);
  97 
  98 #endif /* _DMU_SEND_H */