Skip to content

Commit

Permalink
New -z option controls zap decode of directories
Browse files Browse the repository at this point in the history
With a -z, only the zap stats are printed.  With -zz, no zap decoding
is done at all.
  • Loading branch information
dweeezil committed May 6, 2016
1 parent 1411109 commit e2482cd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,15 @@ dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size)
/* 15 */ "15 (invalid)",
};

if (dump_opt['z'] > 1)
return;

dump_zap_stats(os, object);
(void) printf("\n");

if (dump_opt['z'])
return;

for (zap_cursor_init(&zc, os, object);
zap_cursor_retrieve(&zc, &attr) == 0;
zap_cursor_advance(&zc)) {
Expand Down Expand Up @@ -3713,7 +3719,7 @@ main(int argc, char **argv)
spa_config_path = spa_config_path_env;

while ((c = getopt(argc, argv,
"bcdhilmMI:suCDRSAFLXx:evp:t:U:PV")) != -1) {
"bcdhilmMI:suCDRSAFLXx:evp:t:U:PVz")) != -1) {
switch (c) {
case 'b':
case 'c':
Expand All @@ -3738,6 +3744,7 @@ main(int argc, char **argv)
case 'X':
case 'e':
case 'P':
case 'z':
dump_opt[c]++;
break;
case 'V':
Expand Down

0 comments on commit e2482cd

Please sign in to comment.