3397 zdb <pool> <objnum> output is too verbose
3398 zdb can't dump feature flags zap objects

Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@nexenta.com>

References:
  illumos/illumos-gate@e690fb27a7
  https://www.illumos.org/issues/3397
  https://www.illumos.org/issues/3398

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Christopher Siden 2013-01-11 16:42:50 -08:00 committed by Brian Behlendorf
parent 5990da81a7
commit e6f7d01502
1 changed files with 17 additions and 9 deletions

View File

@ -67,7 +67,9 @@
#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ #define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \
dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \
dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN")
#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) #define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : \
(((idx) == DMU_OTN_ZAP_DATA || (idx) == DMU_OTN_ZAP_METADATA) ? \
DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES))
#ifndef lint #ifndef lint
extern int zfs_recover; extern int zfs_recover;
@ -3207,7 +3209,13 @@ main(int argc, char **argv)
argv[i], strerror(errno)); argv[i], strerror(errno));
} }
} }
(os != NULL) ? dump_dir(os) : dump_zpool(spa); if (os != NULL) {
dump_dir(os);
} else if (zopt_objects > 0 && !dump_opt['m']) {
dump_dir(spa->spa_meta_objset);
} else {
dump_zpool(spa);
}
} else { } else {
flagbits['b'] = ZDB_FLAG_PRINT_BLKPTR; flagbits['b'] = ZDB_FLAG_PRINT_BLKPTR;
flagbits['c'] = ZDB_FLAG_CHECKSUM; flagbits['c'] = ZDB_FLAG_CHECKSUM;