Print this page
*** NO COMMENTS ***


2094 
2095         return (ZIO_PIPELINE_CONTINUE);
2096 }
2097 
2098 ddt_entry_t *freedde; /* for debugging */
2099 
2100 static int
2101 zio_ddt_free(zio_t *zio)
2102 {
2103         spa_t *spa = zio->io_spa;
2104         blkptr_t *bp = zio->io_bp;
2105         ddt_t *ddt = ddt_select(spa, bp);
2106         ddt_entry_t *dde;
2107         ddt_phys_t *ddp;
2108 
2109         ASSERT(BP_GET_DEDUP(bp));
2110         ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL);
2111 
2112         ddt_enter(ddt);
2113         freedde = dde = ddt_lookup(ddt, bp, B_TRUE);

2114         ddp = ddt_phys_select(dde, bp);

2115         ddt_phys_decref(ddp);


2116         ddt_exit(ddt);
2117 
2118         return (ZIO_PIPELINE_CONTINUE);
2119 }
2120 
2121 /*
2122  * ==========================================================================
2123  * Allocate and free blocks
2124  * ==========================================================================
2125  */
2126 static int
2127 zio_dva_allocate(zio_t *zio)
2128 {
2129         spa_t *spa = zio->io_spa;
2130         metaslab_class_t *mc = spa_normal_class(spa);
2131         blkptr_t *bp = zio->io_bp;
2132         int error;
2133         int flags = 0;
2134 
2135         if (zio->io_gang_leader == NULL) {




2094 
2095         return (ZIO_PIPELINE_CONTINUE);
2096 }
2097 
2098 ddt_entry_t *freedde; /* for debugging */
2099 
2100 static int
2101 zio_ddt_free(zio_t *zio)
2102 {
2103         spa_t *spa = zio->io_spa;
2104         blkptr_t *bp = zio->io_bp;
2105         ddt_t *ddt = ddt_select(spa, bp);
2106         ddt_entry_t *dde;
2107         ddt_phys_t *ddp;
2108 
2109         ASSERT(BP_GET_DEDUP(bp));
2110         ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL);
2111 
2112         ddt_enter(ddt);
2113         freedde = dde = ddt_lookup(ddt, bp, B_TRUE);
2114         if (dde) {
2115                 ddp = ddt_phys_select(dde, bp);
2116                 if (ddp) {
2117                         ddt_phys_decref(ddp);
2118                 }
2119         }
2120         ddt_exit(ddt);
2121 
2122         return (ZIO_PIPELINE_CONTINUE);
2123 }
2124 
2125 /*
2126  * ==========================================================================
2127  * Allocate and free blocks
2128  * ==========================================================================
2129  */
2130 static int
2131 zio_dva_allocate(zio_t *zio)
2132 {
2133         spa_t *spa = zio->io_spa;
2134         metaslab_class_t *mc = spa_normal_class(spa);
2135         blkptr_t *bp = zio->io_bp;
2136         int error;
2137         int flags = 0;
2138 
2139         if (zio->io_gang_leader == NULL) {