6 #include <openssl/evp.h>
7 #include <sys/zfs_context.h>
9 #include <sys/spa_impl.h>
12 #include <sys/fs/zfs.h>
13 #include <sys/zfs_znode.h>
14 #include <sys/zfs_sa.h>
16 #include <sys/sa_impl.h>
18 #include <sys/vdev_impl.h>
19 #include <sys/metaslab_impl.h>
20 #include <sys/dmu_objset.h>
21 #include <sys/dsl_dir.h>
22 #include <sys/dsl_dataset.h>
23 #include <sys/dsl_pool.h>
24 #include <sys/dsl_bookmark.h>
27 #include <sys/zil_impl.h>
29 #include <sys/resource.h>
30 #include <sys/dmu_send.h>
31 #include <sys/dmu_traverse.h>
32 #include <sys/zio_checksum.h>
33 #include <sys/zio_compress.h>
34 #include <sys/zfs_fuid.h>
36 #include <sys/arc_impl.h>
38 #include <sys/zfeature.h>
40 #include <sys/blkptr.h>
41 #include <sys/dsl_crypt.h>
42 #include <sys/dsl_scan.h>
43 #include <sys/btree.h>
45 #include <sys/brt_impl.h>
46 #include <zfs_comutil.h>
47 #include <sys/zstd/zstd.h>
49 #include <libnvpair.h>
55 zdb_ot_name(dmu_object_type_t type
)
57 if (type
< DMU_OT_NUMTYPES
)
58 return (dmu_ot
[type
].ot_name
);
59 else if ((type
& DMU_OT_NEWTYPE
) &&
60 ((type
& DMU_OT_BYTESWAP_MASK
) < DMU_BSWAP_NUMFUNCS
))
61 return (dmu_ot_byteswap
[type
& DMU_OT_BYTESWAP_MASK
].ob_name
);
67 livelist_compare(const void *larg
, const void *rarg
)
69 const blkptr_t
*l
= larg
;
70 const blkptr_t
*r
= rarg
;
72 /* Sort them according to dva[0] */
73 uint64_t l_dva0_vdev
, r_dva0_vdev
;
74 l_dva0_vdev
= DVA_GET_VDEV(&l
->blk_dva
[0]);
75 r_dva0_vdev
= DVA_GET_VDEV(&r
->blk_dva
[0]);
76 if (l_dva0_vdev
< r_dva0_vdev
)
78 else if (l_dva0_vdev
> r_dva0_vdev
)
81 /* if vdevs are equal, sort by offsets. */
82 uint64_t l_dva0_offset
;
83 uint64_t r_dva0_offset
;
84 l_dva0_offset
= DVA_GET_OFFSET(&l
->blk_dva
[0]);
85 r_dva0_offset
= DVA_GET_OFFSET(&r
->blk_dva
[0]);
86 if (l_dva0_offset
< r_dva0_offset
) {
88 } else if (l_dva0_offset
> r_dva0_offset
) {
93 * Since we're storing blkptrs without cancelling FREE/ALLOC pairs,
94 * it's possible the offsets are equal. In that case, sort by txg
96 if (BP_GET_LOGICAL_BIRTH(l
) < BP_GET_LOGICAL_BIRTH(r
)) {
98 } else if (BP_GET_LOGICAL_BIRTH(l
) > BP_GET_LOGICAL_BIRTH(r
)) {