From 61868bb14d33e9b787ab810533c359888c1c76db Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Fri, 9 Oct 2020 18:34:54 +0200 Subject: zil_parse: make callback parameters const Code cleanup, a follow up commit to 4d55ea81. Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Co-authored-by: Ryan Moeller Signed-off-by: Christian Schwarz Closes #11020 --- module/zfs/dmu_traverse.c | 6 ++++-- module/zfs/dsl_scan.c | 10 ++++++---- module/zfs/zil.c | 25 ++++++++++++++++--------- 3 files changed, 26 insertions(+), 15 deletions(-) (limited to 'module/zfs') diff --git a/module/zfs/dmu_traverse.c b/module/zfs/dmu_traverse.c index 83830fe39..31db49dae 100644 --- a/module/zfs/dmu_traverse.c +++ b/module/zfs/dmu_traverse.c @@ -73,7 +73,8 @@ static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *, uint64_t objset, uint64_t object); static int -traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) +traverse_zil_block(zilog_t *zilog, const blkptr_t *bp, void *arg, + uint64_t claim_txg) { traverse_data_t *td = arg; zbookmark_phys_t zb; @@ -93,7 +94,8 @@ traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) } static int -traverse_zil_record(zilog_t *zilog, lr_t *lrc, void *arg, uint64_t claim_txg) +traverse_zil_record(zilog_t *zilog, const lr_t *lrc, void *arg, + uint64_t claim_txg) { traverse_data_t *td = arg; diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 0ebda2f77..4704781bf 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -1375,7 +1375,8 @@ typedef struct zil_scan_arg { /* ARGSUSED */ static int -dsl_scan_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) +dsl_scan_zil_block(zilog_t *zilog, const blkptr_t *bp, void *arg, + uint64_t claim_txg) { zil_scan_arg_t *zsa = arg; dsl_pool_t *dp = zsa->zsa_dp; @@ -1405,15 +1406,16 @@ dsl_scan_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) /* ARGSUSED */ static int -dsl_scan_zil_record(zilog_t *zilog, lr_t *lrc, void *arg, uint64_t claim_txg) +dsl_scan_zil_record(zilog_t *zilog, const lr_t *lrc, void *arg, + uint64_t claim_txg) { if (lrc->lrc_txtype == TX_WRITE) { zil_scan_arg_t *zsa = arg; dsl_pool_t *dp = zsa->zsa_dp; dsl_scan_t *scn = dp->dp_scan; zil_header_t *zh = zsa->zsa_zh; - lr_write_t *lr = (lr_write_t *)lrc; - blkptr_t *bp = &lr->lr_blkptr; + const lr_write_t *lr = (const lr_write_t *)lrc; + const blkptr_t *bp = &lr->lr_blkptr; zbookmark_phys_t zb; ASSERT(!BP_IS_REDACTED(bp)); diff --git a/module/zfs/zil.c b/module/zfs/zil.c index 9dc20ba14..632fef29b 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -432,7 +432,8 @@ done: /* ARGSUSED */ static int -zil_clear_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) +zil_clear_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx, + uint64_t first_txg) { ASSERT(!BP_IS_HOLE(bp)); @@ -454,13 +455,15 @@ zil_clear_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) /* ARGSUSED */ static int -zil_noop_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t first_txg) +zil_noop_log_record(zilog_t *zilog, const lr_t *lrc, void *tx, + uint64_t first_txg) { return (0); } static int -zil_claim_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) +zil_claim_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx, + uint64_t first_txg) { /* * Claim log block if not already committed and not already claimed. @@ -476,7 +479,8 @@ zil_claim_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) } static int -zil_claim_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t first_txg) +zil_claim_log_record(zilog_t *zilog, const lr_t *lrc, void *tx, + uint64_t first_txg) { lr_write_t *lr = (lr_write_t *)lrc; int error; @@ -503,7 +507,8 @@ zil_claim_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t first_txg) /* ARGSUSED */ static int -zil_free_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t claim_txg) +zil_free_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx, + uint64_t claim_txg) { zio_free(zilog->zl_spa, dmu_tx_get_txg(tx), bp); @@ -511,7 +516,8 @@ zil_free_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t claim_txg) } static int -zil_free_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t claim_txg) +zil_free_log_record(zilog_t *zilog, const lr_t *lrc, void *tx, + uint64_t claim_txg) { lr_write_t *lr = (lr_write_t *)lrc; blkptr_t *bp = &lr->lr_blkptr; @@ -3471,7 +3477,7 @@ typedef struct zil_replay_arg { } zil_replay_arg_t; static int -zil_replay_error(zilog_t *zilog, lr_t *lr, int error) +zil_replay_error(zilog_t *zilog, const lr_t *lr, int error) { char name[ZFS_MAX_DATASET_NAME_LEN]; @@ -3489,7 +3495,8 @@ zil_replay_error(zilog_t *zilog, lr_t *lr, int error) } static int -zil_replay_log_record(zilog_t *zilog, lr_t *lr, void *zra, uint64_t claim_txg) +zil_replay_log_record(zilog_t *zilog, const lr_t *lr, void *zra, + uint64_t claim_txg) { zil_replay_arg_t *zr = zra; const zil_header_t *zh = zilog->zl_header; @@ -3572,7 +3579,7 @@ zil_replay_log_record(zilog_t *zilog, lr_t *lr, void *zra, uint64_t claim_txg) /* ARGSUSED */ static int -zil_incr_blks(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) +zil_incr_blks(zilog_t *zilog, const blkptr_t *bp, void *arg, uint64_t claim_txg) { zilog->zl_replay_blks++; -- cgit v1.2.3