Print this page
6536 zfs send: want a way to disable setting of DRR_FLAG_FREERECORDS
Reviewed by: Anil Vijarnia <avijarnia@racktopsystems.com>
Reviewed by: Kim Shrier <kshrier@racktopsystems.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>


   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, 2015 by Delphix. All rights reserved.

  24  */
  25 
  26 #ifndef _SYS_ZFS_IOCTL_H
  27 #define _SYS_ZFS_IOCTL_H
  28 
  29 #include <sys/cred.h>
  30 #include <sys/dmu.h>
  31 #include <sys/zio.h>
  32 #include <sys/dsl_deleg.h>
  33 #include <sys/spa.h>
  34 #include <sys/zfs_stat.h>
  35 
  36 #ifdef _KERNEL
  37 #include <sys/nvpair.h>
  38 #endif  /* _KERNEL */
  39 
  40 #ifdef  __cplusplus
  41 extern "C" {
  42 #endif
  43 


 107 
 108 /*
 109  * The drr_versioninfo field of the dmu_replay_record has the
 110  * following layout:
 111  *
 112  *      64      56      48      40      32      24      16      8       0
 113  *      +-------+-------+-------+-------+-------+-------+-------+-------+
 114  *      |               reserved        |        feature-flags      |C|S|
 115  *      +-------+-------+-------+-------+-------+-------+-------+-------+
 116  *
 117  * The low order two bits indicate the header type: SUBSTREAM (0x1)
 118  * or COMPOUNDSTREAM (0x2).  Using two bits for this is historical:
 119  * this field used to be a version number, where the two version types
 120  * were 1 and 2.  Using two bits for this allows earlier versions of
 121  * the code to be able to recognize send streams that don't use any
 122  * of the features indicated by feature flags.
 123  */
 124 
 125 #define DMU_BACKUP_MAGIC 0x2F5bacbacULL
 126 




 127 #define DRR_FLAG_CLONE          (1<<0)
 128 #define DRR_FLAG_CI_DATA        (1<<1)
 129 /*
 130  * This send stream, if it is a full send, includes the FREE and FREEOBJECT
 131  * records that are created by the sending process.  This means that the send
 132  * stream can be received as a clone, even though it is not an incremental.
 133  * This is not implemented as a feature flag, because the receiving side does
 134  * not need to have implemented it to receive this stream; it is fully backwards
 135  * compatible.  We need a flag, though, because full send streams without it
 136  * cannot necessarily be received as a clone correctly.
 137  */
 138 #define DRR_FLAG_FREERECORDS    (1<<2)
 139 
 140 /*
 141  * flags in the drr_checksumflags field in the DRR_WRITE and
 142  * DRR_WRITE_BYREF blocks
 143  */
 144 #define DRR_CHECKSUM_DEDUP      (1<<0)
 145 
 146 #define DRR_IS_DEDUP_CAPABLE(flags)     ((flags) & DRR_CHECKSUM_DEDUP)




   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, 2015 by Delphix. All rights reserved.
  24  * Copyright 2016 RackTop Systems.
  25  */
  26 
  27 #ifndef _SYS_ZFS_IOCTL_H
  28 #define _SYS_ZFS_IOCTL_H
  29 
  30 #include <sys/cred.h>
  31 #include <sys/dmu.h>
  32 #include <sys/zio.h>
  33 #include <sys/dsl_deleg.h>
  34 #include <sys/spa.h>
  35 #include <sys/zfs_stat.h>
  36 
  37 #ifdef _KERNEL
  38 #include <sys/nvpair.h>
  39 #endif  /* _KERNEL */
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif
  44 


 108 
 109 /*
 110  * The drr_versioninfo field of the dmu_replay_record has the
 111  * following layout:
 112  *
 113  *      64      56      48      40      32      24      16      8       0
 114  *      +-------+-------+-------+-------+-------+-------+-------+-------+
 115  *      |               reserved        |        feature-flags      |C|S|
 116  *      +-------+-------+-------+-------+-------+-------+-------+-------+
 117  *
 118  * The low order two bits indicate the header type: SUBSTREAM (0x1)
 119  * or COMPOUNDSTREAM (0x2).  Using two bits for this is historical:
 120  * this field used to be a version number, where the two version types
 121  * were 1 and 2.  Using two bits for this allows earlier versions of
 122  * the code to be able to recognize send streams that don't use any
 123  * of the features indicated by feature flags.
 124  */
 125 
 126 #define DMU_BACKUP_MAGIC 0x2F5bacbacULL
 127 
 128 /*
 129  * Send stream flags.  Bits 24-31 are reserved for vendor-specific
 130  * implementations and should not be used.
 131  */
 132 #define DRR_FLAG_CLONE          (1<<0)
 133 #define DRR_FLAG_CI_DATA        (1<<1)
 134 /*
 135  * This send stream, if it is a full send, includes the FREE and FREEOBJECT
 136  * records that are created by the sending process.  This means that the send
 137  * stream can be received as a clone, even though it is not an incremental.
 138  * This is not implemented as a feature flag, because the receiving side does
 139  * not need to have implemented it to receive this stream; it is fully backwards
 140  * compatible.  We need a flag, though, because full send streams without it
 141  * cannot necessarily be received as a clone correctly.
 142  */
 143 #define DRR_FLAG_FREERECORDS    (1<<2)
 144 
 145 /*
 146  * flags in the drr_checksumflags field in the DRR_WRITE and
 147  * DRR_WRITE_BYREF blocks
 148  */
 149 #define DRR_CHECKSUM_DEDUP      (1<<0)
 150 
 151 #define DRR_IS_DEDUP_CAPABLE(flags)     ((flags) & DRR_CHECKSUM_DEDUP)