@@ -168,7 +168,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
168
168
(u_longlong_t )lr -> lr_foid , (u_longlong_t )lr -> lr_offset ,
169
169
(u_longlong_t )lr -> lr_length );
170
170
171
- if (txtype == TX_WRITE2 || verbose < 5 )
171
+ if (txtype == TX_WRITE2 || verbose < 4 )
172
172
return ;
173
173
174
174
if (lr -> lr_common .lrc_reclen == sizeof (lr_write_t )) {
@@ -178,6 +178,8 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
178
178
"will claim" : "won't claim" );
179
179
print_log_bp (bp , tab_prefix );
180
180
181
+ if (verbose < 5 )
182
+ return ;
181
183
if (BP_IS_HOLE (bp )) {
182
184
(void ) printf ("\t\t\tLSIZE 0x%llx\n" ,
183
185
(u_longlong_t )BP_GET_LSIZE (bp ));
@@ -202,6 +204,9 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
202
204
if (error )
203
205
goto out ;
204
206
} else {
207
+ if (verbose < 5 )
208
+ return ;
209
+
205
210
/* data is stored after the end of the lr_write record */
206
211
data = abd_alloc (lr -> lr_length , B_FALSE );
207
212
abd_copy_from_buf (data , lr + 1 , lr -> lr_length );
@@ -217,6 +222,28 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
217
222
abd_free (data );
218
223
}
219
224
225
+ static void
226
+ zil_prt_rec_write_enc (zilog_t * zilog , int txtype , const void * arg )
227
+ {
228
+ (void ) txtype ;
229
+ const lr_write_t * lr = arg ;
230
+ const blkptr_t * bp = & lr -> lr_blkptr ;
231
+ int verbose = MAX (dump_opt ['d' ], dump_opt ['i' ]);
232
+
233
+ (void ) printf ("%s(encrypted)\n" , tab_prefix );
234
+
235
+ if (verbose < 4 )
236
+ return ;
237
+
238
+ if (lr -> lr_common .lrc_reclen == sizeof (lr_write_t )) {
239
+ (void ) printf ("%shas blkptr, %s\n" , tab_prefix ,
240
+ !BP_IS_HOLE (bp ) &&
241
+ bp -> blk_birth >= spa_min_claim_txg (zilog -> zl_spa ) ?
242
+ "will claim" : "won't claim" );
243
+ print_log_bp (bp , tab_prefix );
244
+ }
245
+ }
246
+
220
247
static void
221
248
zil_prt_rec_truncate (zilog_t * zilog , int txtype , const void * arg )
222
249
{
@@ -312,11 +339,34 @@ zil_prt_rec_clone_range(zilog_t *zilog, int txtype, const void *arg)
312
339
{
313
340
(void ) zilog , (void ) txtype ;
314
341
const lr_clone_range_t * lr = arg ;
342
+ int verbose = MAX (dump_opt ['d' ], dump_opt ['i' ]);
315
343
316
344
(void ) printf ("%sfoid %llu, offset %llx, length %llx, blksize %llx\n" ,
317
345
tab_prefix , (u_longlong_t )lr -> lr_foid , (u_longlong_t )lr -> lr_offset ,
318
346
(u_longlong_t )lr -> lr_length , (u_longlong_t )lr -> lr_blksz );
319
347
348
+ if (verbose < 4 )
349
+ return ;
350
+
351
+ for (unsigned int i = 0 ; i < lr -> lr_nbps ; i ++ ) {
352
+ (void ) printf ("%s[%u/%llu] " , tab_prefix , i + 1 ,
353
+ (u_longlong_t )lr -> lr_nbps );
354
+ print_log_bp (& lr -> lr_bps [i ], "" );
355
+ }
356
+ }
357
+
358
+ static void
359
+ zil_prt_rec_clone_range_enc (zilog_t * zilog , int txtype , const void * arg )
360
+ {
361
+ (void ) zilog , (void ) txtype ;
362
+ const lr_clone_range_t * lr = arg ;
363
+ int verbose = MAX (dump_opt ['d' ], dump_opt ['i' ]);
364
+
365
+ (void ) printf ("%s(encrypted)\n" , tab_prefix );
366
+
367
+ if (verbose < 4 )
368
+ return ;
369
+
320
370
for (unsigned int i = 0 ; i < lr -> lr_nbps ; i ++ ) {
321
371
(void ) printf ("%s[%u/%llu] " , tab_prefix , i + 1 ,
322
372
(u_longlong_t )lr -> lr_nbps );
@@ -327,6 +377,7 @@ zil_prt_rec_clone_range(zilog_t *zilog, int txtype, const void *arg)
327
377
typedef void (* zil_prt_rec_func_t )(zilog_t * , int , const void * );
328
378
typedef struct zil_rec_info {
329
379
zil_prt_rec_func_t zri_print ;
380
+ zil_prt_rec_func_t zri_print_enc ;
330
381
const char * zri_name ;
331
382
uint64_t zri_count ;
332
383
} zil_rec_info_t ;
@@ -341,7 +392,9 @@ static zil_rec_info_t zil_rec_info[TX_MAX_TYPE] = {
341
392
{.zri_print = zil_prt_rec_remove , .zri_name = "TX_RMDIR " },
342
393
{.zri_print = zil_prt_rec_link , .zri_name = "TX_LINK " },
343
394
{.zri_print = zil_prt_rec_rename , .zri_name = "TX_RENAME " },
344
- {.zri_print = zil_prt_rec_write , .zri_name = "TX_WRITE " },
395
+ {.zri_print = zil_prt_rec_write ,
396
+ .zri_print_enc = zil_prt_rec_write_enc ,
397
+ .zri_name = "TX_WRITE " },
345
398
{.zri_print = zil_prt_rec_truncate , .zri_name = "TX_TRUNCATE " },
346
399
{.zri_print = zil_prt_rec_setattr , .zri_name = "TX_SETATTR " },
347
400
{.zri_print = zil_prt_rec_acl , .zri_name = "TX_ACL_V0 " },
@@ -358,6 +411,7 @@ static zil_rec_info_t zil_rec_info[TX_MAX_TYPE] = {
358
411
{.zri_print = zil_prt_rec_rename , .zri_name = "TX_RENAME_EXCHANGE " },
359
412
{.zri_print = zil_prt_rec_rename , .zri_name = "TX_RENAME_WHITEOUT " },
360
413
{.zri_print = zil_prt_rec_clone_range ,
414
+ .zri_print_enc = zil_prt_rec_clone_range_enc ,
361
415
.zri_name = "TX_CLONE_RANGE " },
362
416
};
363
417
@@ -384,6 +438,8 @@ print_log_record(zilog_t *zilog, const lr_t *lr, void *arg, uint64_t claim_txg)
384
438
if (txtype && verbose >= 3 ) {
385
439
if (!zilog -> zl_os -> os_encrypted ) {
386
440
zil_rec_info [txtype ].zri_print (zilog , txtype , lr );
441
+ } else if (zil_rec_info [txtype ].zri_print_enc ) {
442
+ zil_rec_info [txtype ].zri_print_enc (zilog , txtype , lr );
387
443
} else {
388
444
(void ) printf ("%s(encrypted)\n" , tab_prefix );
389
445
}
0 commit comments