]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ddt: remove struct names and forward declarations
authorRob Norris <rob.norris@klarasystems.com>
Mon, 3 Jul 2023 02:43:37 +0000 (12:43 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 15 Feb 2024 19:45:24 +0000 (11:45 -0800)
Things get confused when there's more than one name for a thing.

Note that we don't do this for ddt_object_t, ddt_histogram_t and
ddt_stat_t because they're part of the public ZFS interface.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: iXsystems, Inc.
Closes #15887

include/sys/ddt.h
include/sys/ddt_impl.h
include/sys/spa.h

index a11324209dede30574712553d7bfb33ff1f42db4..013692c96dca602a2f3b152494ecdf45787d4a30 100644 (file)
@@ -68,7 +68,7 @@ _Static_assert(DDT_CLASSES < UINT8_MAX,
 /*
  * On-disk ddt entry:  key (name) and physical storage (value).
  */
-typedef struct ddt_key {
+typedef struct {
        zio_cksum_t     ddk_cksum;      /* 256-bit block checksum */
        /*
         * Encoded with logical & physical size, encryption, and compression,
@@ -96,7 +96,7 @@ typedef struct ddt_key {
 #define        DDK_GET_CRYPT(ddk)              BF64_GET((ddk)->ddk_prop, 39, 1)
 #define        DDK_SET_CRYPT(ddk, x)   BF64_SET((ddk)->ddk_prop, 39, 1, x)
 
-typedef struct ddt_phys {
+typedef struct {
        dva_t           ddp_dva[SPA_DVAS_PER_BP];
        uint64_t        ddp_refcnt;
        uint64_t        ddp_phys_birth;
@@ -117,7 +117,7 @@ enum ddt_phys_type {
 /*
  * In-core ddt entry
  */
-struct ddt_entry {
+typedef struct {
        /* key must be first for ddt_key_compare */
        ddt_key_t       dde_key;
        ddt_phys_t      dde_phys[DDT_PHYS_TYPES];
@@ -129,12 +129,12 @@ struct ddt_entry {
        uint8_t         dde_loaded;
        kcondvar_t      dde_cv;
        avl_node_t      dde_node;
-};
+} ddt_entry_t;
 
 /*
  * In-core ddt
  */
-struct ddt {
+typedef struct {
        kmutex_t        ddt_lock;
        avl_tree_t      ddt_tree;
        avl_tree_t      ddt_repair_tree;
@@ -147,12 +147,12 @@ struct ddt {
        ddt_histogram_t ddt_histogram_cache[DDT_TYPES][DDT_CLASSES];
        ddt_object_t    ddt_object_stats[DDT_TYPES][DDT_CLASSES];
        avl_node_t      ddt_node;
-};
+} ddt_t;
 
 /*
  * In-core and on-disk bookmark for DDT walks
  */
-typedef struct ddt_bookmark {
+typedef struct {
        uint64_t        ddb_class;
        uint64_t        ddb_type;
        uint64_t        ddb_checksum;
index 9960f966684d7c3befdcc481197d3281f5eae4d3..09937c714615849dba1d252d3803e53450115686 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 /*
  * Ops vector to access a specific DDT object type.
  */
-typedef struct ddt_ops {
+typedef struct {
        char ddt_op_name[32];
        int (*ddt_op_create)(objset_t *os, uint64_t *object, dmu_tx_t *tx,
            boolean_t prehash);
index 08099cd4fa29f35fd0264e251bd4997d187eb216..cada3c8410371c88886aeae72f413648f3106a2e 100644 (file)
@@ -62,8 +62,6 @@ typedef struct metaslab_class metaslab_class_t;
 typedef struct zio zio_t;
 typedef struct zilog zilog_t;
 typedef struct spa_aux_vdev spa_aux_vdev_t;
-typedef struct ddt ddt_t;
-typedef struct ddt_entry ddt_entry_t;
 typedef struct zbookmark_phys zbookmark_phys_t;
 typedef struct zbookmark_err_phys zbookmark_err_phys_t;