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>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/dmu_send.c
          +++ new/usr/src/uts/common/fs/zfs/dmu_send.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  24   24   * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
  25   25   * Copyright (c) 2014, Joyent, Inc. All rights reserved.
  26   26   * Copyright 2014 HybridCluster. All rights reserved.
       27 + * Copyright 2016 RackTop Systems.
  27   28   */
  28   29  
  29   30  #include <sys/dmu.h>
  30   31  #include <sys/dmu_impl.h>
  31   32  #include <sys/dmu_tx.h>
  32   33  #include <sys/dbuf.h>
  33   34  #include <sys/dnode.h>
  34   35  #include <sys/zfs_context.h>
  35   36  #include <sys/dmu_objset.h>
  36   37  #include <sys/dmu_traverse.h>
↓ open down ↓ 14 lines elided ↑ open up ↑
  51   52  #include <sys/dsl_destroy.h>
  52   53  #include <sys/blkptr.h>
  53   54  #include <sys/dsl_bookmark.h>
  54   55  #include <sys/zfeature.h>
  55   56  #include <sys/bqueue.h>
  56   57  
  57   58  /* Set this tunable to TRUE to replace corrupt data with 0x2f5baddb10c */
  58   59  int zfs_send_corrupt_data = B_FALSE;
  59   60  int zfs_send_queue_length = 16 * 1024 * 1024;
  60   61  int zfs_recv_queue_length = 16 * 1024 * 1024;
       62 +/* Set this tunable to FALSE to disable setting of DRR_FLAG_FREERECORDS */
       63 +int zfs_send_set_freerecords_bit = B_TRUE;
  61   64  
  62   65  static char *dmu_recv_tag = "dmu_recv_tag";
  63   66  const char *recv_clone_name = "%recv";
  64   67  
  65   68  #define BP_SPAN(datablkszsec, indblkshift, level) \
  66   69          (((uint64_t)datablkszsec) << (SPA_MINBLOCKSHIFT + \
  67   70          (level) * (indblkshift - SPA_BLKPTRSHIFT)))
  68   71  
  69   72  static void byteswap_record(dmu_replay_record_t *drr);
  70   73  
↓ open down ↓ 667 lines elided ↑ open up ↑
 738  741              featureflags);
 739  742  
 740  743          drr->drr_u.drr_begin.drr_creation_time =
 741  744              dsl_dataset_phys(to_ds)->ds_creation_time;
 742  745          drr->drr_u.drr_begin.drr_type = dmu_objset_type(os);
 743  746          if (is_clone)
 744  747                  drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CLONE;
 745  748          drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(to_ds)->ds_guid;
 746  749          if (dsl_dataset_phys(to_ds)->ds_flags & DS_FLAG_CI_DATASET)
 747  750                  drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA;
 748      -        drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;
      751 +        if (zfs_send_set_freerecords_bit)
      752 +                drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;
 749  753  
 750  754          if (ancestor_zb != NULL) {
 751  755                  drr->drr_u.drr_begin.drr_fromguid =
 752  756                      ancestor_zb->zbm_guid;
 753  757                  fromtxg = ancestor_zb->zbm_creation_txg;
 754  758          }
 755  759          dsl_dataset_name(to_ds, drr->drr_u.drr_begin.drr_toname);
 756  760          if (!to_ds->ds_is_snapshot) {
 757  761                  (void) strlcat(drr->drr_u.drr_begin.drr_toname, "@--head--",
 758  762                      sizeof (drr->drr_u.drr_begin.drr_toname));
↓ open down ↓ 2400 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX