diff options
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/arc.c | 2 | ||||
-rw-r--r-- | module/zfs/dbuf.c | 1 | ||||
-rw-r--r-- | module/zfs/spa.c | 6 | ||||
-rw-r--r-- | module/zfs/txg.c | 8 | ||||
-rw-r--r-- | module/zfs/zfs_replay.c | 91 | ||||
-rw-r--r-- | module/zfs/zil.c | 4 | ||||
-rw-r--r-- | module/zfs/zvol.c | 44 |
7 files changed, 95 insertions, 61 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 6256fed2b..5757f3487 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -4935,6 +4935,7 @@ arc_kmem_reap_now(void) * This possible deadlock is avoided by always acquiring a hash lock * using mutex_tryenter() from arc_reclaim_thread(). */ +/* ARGSUSED */ static void arc_reclaim_thread(void *unused) { @@ -8687,6 +8688,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz) * This thread feeds the L2ARC at regular intervals. This is the beating * heart of the L2ARC. */ +/* ARGSUSED */ static void l2arc_feed_thread(void *unused) { diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index c954dec1b..718f63f74 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -540,6 +540,7 @@ dbuf_evict_one(void) * of the dbuf cache is at or below the maximum size. Once the dbuf is aged * out of the cache it is destroyed and becomes eligible for arc eviction. */ +/* ARGSUSED */ static void dbuf_evict_thread(void *unused) { diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 241c2a6ac..cef05545a 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -6126,7 +6126,7 @@ static void spa_async_thread(void *arg) { spa_t *spa = (spa_t *)arg; - int tasks, i; + int tasks; ASSERT(spa->spa_sync_on); @@ -6164,9 +6164,9 @@ spa_async_thread(void *arg) if (tasks & SPA_ASYNC_REMOVE) { spa_vdev_state_enter(spa, SCL_NONE); spa_async_remove(spa, spa->spa_root_vdev); - for (i = 0; i < spa->spa_l2cache.sav_count; i++) + for (int i = 0; i < spa->spa_l2cache.sav_count; i++) spa_async_remove(spa, spa->spa_l2cache.sav_vdevs[i]); - for (i = 0; i < spa->spa_spares.sav_count; i++) + for (int i = 0; i < spa->spa_spares.sav_count; i++) spa_async_remove(spa, spa->spa_spares.sav_vdevs[i]); (void) spa_vdev_state_exit(spa, NULL, 0); } diff --git a/module/zfs/txg.c b/module/zfs/txg.c index 8b1ec9c05..b26744115 100644 --- a/module/zfs/txg.c +++ b/module/zfs/txg.c @@ -108,8 +108,8 @@ * now transition to the syncing state. */ -static void txg_sync_thread(void *dp); -static void txg_quiesce_thread(void *dp); +static void txg_sync_thread(void *arg); +static void txg_quiesce_thread(void *arg); int zfs_txg_timeout = 5; /* max seconds worth of delta per txg */ @@ -479,7 +479,7 @@ txg_wait_callbacks(dsl_pool_t *dp) static void txg_sync_thread(void *arg) { - dsl_pool_t *dp = (dsl_pool_t *)arg; + dsl_pool_t *dp = arg; spa_t *spa = dp->dp_spa; tx_state_t *tx = &dp->dp_tx; callb_cpr_t cpr; @@ -564,7 +564,7 @@ txg_sync_thread(void *arg) static void txg_quiesce_thread(void *arg) { - dsl_pool_t *dp = (dsl_pool_t *)arg; + dsl_pool_t *dp = arg; tx_state_t *tx = &dp->dp_tx; callb_cpr_t cpr; diff --git a/module/zfs/zfs_replay.c b/module/zfs/zfs_replay.c index c2a9a8fde..bfba2fea0 100644 --- a/module/zfs/zfs_replay.c +++ b/module/zfs/zfs_replay.c @@ -72,7 +72,7 @@ zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t mode, /* ARGSUSED */ static int -zfs_replay_error(zfsvfs_t *zfsvfs, lr_t *lr, boolean_t byteswap) +zfs_replay_error(void *arg1, void *arg2, boolean_t byteswap) { return (SET_ERROR(ENOTSUP)); } @@ -265,9 +265,10 @@ zfs_replay_swap_attrs(lr_attr_t *lrattr) * as option FUID information. */ static int -zfs_replay_create_acl(zfsvfs_t *zfsvfs, - lr_acl_create_t *lracl, boolean_t byteswap) +zfs_replay_create_acl(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_acl_create_t *lracl = arg2; char *name = NULL; /* location determined later */ lr_create_t *lr = (lr_create_t *)lracl; znode_t *dzp; @@ -413,8 +414,10 @@ bail: } static int -zfs_replay_create(zfsvfs_t *zfsvfs, lr_create_t *lr, boolean_t byteswap) +zfs_replay_create(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_create_t *lr = arg2; char *name = NULL; /* location determined later */ char *link; /* symlink content follows name */ znode_t *dzp; @@ -545,8 +548,10 @@ out: } static int -zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap) +zfs_replay_remove(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_remove_t *lr = arg2; char *name = (char *)(lr + 1); /* name follows lr_remove_t */ znode_t *dzp; int error; @@ -578,8 +583,10 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap) } static int -zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap) +zfs_replay_link(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_link_t *lr = arg2; char *name = (char *)(lr + 1); /* name follows lr_link_t */ znode_t *dzp, *zp; int error; @@ -608,8 +615,10 @@ zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap) } static int -zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap) +zfs_replay_rename(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_rename_t *lr = arg2; char *sname = (char *)(lr + 1); /* sname and tname follow lr_rename_t */ char *tname = sname + strlen(sname) + 1; znode_t *sdzp, *tdzp; @@ -639,8 +648,10 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap) } static int -zfs_replay_write(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap) +zfs_replay_write(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_write_t *lr = arg2; char *data = (char *)(lr + 1); /* data follows lr_write_t */ znode_t *zp; int error, written; @@ -708,8 +719,10 @@ zfs_replay_write(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap) * the file is grown. */ static int -zfs_replay_write2(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap) +zfs_replay_write2(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_write_t *lr = arg2; znode_t *zp; int error; uint64_t end; @@ -753,8 +766,10 @@ top: } static int -zfs_replay_truncate(zfsvfs_t *zfsvfs, lr_truncate_t *lr, boolean_t byteswap) +zfs_replay_truncate(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_truncate_t *lr = arg2; znode_t *zp; flock64_t fl; int error; @@ -780,8 +795,10 @@ zfs_replay_truncate(zfsvfs_t *zfsvfs, lr_truncate_t *lr, boolean_t byteswap) } static int -zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, boolean_t byteswap) +zfs_replay_setattr(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_setattr_t *lr = arg2; znode_t *zp; xvattr_t xva; vattr_t *vap = &xva.xva_vattr; @@ -834,8 +851,10 @@ zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, boolean_t byteswap) } static int -zfs_replay_acl_v0(zfsvfs_t *zfsvfs, lr_acl_v0_t *lr, boolean_t byteswap) +zfs_replay_acl_v0(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_acl_v0_t *lr = arg2; ace_t *ace = (ace_t *)(lr + 1); /* ace array follows lr_acl_t */ vsecattr_t vsa; znode_t *zp; @@ -878,8 +897,10 @@ zfs_replay_acl_v0(zfsvfs_t *zfsvfs, lr_acl_v0_t *lr, boolean_t byteswap) * */ static int -zfs_replay_acl(zfsvfs_t *zfsvfs, lr_acl_t *lr, boolean_t byteswap) +zfs_replay_acl(void *arg1, void *arg2, boolean_t byteswap) { + zfsvfs_t *zfsvfs = arg1; + lr_acl_t *lr = arg2; ace_t *ace = (ace_t *)(lr + 1); vsecattr_t vsa; znode_t *zp; @@ -928,26 +949,26 @@ zfs_replay_acl(zfsvfs_t *zfsvfs, lr_acl_t *lr, boolean_t byteswap) /* * Callback vectors for replaying records */ -zil_replay_func_t zfs_replay_vector[TX_MAX_TYPE] = { - (zil_replay_func_t)zfs_replay_error, /* no such type */ - (zil_replay_func_t)zfs_replay_create, /* TX_CREATE */ - (zil_replay_func_t)zfs_replay_create, /* TX_MKDIR */ - (zil_replay_func_t)zfs_replay_create, /* TX_MKXATTR */ - (zil_replay_func_t)zfs_replay_create, /* TX_SYMLINK */ - (zil_replay_func_t)zfs_replay_remove, /* TX_REMOVE */ - (zil_replay_func_t)zfs_replay_remove, /* TX_RMDIR */ - (zil_replay_func_t)zfs_replay_link, /* TX_LINK */ - (zil_replay_func_t)zfs_replay_rename, /* TX_RENAME */ - (zil_replay_func_t)zfs_replay_write, /* TX_WRITE */ - (zil_replay_func_t)zfs_replay_truncate, /* TX_TRUNCATE */ - (zil_replay_func_t)zfs_replay_setattr, /* TX_SETATTR */ - (zil_replay_func_t)zfs_replay_acl_v0, /* TX_ACL_V0 */ - (zil_replay_func_t)zfs_replay_acl, /* TX_ACL */ - (zil_replay_func_t)zfs_replay_create_acl, /* TX_CREATE_ACL */ - (zil_replay_func_t)zfs_replay_create, /* TX_CREATE_ATTR */ - (zil_replay_func_t)zfs_replay_create_acl, /* TX_CREATE_ACL_ATTR */ - (zil_replay_func_t)zfs_replay_create_acl, /* TX_MKDIR_ACL */ - (zil_replay_func_t)zfs_replay_create, /* TX_MKDIR_ATTR */ - (zil_replay_func_t)zfs_replay_create_acl, /* TX_MKDIR_ACL_ATTR */ - (zil_replay_func_t)zfs_replay_write2, /* TX_WRITE2 */ +zil_replay_func_t *zfs_replay_vector[TX_MAX_TYPE] = { + zfs_replay_error, /* no such type */ + zfs_replay_create, /* TX_CREATE */ + zfs_replay_create, /* TX_MKDIR */ + zfs_replay_create, /* TX_MKXATTR */ + zfs_replay_create, /* TX_SYMLINK */ + zfs_replay_remove, /* TX_REMOVE */ + zfs_replay_remove, /* TX_RMDIR */ + zfs_replay_link, /* TX_LINK */ + zfs_replay_rename, /* TX_RENAME */ + zfs_replay_write, /* TX_WRITE */ + zfs_replay_truncate, /* TX_TRUNCATE */ + zfs_replay_setattr, /* TX_SETATTR */ + zfs_replay_acl_v0, /* TX_ACL_V0 */ + zfs_replay_acl, /* TX_ACL */ + zfs_replay_create_acl, /* TX_CREATE_ACL */ + zfs_replay_create, /* TX_CREATE_ATTR */ + zfs_replay_create_acl, /* TX_CREATE_ACL_ATTR */ + zfs_replay_create_acl, /* TX_MKDIR_ACL */ + zfs_replay_create, /* TX_MKDIR_ATTR */ + zfs_replay_create_acl, /* TX_MKDIR_ACL_ATTR */ + zfs_replay_write2, /* TX_WRITE2 */ }; diff --git a/module/zfs/zil.c b/module/zfs/zil.c index c34c1d253..7d1c85dc5 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -2175,7 +2175,7 @@ zil_resume(void *cookie) } typedef struct zil_replay_arg { - zil_replay_func_t *zr_replay; + zil_replay_func_t **zr_replay; void *zr_arg; boolean_t zr_byteswap; char *zr_lr; @@ -2294,7 +2294,7 @@ zil_incr_blks(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) * If this dataset has a non-empty intent log, replay it and destroy it. */ void -zil_replay(objset_t *os, void *arg, zil_replay_func_t replay_func[TX_MAX_TYPE]) +zil_replay(objset_t *os, void *arg, zil_replay_func_t *replay_func[TX_MAX_TYPE]) { zilog_t *zilog = dmu_objset_zil(os); const zil_header_t *zh = zilog->zl_header; diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index fe7dbb371..2f75a2faa 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -578,8 +578,10 @@ zvol_set_volblocksize(const char *name, uint64_t volblocksize) * implement DKIOCFREE/free-long-range. */ static int -zvol_replay_truncate(zvol_state_t *zv, lr_truncate_t *lr, boolean_t byteswap) +zvol_replay_truncate(void *arg1, void *arg2, boolean_t byteswap) { + zvol_state_t *zv = arg1; + lr_truncate_t *lr = arg2; uint64_t offset, length; if (byteswap) @@ -596,8 +598,10 @@ zvol_replay_truncate(zvol_state_t *zv, lr_truncate_t *lr, boolean_t byteswap) * after a system failure */ static int -zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, boolean_t byteswap) +zvol_replay_write(void *arg1, void *arg2, boolean_t byteswap) { + zvol_state_t *zv = arg1; + lr_write_t *lr = arg2; objset_t *os = zv->zv_objset; char *data = (char *)(lr + 1); /* data follows lr_write_t */ uint64_t offset, length; @@ -633,7 +637,7 @@ zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, boolean_t byteswap) } static int -zvol_replay_err(zvol_state_t *zv, lr_t *lr, boolean_t byteswap) +zvol_replay_err(void *arg1, void *arg2, boolean_t byteswap) { return (SET_ERROR(ENOTSUP)); } @@ -642,20 +646,26 @@ zvol_replay_err(zvol_state_t *zv, lr_t *lr, boolean_t byteswap) * Callback vectors for replaying records. * Only TX_WRITE and TX_TRUNCATE are needed for zvol. */ -zil_replay_func_t zvol_replay_vector[TX_MAX_TYPE] = { - (zil_replay_func_t)zvol_replay_err, /* no such transaction type */ - (zil_replay_func_t)zvol_replay_err, /* TX_CREATE */ - (zil_replay_func_t)zvol_replay_err, /* TX_MKDIR */ - (zil_replay_func_t)zvol_replay_err, /* TX_MKXATTR */ - (zil_replay_func_t)zvol_replay_err, /* TX_SYMLINK */ - (zil_replay_func_t)zvol_replay_err, /* TX_REMOVE */ - (zil_replay_func_t)zvol_replay_err, /* TX_RMDIR */ - (zil_replay_func_t)zvol_replay_err, /* TX_LINK */ - (zil_replay_func_t)zvol_replay_err, /* TX_RENAME */ - (zil_replay_func_t)zvol_replay_write, /* TX_WRITE */ - (zil_replay_func_t)zvol_replay_truncate, /* TX_TRUNCATE */ - (zil_replay_func_t)zvol_replay_err, /* TX_SETATTR */ - (zil_replay_func_t)zvol_replay_err, /* TX_ACL */ +zil_replay_func_t *zvol_replay_vector[TX_MAX_TYPE] = { + zvol_replay_err, /* no such transaction type */ + zvol_replay_err, /* TX_CREATE */ + zvol_replay_err, /* TX_MKDIR */ + zvol_replay_err, /* TX_MKXATTR */ + zvol_replay_err, /* TX_SYMLINK */ + zvol_replay_err, /* TX_REMOVE */ + zvol_replay_err, /* TX_RMDIR */ + zvol_replay_err, /* TX_LINK */ + zvol_replay_err, /* TX_RENAME */ + zvol_replay_write, /* TX_WRITE */ + zvol_replay_truncate, /* TX_TRUNCATE */ + zvol_replay_err, /* TX_SETATTR */ + zvol_replay_err, /* TX_ACL */ + zvol_replay_err, /* TX_CREATE_ATTR */ + zvol_replay_err, /* TX_CREATE_ACL_ATTR */ + zvol_replay_err, /* TX_MKDIR_ACL */ + zvol_replay_err, /* TX_MKDIR_ATTR */ + zvol_replay_err, /* TX_MKDIR_ACL_ATTR */ + zvol_replay_err, /* TX_WRITE2 */ }; /* |