Skip to content

Commit

Permalink
OpenZFS 6536 - zfs send: want a way to disable setting of DRR_FLAG_FR…
Browse files Browse the repository at this point in the history
…EERECORDS

Authored by: Andrew Stormont <[email protected]>
Reviewed by: Anil Vijarnia <[email protected]>
Reviewed by: Kim Shrier <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Approved by: Dan McDonald <[email protected]>
Ported-by: Brian Behlendorf <[email protected]>

OpenZFS-issue: https://www.illumos.org/issues/6536
OpenZFS-commit: openzfs/openzfs@880094b
  • Loading branch information
andy-js authored and behlendorf committed Jun 28, 2016
1 parent e6d3a84 commit b607405
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/sys/zfs_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
* Copyright 2016 RackTop Systems.
*/

#ifndef _SYS_ZFS_IOCTL_H
Expand Down Expand Up @@ -136,6 +137,10 @@ typedef enum dmu_send_resume_token_version {

#define DMU_BACKUP_MAGIC 0x2F5bacbacULL

/*
* Send stream flags. Bits 24-31 are reserved for vendor-specific
* implementations and should not be used.
*/
#define DRR_FLAG_CLONE (1<<0)
#define DRR_FLAG_CI_DATA (1<<1)
/*
Expand Down
6 changes: 5 additions & 1 deletion module/zfs/dmu_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright (c) 2014, Joyent, Inc. All rights reserved.
* Copyright 2014 HybridCluster. All rights reserved.
* Copyright 2016 RackTop Systems.
* Copyright (c) 2016 Actifio, Inc. All rights reserved.
*/

Expand Down Expand Up @@ -62,6 +63,8 @@
int zfs_send_corrupt_data = B_FALSE;
int zfs_send_queue_length = 16 * 1024 * 1024;
int zfs_recv_queue_length = 16 * 1024 * 1024;
/* Set this tunable to FALSE to disable setting of DRR_FLAG_FREERECORDS */
int zfs_send_set_freerecords_bit = B_TRUE;

static char *dmu_recv_tag = "dmu_recv_tag";
const char *recv_clone_name = "%recv";
Expand Down Expand Up @@ -790,7 +793,8 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *to_ds,
drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(to_ds)->ds_guid;
if (dsl_dataset_phys(to_ds)->ds_flags & DS_FLAG_CI_DATASET)
drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA;
drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;
if (zfs_send_set_freerecords_bit)
drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_FREERECORDS;

if (ancestor_zb != NULL) {
drr->drr_u.drr_begin.drr_fromguid =
Expand Down

0 comments on commit b607405

Please sign in to comment.