aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorChristian Schwarz <[email protected]>2020-10-09 18:34:54 +0200
committerGitHub <[email protected]>2020-10-09 09:34:54 -0700
commit61868bb14d33e9b787ab810533c359888c1c76db (patch)
tree23a92ed157284525f5372783411fac5ee0f6c5e9 /module/zfs
parente9527d44e655fe6fda4f154b396a1e5890abc539 (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 'module/zfs')
-rw-r--r--module/zfs/dmu_traverse.c6
-rw-r--r--module/zfs/dsl_scan.c10
-rw-r--r--module/zfs/zil.c25
3 files changed, 26 insertions, 15 deletions
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++;