Skip to content

Commit d29ea66

Browse files
committed
MFV r296515: 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> Approved by: Dan McDonald <danmcd@omniti.com> Author: Andrew Stormont <astormont@racktopsystems.com> illumos/illumos-gate@880094b
1 parent c3c1379 commit d29ea66

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Copyright (c) 2014, Joyent, Inc. All rights reserved.
2626
* Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>. All rights reserved.
2727
* Copyright 2014 HybridCluster. All rights reserved.
28+
* Copyright 2016 RackTop Systems.
2829
*/
2930

3031
#include <sys/dmu.h>
@@ -64,6 +65,12 @@
6465
int zfs_send_corrupt_data = B_FALSE;
6566
int zfs_send_queue_length = 16 * 1024 * 1024;
6667
int zfs_recv_queue_length = 16 * 1024 * 1024;
68+
/* Set this tunable to FALSE to disable setting of DRR_FLAG_FREERECORDS */
69+
int zfs_send_set_freerecords_bit = B_TRUE;
70+
71+
#ifdef _KERNEL
72+
TUNABLE_INT("vfs.zfs.send_set_freerecords_bit", &zfs_send_set_freerecords_bit);
73+
#endif
6774

6875
static char *dmu_recv_tag = "dmu_recv_tag";
6976
const char *recv_clone_name = "%recv";
@@ -771,7 +778,8 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *to_ds,
771778
drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(to_ds)->ds_guid;
772779
if (dsl_dataset_phys(to_ds)->ds_flags & DS_FLAG_CI_DATASET)
773780
drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA;
774-
drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;
781+
if (zfs_send_set_freerecords_bit)
782+
drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;
775783

776784
if (ancestor_zb != NULL) {
777785
drr->drr_u.drr_begin.drr_fromguid =

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/*
2222
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2323
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
24+
* Copyright 2016 RackTop Systems.
2425
*/
2526

2627
#ifndef _SYS_ZFS_IOCTL_H
@@ -124,6 +125,10 @@ typedef enum dmu_send_resume_token_version {
124125

125126
#define DMU_BACKUP_MAGIC 0x2F5bacbacULL
126127

128+
/*
129+
* Send stream flags. Bits 24-31 are reserved for vendor-specific
130+
* implementations and should not be used.
131+
*/
127132
#define DRR_FLAG_CLONE (1<<0)
128133
#define DRR_FLAG_CI_DATA (1<<1)
129134
/*

0 commit comments

Comments
 (0)