1 #define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ 2 zio_compress_table[(idx)].ci_name : "UNKNOWN") 3 #define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ 4 zio_checksum_table[(idx)].ci_name : "UNKNOWN") 5 #define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : \ 6 (idx) == DMU_OTN_ZAP_DATA || (idx) == DMU_OTN_ZAP_METADATA ? \ 7 DMU_OT_ZAP_OTHER : \ 8 (idx) == DMU_OTN_UINT64_DATA || (idx) == DMU_OTN_UINT64_METADATA ? \ 9 DMU_OT_UINT64_OTHER : DMU_OT_NUMTYPES) 10 11 /* Some platforms require part of inode IDs to be remapped */ 12 #ifdef __APPLE__ 13 #define ZDB_MAP_OBJECT_ID(obj) INO_XNUTOZFS(obj, 2) 14 #else 15 #define ZDB_MAP_OBJECT_ID(obj) (obj) 16 #endif 17 18 #define ZOR_FLAG_PLAIN_FILE 0x0001 19 #define ZOR_FLAG_DIRECTORY 0x0002 20 #define ZOR_FLAG_SPACE_MAP 0x0004 21 #define ZOR_FLAG_ZAP 0x0008 22 #define ZOR_FLAG_ZVOL 0x0010 23 #define ZOR_FLAG_ALL_TYPES -1 24 #define ZOR_SUPPORTED_FLAGS (ZOR_FLAG_PLAIN_FILE | \ 25 ZOR_FLAG_DIRECTORY | \ 26 ZOR_FLAG_SPACE_MAP | \ 27 ZOR_FLAG_ZVOL | \ 28 ZOR_FLAG_ZAP) 29 30 #define ZDB_FLAG_CHECKSUM 0x0001 31 #define ZDB_FLAG_DECOMPRESS 0x0002 32 #define ZDB_FLAG_BSWAP 0x0004 33 #define ZDB_FLAG_GBH 0x0008 34 #define ZDB_FLAG_INDIRECT 0x0010 35 #define ZDB_FLAG_RAW 0x0020 36 #define ZDB_FLAG_PRINT_BLKPTR 0x0040 37 #define ZDB_FLAG_VERBOSE 0x0080 38 39 40 typedef struct zdb_ctx { 41 } zdb_ctx_t; 42 43 typedef struct zopt_object_range { 44 uint64_t zor_obj_start; 45 uint64_t zor_obj_end; 46 uint64_t zor_flags; 47 } zopt_object_range_t; 48 49 50 typedef struct sublivelist_verify { 51 /* FREE's that haven't yet matched to an ALLOC, in one sub-livelist */ 52 zfs_btree_t sv_pair; 53 54 /* ALLOC's without a matching FREE, accumulates across sub-livelists */ 55 zfs_btree_t sv_leftover; 56 } sublivelist_verify_t; 57 58 typedef struct sublivelist_verify_block { 59 dva_t svb_dva; 60 61 /* 62 * We need this to check if the block marked as allocated 63 * in the livelist was freed (and potentially reallocated) 64 * in the metaslab spacemaps at a later TXG. 65 */ 66 uint64_t svb_allocated_txg; 67 } sublivelist_verify_block_t; 68 69 const char *zdb_ot_name(dmu_object_type_t type); 70 int livelist_compare(const void *larg, const void *rarg); 71