]> git.proxmox.com Git - mirror_zfs.git/blobdiff - include/sys/dmu.h
Pool allocation classes
[mirror_zfs.git] / include / sys / dmu.h
index 44c026286dd2dfc6a78e37af2e70c7c877609cb0..bc7046fdced8d56499ae826e65fd0eee8e0e319f 100644 (file)
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2018 by Delphix. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  * Copyright 2014 HybridCluster. All rights reserved.
  * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
  * Copyright 2013 Saso Kiselkov. All rights reserved.
+ * Copyright (c) 2017, Intel Corporation.
  */
 
 /* Portions Copyright 2010 Robert Milkowski */
@@ -107,7 +108,8 @@ typedef enum dmu_object_byteswap {
 /*
  * Defines a uint8_t object type. Object types specify if the data
  * in the object is metadata (boolean) and how to byteswap the data
- * (dmu_object_byteswap_t).
+ * (dmu_object_byteswap_t). All of the types created by this method
+ * are cached in the dbuf metadata cache.
  */
 #define        DMU_OT(byteswap, metadata, encrypted) \
        (DMU_OT_NEWTYPE | \
@@ -119,6 +121,9 @@ typedef enum dmu_object_byteswap {
        ((ot) & DMU_OT_BYTESWAP_MASK) < DMU_BSWAP_NUMFUNCS : \
        (ot) < DMU_OT_NUMTYPES)
 
+#define        DMU_OT_IS_METADATA_CACHED(ot) (((ot) & DMU_OT_NEWTYPE) ? \
+       B_TRUE : dmu_ot[(ot)].ot_dbuf_metadata_cache)
+
 /*
  * MDB doesn't have dmu_ot; it defines these macros itself.
  */
@@ -132,6 +137,16 @@ typedef enum dmu_object_byteswap {
        ((ot) & DMU_OT_METADATA) : \
        DMU_OT_IS_METADATA_IMPL(ot))
 
+#define        DMU_OT_IS_DDT(ot) \
+       ((ot) == DMU_OT_DDT_ZAP)
+
+#define        DMU_OT_IS_ZIL(ot) \
+       ((ot) == DMU_OT_INTENT_LOG)
+
+/* Note: ztest uses DMU_OT_UINT64_OTHER as a proxy for file blocks */
+#define        DMU_OT_IS_FILE(ot) \
+       ((ot) == DMU_OT_PLAIN_FILE_CONTENTS || (ot) == DMU_OT_UINT64_OTHER)
+
 #define        DMU_OT_IS_ENCRYPTED(ot) (((ot) & DMU_OT_NEWTYPE) ? \
        ((ot) & DMU_OT_ENCRYPTED) : \
        DMU_OT_IS_ENCRYPTED_IMPL(ot))
@@ -222,7 +237,7 @@ typedef enum dmu_object_type {
         * values.
         *
         * The DMU_OTN_* types do not have entries in the dmu_ot table,
-        * use the DMU_OT_IS_METDATA() and DMU_OT_BYTESWAP() macros instead
+        * use the DMU_OT_IS_METADATA() and DMU_OT_BYTESWAP() macros instead
         * of indexing into dmu_ot directly (this works for both DMU_OT_* types
         * and DMU_OTN_* types).
         */
@@ -366,6 +381,7 @@ typedef struct dmu_buf {
 #define        DMU_POOL_REMOVING               "com.delphix:removing"
 #define        DMU_POOL_OBSOLETE_BPOBJ         "com.delphix:obsolete_bpobj"
 #define        DMU_POOL_CONDENSING_INDIRECT    "com.delphix:condensing_indirect"
+#define        DMU_POOL_ZPOOL_CHECKPOINT       "com.delphix:zpool_checkpoint"
 
 /*
  * Allocate an object from this objset.  The range of object numbers
@@ -384,6 +400,9 @@ typedef struct dmu_buf {
  */
 uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot,
     int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx);
+uint64_t dmu_object_alloc_ibs(objset_t *os, dmu_object_type_t ot, int blocksize,
+    int indirect_blockshift,
+    dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx);
 uint64_t dmu_object_alloc_dnsize(objset_t *os, dmu_object_type_t ot,
     int blocksize, dmu_object_type_t bonus_type, int bonus_len,
     int dnodesize, dmu_tx_t *tx);
@@ -882,6 +901,7 @@ typedef void (*const arc_byteswap_func_t)(void *buf, size_t size);
 typedef struct dmu_object_type_info {
        dmu_object_byteswap_t   ot_byteswap;
        boolean_t               ot_metadata;
+       boolean_t               ot_dbuf_metadata_cache;
        boolean_t               ot_encrypt;
        char                    *ot_name;
 } dmu_object_type_info_t;
@@ -962,7 +982,7 @@ uint64_t dmu_objset_fsid_guid(objset_t *os);
 /*
  * Get the [cm]time for an objset's snapshot dir
  */
-timestruc_t dmu_objset_snap_cmtime(objset_t *os);
+inode_timespec_t dmu_objset_snap_cmtime(objset_t *os);
 
 int dmu_objset_is_snapshot(objset_t *os);