Date: Mon, 2 Oct 2017 11:55:11 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r324198 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/ztest vendor/illumos/dist/lib/libzp... Message-ID: <201710021155.v92BtBZj013324@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Mon Oct 2 11:55:11 2017 New Revision: 324198 URL: https://svnweb.freebsd.org/changeset/base/324198 Log: 8081 Compiler warnings in zdb illumos/illumos-gate@3f7978d02b206a6ebc5652c91aa9f42da6fbe00c https://github.com/illumos/illumos-gate/commit/3f7978d02b206a6ebc5652c91aa9f42da6fbe00c https://www.illumos.org/issues/8081 zdb(8) is full of minor problems that generate compiler warnings. On FreeBSD, which uses -WError, the only way to build it is to disable all compiler warnings. This makes it much harder to detect newly introduced bugs. We should cleanup all the warnings. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Alan Somers <asomers@gmail.com> Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/sa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_replay.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Changes in other areas also in this revision: Added: vendor/illumos/dist/cmd/zdb/zdb.h (contents, props changed) Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zdb/zdb_il.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzpool/common/sys/zfs_context.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Mon Oct 2 11:55:11 2017 (r324198) @@ -4087,8 +4087,9 @@ 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) +arc_reclaim_thread(void *unused) { hrtime_t growtime = 0; callb_cpr_t cpr; @@ -7022,8 +7023,9 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint * This thread feeds the L2ARC at regular intervals. This is the beating * heart of the L2ARC. */ +/* ARGSUSED */ static void -l2arc_feed_thread(void) +l2arc_feed_thread(void *unused) { callb_cpr_t cpr; l2arc_dev_t *dev; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Mon Oct 2 11:55:11 2017 (r324198) @@ -495,8 +495,9 @@ 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) +dbuf_evict_thread(void *unused) { callb_cpr_t cpr; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Oct 2 11:55:11 2017 (r324198) @@ -5865,8 +5865,9 @@ spa_async_autoexpand(spa_t *spa, vdev_t *vd) } static void -spa_async_thread(spa_t *spa) +spa_async_thread(void *arg) { + spa_t *spa = (spa_t *)arg; int tasks; ASSERT(spa->spa_sync_on); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h Mon Oct 2 11:55:11 2017 (r324198) @@ -39,7 +39,7 @@ extern "C" { * particular object, use FTAG (which is a string) for the holder_tag. * Otherwise, use the object that holds the reference. */ -#define FTAG ((char *)__func__) +#define FTAG ((char *)(uintptr_t)__func__) #ifdef ZFS_DEBUG typedef struct reference { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/sa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/sa.h Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/sa.h Mon Oct 2 11:55:11 2017 (r324198) @@ -146,8 +146,8 @@ int sa_replace_all_by_template(sa_handle_t *, sa_bulk_ int sa_replace_all_by_template_locked(sa_handle_t *, sa_bulk_attr_t *, int, dmu_tx_t *); boolean_t sa_enabled(objset_t *); -void sa_cache_init(); -void sa_cache_fini(); +void sa_cache_init(void); +void sa_cache_fini(void); int sa_set_sa_object(objset_t *, uint64_t); int sa_hdrsize(void *); void sa_handle_lock(sa_handle_t *); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Mon Oct 2 11:55:11 2017 (r324198) @@ -870,7 +870,7 @@ extern void vdev_cache_stat_fini(void); /* Initialization and termination */ extern void spa_init(int flags); extern void spa_fini(void); -extern void spa_boot_init(); +extern void spa_boot_init(void); /* properties */ extern int spa_prop_set(spa_t *spa, nvlist_t *nvp); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h Mon Oct 2 11:55:11 2017 (r324198) @@ -389,7 +389,7 @@ typedef int zil_parse_blk_func_t(zilog_t *zilog, blkpt uint64_t txg); typedef int zil_parse_lr_func_t(zilog_t *zilog, lr_t *lr, void *arg, uint64_t txg); -typedef int zil_replay_func_t(); +typedef int zil_replay_func_t(void *arg1, void *arg2, boolean_t byteswap); typedef int zil_get_data_t(void *arg, lr_write_t *lr, char *dbuf, struct lwb *lwb, zio_t *zio); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Mon Oct 2 11:55:11 2017 (r324198) @@ -106,8 +106,8 @@ * now transition to the syncing state. */ -static void txg_sync_thread(dsl_pool_t *dp); -static void txg_quiesce_thread(dsl_pool_t *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 */ @@ -445,8 +445,9 @@ txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) } static void -txg_sync_thread(dsl_pool_t *dp) +txg_sync_thread(void *arg) { + dsl_pool_t *dp = arg; spa_t *spa = dp->dp_spa; tx_state_t *tx = &dp->dp_tx; callb_cpr_t cpr; @@ -525,8 +526,9 @@ txg_sync_thread(dsl_pool_t *dp) } static void -txg_quiesce_thread(dsl_pool_t *dp) +txg_quiesce_thread(void *arg) { + dsl_pool_t *dp = arg; tx_state_t *tx = &dp->dp_tx; callb_cpr_t cpr; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_replay.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_replay.c Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_replay.c Mon Oct 2 11:55:11 2017 (r324198) @@ -69,7 +69,7 @@ zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t m /* 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)); } @@ -262,9 +262,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; @@ -403,8 +404,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; @@ -528,8 +531,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; @@ -561,8 +566,10 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, b } 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; @@ -591,8 +598,10 @@ zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boole } 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; @@ -623,8 +632,10 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, b } 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; @@ -689,8 +700,10 @@ zfs_replay_write(zfsvfs_t *zfsvfs, lr_write_t *lr, boo * 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; @@ -734,8 +747,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; @@ -761,8 +776,10 @@ zfs_replay_truncate(zfsvfs_t *zfsvfs, lr_truncate_t *l } 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; @@ -813,8 +830,10 @@ zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, } 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; @@ -857,8 +876,10 @@ zfs_replay_acl_v0(zfsvfs_t *zfsvfs, lr_acl_v0_t *lr, b * */ 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; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Mon Oct 2 11:32:08 2017 (r324197) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Mon Oct 2 11:55:11 2017 (r324198) @@ -374,8 +374,10 @@ zvol_create_cb(objset_t *os, void *arg, cred_t *cr, dm * 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) @@ -392,8 +394,10 @@ zvol_replay_truncate(zvol_state_t *zv, lr_truncate_t * * 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; @@ -430,7 +434,7 @@ zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, bo /* ARGSUSED */ 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)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710021155.v92BtBZj013324>