Print this page
3888 zfs recv -F should destroy any snapshots created since the incremental source
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Peng Dai <peng.dai@delphix.com>


   3  *
   4  * The contents of this file are subject to the terms of the
   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  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2012 by Delphix. All rights reserved.
  24  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  25  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  26  */
  27 
  28 #ifndef _SYS_DSL_DATASET_H
  29 #define _SYS_DSL_DATASET_H
  30 
  31 #include <sys/dmu.h>
  32 #include <sys/spa.h>
  33 #include <sys/txg.h>
  34 #include <sys/zio.h>
  35 #include <sys/bplist.h>
  36 #include <sys/dsl_synctask.h>
  37 #include <sys/zfs_context.h>
  38 #include <sys/dsl_deadlist.h>
  39 #include <sys/refcount.h>
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif


 189 void dsl_dataset_name(dsl_dataset_t *ds, char *name);
 190 boolean_t dsl_dataset_tryown(dsl_dataset_t *ds, void *tag);
 191 uint64_t dsl_dataset_create_sync(dsl_dir_t *pds, const char *lastname,
 192     dsl_dataset_t *origin, uint64_t flags, cred_t *, dmu_tx_t *);
 193 uint64_t dsl_dataset_create_sync_dd(dsl_dir_t *dd, dsl_dataset_t *origin,
 194     uint64_t flags, dmu_tx_t *tx);
 195 int dsl_dataset_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t *errors);
 196 int dsl_dataset_promote(const char *name, char *conflsnap);
 197 int dsl_dataset_clone_swap(dsl_dataset_t *clone, dsl_dataset_t *origin_head,
 198     boolean_t force);
 199 int dsl_dataset_rename_snapshot(const char *fsname,
 200     const char *oldsnapname, const char *newsnapname, boolean_t recursive);
 201 int dsl_dataset_snapshot_tmp(const char *fsname, const char *snapname,
 202     minor_t cleanup_minor, const char *htag);
 203 
 204 blkptr_t *dsl_dataset_get_blkptr(dsl_dataset_t *ds);
 205 void dsl_dataset_set_blkptr(dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx);
 206 
 207 spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds);
 208 
 209 boolean_t dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds);

 210 
 211 void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx);
 212 
 213 void dsl_dataset_block_born(dsl_dataset_t *ds, const blkptr_t *bp,
 214     dmu_tx_t *tx);
 215 int dsl_dataset_block_kill(dsl_dataset_t *ds, const blkptr_t *bp,
 216     dmu_tx_t *tx, boolean_t async);
 217 boolean_t dsl_dataset_block_freeable(dsl_dataset_t *ds, const blkptr_t *bp,
 218     uint64_t blk_birth);
 219 uint64_t dsl_dataset_prev_snap_txg(dsl_dataset_t *ds);
 220 
 221 void dsl_dataset_dirty(dsl_dataset_t *ds, dmu_tx_t *tx);
 222 void dsl_dataset_stats(dsl_dataset_t *os, nvlist_t *nv);
 223 void dsl_dataset_fast_stat(dsl_dataset_t *ds, dmu_objset_stats_t *stat);
 224 void dsl_dataset_space(dsl_dataset_t *ds,
 225     uint64_t *refdbytesp, uint64_t *availbytesp,
 226     uint64_t *usedobjsp, uint64_t *availobjsp);
 227 uint64_t dsl_dataset_fsid_guid(dsl_dataset_t *ds);
 228 int dsl_dataset_space_written(dsl_dataset_t *oldsnap, dsl_dataset_t *new,
 229     uint64_t *usedp, uint64_t *compp, uint64_t *uncompp);




   3  *
   4  * The contents of this file are subject to the terms of the
   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  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2013 by Delphix. All rights reserved.
  24  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  25  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  26  */
  27 
  28 #ifndef _SYS_DSL_DATASET_H
  29 #define _SYS_DSL_DATASET_H
  30 
  31 #include <sys/dmu.h>
  32 #include <sys/spa.h>
  33 #include <sys/txg.h>
  34 #include <sys/zio.h>
  35 #include <sys/bplist.h>
  36 #include <sys/dsl_synctask.h>
  37 #include <sys/zfs_context.h>
  38 #include <sys/dsl_deadlist.h>
  39 #include <sys/refcount.h>
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif


 189 void dsl_dataset_name(dsl_dataset_t *ds, char *name);
 190 boolean_t dsl_dataset_tryown(dsl_dataset_t *ds, void *tag);
 191 uint64_t dsl_dataset_create_sync(dsl_dir_t *pds, const char *lastname,
 192     dsl_dataset_t *origin, uint64_t flags, cred_t *, dmu_tx_t *);
 193 uint64_t dsl_dataset_create_sync_dd(dsl_dir_t *dd, dsl_dataset_t *origin,
 194     uint64_t flags, dmu_tx_t *tx);
 195 int dsl_dataset_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t *errors);
 196 int dsl_dataset_promote(const char *name, char *conflsnap);
 197 int dsl_dataset_clone_swap(dsl_dataset_t *clone, dsl_dataset_t *origin_head,
 198     boolean_t force);
 199 int dsl_dataset_rename_snapshot(const char *fsname,
 200     const char *oldsnapname, const char *newsnapname, boolean_t recursive);
 201 int dsl_dataset_snapshot_tmp(const char *fsname, const char *snapname,
 202     minor_t cleanup_minor, const char *htag);
 203 
 204 blkptr_t *dsl_dataset_get_blkptr(dsl_dataset_t *ds);
 205 void dsl_dataset_set_blkptr(dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx);
 206 
 207 spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds);
 208 
 209 boolean_t dsl_dataset_modified_since_snap(dsl_dataset_t *ds,
 210     dsl_dataset_t *snap);
 211 
 212 void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx);
 213 
 214 void dsl_dataset_block_born(dsl_dataset_t *ds, const blkptr_t *bp,
 215     dmu_tx_t *tx);
 216 int dsl_dataset_block_kill(dsl_dataset_t *ds, const blkptr_t *bp,
 217     dmu_tx_t *tx, boolean_t async);
 218 boolean_t dsl_dataset_block_freeable(dsl_dataset_t *ds, const blkptr_t *bp,
 219     uint64_t blk_birth);
 220 uint64_t dsl_dataset_prev_snap_txg(dsl_dataset_t *ds);
 221 
 222 void dsl_dataset_dirty(dsl_dataset_t *ds, dmu_tx_t *tx);
 223 void dsl_dataset_stats(dsl_dataset_t *os, nvlist_t *nv);
 224 void dsl_dataset_fast_stat(dsl_dataset_t *ds, dmu_objset_stats_t *stat);
 225 void dsl_dataset_space(dsl_dataset_t *ds,
 226     uint64_t *refdbytesp, uint64_t *availbytesp,
 227     uint64_t *usedobjsp, uint64_t *availobjsp);
 228 uint64_t dsl_dataset_fsid_guid(dsl_dataset_t *ds);
 229 int dsl_dataset_space_written(dsl_dataset_t *oldsnap, dsl_dataset_t *new,
 230     uint64_t *usedp, uint64_t *compp, uint64_t *uncompp);