aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2014-05-23 08:21:07 -0800
committerBrian Behlendorf <[email protected]>2014-07-31 09:49:34 -0700
commitfaf0f58c69607a15e2d1563567afb815842805de (patch)
treebd2cfbb4296353792f34d11c09cbd108b7757ed1 /include
parent603cb25ca51ff89366886f9a4ed58f68b6aba2da (diff)
Illumos 3835 zfs need not store 2 copies of all metadata
Reviewed by: George Wilson <[email protected]> Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Dan McDonald <[email protected]> Approved by: Richard Lowe <[email protected]> Description from Matt Ahrens's bug report at Delphix: Add a new zfs property, "redundant_metadata" which can have values "all" or "most". The default will be "all", which is the current behavior. Setting to "most" will cause us to only store 1 copy of level-1 indirect blocks of user data files. Additional notes: The new man page section for this property states "The exact behavior of which metadata blocks are stored redundantly may change in future releases." and: "When set to most, ZFS stores an extra copy of most types of metadata. This can improve performance of random writes, because less metadata must be written." The current implementation is as described above in Matt's blog. It is controlled by a new global integer "zfs_redundant_metadata_most_ditto_level", currently initialized to 2. When "redundant_metadata" is set to "most", only indirect blocks of the specified level and higher will have additional ditto blocks created. Ported by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2542
Diffstat (limited to 'include')
-rw-r--r--include/sys/dmu.h6
-rw-r--r--include/sys/dmu_objset.h19
-rw-r--r--include/sys/fs/zfs.h8
3 files changed, 20 insertions, 13 deletions
diff --git a/include/sys/dmu.h b/include/sys/dmu.h
index 8e25acf85..ad12ecafa 100644
--- a/include/sys/dmu.h
+++ b/include/sys/dmu.h
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
@@ -739,8 +739,8 @@ extern struct dsl_dataset *dmu_objset_ds(objset_t *os);
extern void dmu_objset_name(objset_t *os, char *buf);
extern dmu_objset_type_t dmu_objset_type(objset_t *os);
extern uint64_t dmu_objset_id(objset_t *os);
-extern uint64_t dmu_objset_syncprop(objset_t *os);
-extern uint64_t dmu_objset_logbias(objset_t *os);
+extern zfs_sync_type_t dmu_objset_syncprop(objset_t *os);
+extern zfs_logbias_op_t dmu_objset_logbias(objset_t *os);
extern int dmu_snapshot_list_next(objset_t *os, int namelen, char *name,
uint64_t *id, uint64_t *offp, boolean_t *case_conflict);
extern int dmu_snapshot_lookup(objset_t *os, const char *name, uint64_t *val);
diff --git a/include/sys/dmu_objset.h b/include/sys/dmu_objset.h
index edf362f7f..cbf0394e6 100644
--- a/include/sys/dmu_objset.h
+++ b/include/sys/dmu_objset.h
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -85,15 +85,16 @@ struct objset {
zilog_t *os_zil;
/* can change, under dsl_dir's locks: */
- uint8_t os_checksum;
- uint8_t os_compress;
+ enum zio_checksum os_checksum;
+ enum zio_compress os_compress;
uint8_t os_copies;
- uint8_t os_dedup_checksum;
- uint8_t os_dedup_verify;
- uint8_t os_logbias;
- uint8_t os_primary_cache;
- uint8_t os_secondary_cache;
- uint8_t os_sync;
+ enum zio_checksum os_dedup_checksum;
+ boolean_t os_dedup_verify;
+ zfs_logbias_op_t os_logbias;
+ zfs_cache_type_t os_primary_cache;
+ zfs_cache_type_t os_secondary_cache;
+ zfs_sync_type_t os_sync;
+ zfs_redundant_metadata_type_t os_redundant_metadata;
/* no lock needed: */
struct dmu_tx *os_synctx; /* XXX sketchy */
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index 53f2718ab..5371e12ef 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
@@ -149,6 +149,7 @@ typedef enum {
ZFS_PROP_SELINUX_DEFCONTEXT,
ZFS_PROP_SELINUX_ROOTCONTEXT,
ZFS_PROP_RELATIME,
+ ZFS_PROP_REDUNDANT_METADATA,
ZFS_NUM_PROPS
} zfs_prop_t;
@@ -349,6 +350,11 @@ typedef enum {
ZFS_XATTR_SA = 2
} zfs_xattr_type_t;
+typedef enum {
+ ZFS_REDUNDANT_METADATA_ALL,
+ ZFS_REDUNDANT_METADATA_MOST
+} zfs_redundant_metadata_type_t;
+
/*
* On-disk version number.
*/