ARGSUSED */
| 110 | |
| 111 | /* ARGSUSED */ |
| 112 | static int |
| 113 | diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, |
| 114 | const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) |
| 115 | { |
| 116 | dmu_diffarg_t *da = arg; |
| 117 | int err = 0; |
| 118 | |
| 119 | if (issig(JUSTLOOKING) && issig(FORREAL)) |
| 120 | return (SET_ERROR(EINTR)); |
| 121 | |
| 122 | if (zb->zb_level == ZB_DNODE_LEVEL || |
| 123 | zb->zb_object != DMU_META_DNODE_OBJECT) |
| 124 | return (0); |
| 125 | |
| 126 | if (BP_IS_HOLE(bp)) { |
| 127 | uint64_t span = DBP_SPAN(dnp, zb->zb_level); |
| 128 | uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT; |
| 129 | |
| 130 | err = report_free_dnode_range(da, dnobj, |
| 131 | dnobj + (span >> DNODE_SHIFT) - 1); |
| 132 | if (err) |
| 133 | return (err); |
| 134 | } else if (zb->zb_level == 0) { |
| 135 | dnode_phys_t *blk; |
| 136 | arc_buf_t *abuf; |
| 137 | arc_flags_t aflags = ARC_FLAG_WAIT; |
| 138 | int epb = BP_GET_LSIZE(bp) >> DNODE_SHIFT; |
| 139 | int zio_flags = ZIO_FLAG_CANFAIL; |
| 140 | int i; |
| 141 | |
| 142 | if (BP_IS_PROTECTED(bp)) |
| 143 | zio_flags |= ZIO_FLAG_RAW; |
| 144 | |
| 145 | if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf, |
| 146 | ZIO_PRIORITY_ASYNC_READ, zio_flags, &aflags, zb) != 0) |
| 147 | return (SET_ERROR(EIO)); |
| 148 | |
| 149 | blk = abuf->b_data; |
| 150 | for (i = 0; i < epb; i += blk[i].dn_extra_slots + 1) { |
| 151 | uint64_t dnobj = (zb->zb_blkid << |
| 152 | (DNODE_BLOCK_SHIFT - DNODE_SHIFT)) + i; |
| 153 | err = report_dnode(da, dnobj, blk+i); |
| 154 | if (err) |
| 155 | break; |
| 156 | } |
| 157 | arc_buf_destroy(abuf, &abuf); |
| 158 | if (err) |
| 159 | return (err); |
| 160 | /* Don't care about the data blocks */ |
| 161 | return (TRAVERSE_VISIT_NO_CHILDREN); |
| 162 | } |
| 163 | return (0); |
| 164 | } |
| 165 | |
| 166 | int |
| 167 | dmu_diff(const char *tosnap_name, const char *fromsnap_name, |
nothing calls this directly
no test coverage detected