diff options
author | Christian Schwarz <[email protected]> | 2020-10-09 18:34:54 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-09 09:34:54 -0700 |
commit | 61868bb14d33e9b787ab810533c359888c1c76db (patch) | |
tree | 23a92ed157284525f5372783411fac5ee0f6c5e9 /cmd | |
parent | e9527d44e655fe6fda4f154b396a1e5890abc539 (diff) |
zil_parse: make callback parameters const
Code cleanup, a follow up commit to 4d55ea81.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Co-authored-by: Ryan Moeller <[email protected]>
Signed-off-by: Christian Schwarz <[email protected]>
Closes #11020
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zdb/zdb_il.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/cmd/zdb/zdb_il.c b/cmd/zdb/zdb_il.c index c12178eff..553765b71 100644 --- a/cmd/zdb/zdb_il.c +++ b/cmd/zdb/zdb_il.c @@ -62,9 +62,9 @@ print_log_bp(const blkptr_t *bp, const char *prefix) /* ARGSUSED */ static void -zil_prt_rec_create(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_create(zilog_t *zilog, int txtype, const void *arg) { - lr_create_t *lr = arg; + const lr_create_t *lr = arg; time_t crtime = lr->lr_crtime[0]; char *name, *link; lr_attr_t *lrattr; @@ -98,9 +98,9 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, void *arg) /* ARGSUSED */ static void -zil_prt_rec_remove(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_remove(zilog_t *zilog, int txtype, const void *arg) { - lr_remove_t *lr = arg; + const lr_remove_t *lr = arg; (void) printf("%sdoid %llu, name %s\n", tab_prefix, (u_longlong_t)lr->lr_doid, (char *)(lr + 1)); @@ -108,9 +108,9 @@ zil_prt_rec_remove(zilog_t *zilog, int txtype, void *arg) /* ARGSUSED */ static void -zil_prt_rec_link(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_link(zilog_t *zilog, int txtype, const void *arg) { - lr_link_t *lr = arg; + const lr_link_t *lr = arg; (void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix, (u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj, @@ -119,9 +119,9 @@ zil_prt_rec_link(zilog_t *zilog, int txtype, void *arg) /* ARGSUSED */ static void -zil_prt_rec_rename(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_rename(zilog_t *zilog, int txtype, const void *arg) { - lr_rename_t *lr = arg; + const lr_rename_t *lr = arg; char *snm = (char *)(lr + 1); char *tnm = snm + strlen(snm) + 1; @@ -148,11 +148,11 @@ zil_prt_rec_write_cb(void *data, size_t len, void *unused) /* ARGSUSED */ static void -zil_prt_rec_write(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg) { - lr_write_t *lr = arg; + const lr_write_t *lr = arg; abd_t *data; - blkptr_t *bp = &lr->lr_blkptr; + const blkptr_t *bp = &lr->lr_blkptr; zbookmark_phys_t zb; int verbose = MAX(dump_opt['d'], dump_opt['i']); int error; @@ -211,9 +211,9 @@ out: /* ARGSUSED */ static void -zil_prt_rec_truncate(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_truncate(zilog_t *zilog, int txtype, const void *arg) { - lr_truncate_t *lr = arg; + const lr_truncate_t *lr = arg; (void) printf("%sfoid %llu, offset 0x%llx, length 0x%llx\n", tab_prefix, (u_longlong_t)lr->lr_foid, (longlong_t)lr->lr_offset, @@ -222,9 +222,9 @@ zil_prt_rec_truncate(zilog_t *zilog, int txtype, void *arg) /* ARGSUSED */ static void -zil_prt_rec_setattr(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_setattr(zilog_t *zilog, int txtype, const void *arg) { - lr_setattr_t *lr = arg; + const lr_setattr_t *lr = arg; time_t atime = (time_t)lr->lr_atime[0]; time_t mtime = (time_t)lr->lr_mtime[0]; @@ -268,15 +268,15 @@ zil_prt_rec_setattr(zilog_t *zilog, int txtype, void *arg) /* ARGSUSED */ static void -zil_prt_rec_acl(zilog_t *zilog, int txtype, void *arg) +zil_prt_rec_acl(zilog_t *zilog, int txtype, const void *arg) { - lr_acl_t *lr = arg; + const lr_acl_t *lr = arg; (void) printf("%sfoid %llu, aclcnt %llu\n", tab_prefix, (u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_aclcnt); } -typedef void (*zil_prt_rec_func_t)(zilog_t *, int, void *); +typedef void (*zil_prt_rec_func_t)(zilog_t *, int, const void *); typedef struct zil_rec_info { zil_prt_rec_func_t zri_print; const char *zri_name; @@ -309,7 +309,7 @@ static zil_rec_info_t zil_rec_info[TX_MAX_TYPE] = { /* ARGSUSED */ static int -print_log_record(zilog_t *zilog, lr_t *lr, void *arg, uint64_t claim_txg) +print_log_record(zilog_t *zilog, const lr_t *lr, void *arg, uint64_t claim_txg) { int txtype; int verbose = MAX(dump_opt['d'], dump_opt['i']); @@ -343,7 +343,8 @@ print_log_record(zilog_t *zilog, lr_t *lr, void *arg, uint64_t claim_txg) /* ARGSUSED */ static int -print_log_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) +print_log_block(zilog_t *zilog, const blkptr_t *bp, void *arg, + uint64_t claim_txg) { char blkbuf[BP_SPRINTF_LEN + 10]; int verbose = MAX(dump_opt['d'], dump_opt['i']); |