From 973b085fff142f8a666520b3ad4d342ee57da89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sat, 5 Jun 2021 23:10:50 +0200 Subject: [PATCH] Replace ARGSUSED with proper warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passes (except for one zstd line) Linux on clang 13 and GCC 10.2.1-6 and FreeBSD 13 (clang 11) with -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Werror Module sources with ARGSUSED also grew a -Werror=unused-parameter Also, remove libefi's efi_type(): its only user is also rmformat, what it returns is only remotely relevant on Solaris, it never had any code, and its return value is just wrong Signed-off-by: Ahelenia ZiemiaƄska Closes #12167 --- cmd/raidz_test/raidz_test.c | 6 +- cmd/raidz_test/raidz_test.h | 4 +- cmd/zdb/zdb.c | 95 +- cmd/zdb/zdb_il.c | 29 +- cmd/zed/agents/fmd_api.c | 26 +- cmd/zed/agents/zfs_agents.c | 1 + cmd/zed/agents/zfs_diagnosis.c | 8 +- cmd/zed/agents/zfs_mod.c | 15 +- cmd/zed/agents/zfs_retire.c | 3 +- cmd/zed/zed.c | 2 + cmd/zed/zed_exec.c | 5 +- cmd/zfs/zfs_iter.c | 3 +- cmd/zfs/zfs_main.c | 17 +- cmd/zhack/zhack.c | 8 +- cmd/zinject/zinject.c | 4 +- cmd/zpool/os/freebsd/zpool_vdev_os.c | 3 + cmd/zpool/os/linux/zpool_vdev_os.c | 1 + cmd/zpool/zpool_iter.c | 3 +- cmd/zpool/zpool_main.c | 27 +- cmd/zpool_influxdb/zpool_influxdb.c | 21 +- cmd/ztest/ztest.c | 91 +- config/Rules.am | 1 + config/always-compiler-options.m4 | 25 +- config/zfs-build.m4 | 3 + contrib/pam_zfs_key/Makefile.am | 2 +- contrib/pam_zfs_key/pam_zfs_key.c | 22 +- include/os/freebsd/linux/compiler.h | 6 +- include/os/freebsd/spl/sys/ccompile.h | 6 +- include/os/freebsd/spl/sys/debug.h | 16 +- include/os/freebsd/zfs/sys/zfs_vfsops_os.h | 8 +- include/os/linux/kernel/linux/vfs_compat.h | 3 +- include/os/linux/spl/sys/debug.h | 16 +- include/os/linux/spl/sys/thread.h | 10 +- include/os/linux/spl/sys/zone.h | 5 +- include/sys/abd_impl.h | 8 +- include/sys/arc.h | 4 +- include/sys/bitops.h | 4 +- include/sys/dmu.h | 1 - include/sys/dnode.h | 5 +- include/sys/efi_partition.h | 1 - include/sys/lua/lualib.h | 2 +- include/sys/qat.h | 6 +- include/sys/zfs_context.h | 10 +- include/sys/zfs_debug.h | 8 +- include/sys/zfs_refcount.h | 10 +- lib/libefi/rdwr_efi.c | 27 - lib/libnvpair/libnvpair.c | 8 +- lib/libnvpair/nvpair_alloc_system.c | 2 +- lib/libshare/os/freebsd/nfs.c | 3 + lib/libshare/os/freebsd/smb.c | 6 + lib/libshare/os/linux/nfs.c | 2 + lib/libspl/include/assert.h | 20 +- lib/libspl/include/sys/kmem.h | 4 +- lib/libspl/os/linux/getmntany.c | 4 +- lib/libzfs/Makefile.am | 2 - lib/libzfs/libzfs_changelist.c | 5 +- lib/libzfs/libzfs_config.c | 3 +- lib/libzfs/libzfs_crypto.c | 11 + lib/libzfs/libzfs_dataset.c | 1 + lib/libzfs/libzfs_mount.c | 7 +- lib/libzfs/libzfs_sendrecv.c | 9 +- lib/libzfs/libzfs_status.c | 12 +- lib/libzfs/os/freebsd/libzfs_compat.c | 8 + lib/libzfs/os/freebsd/libzfs_ioctl_compat.c | 4 +- lib/libzfs/os/freebsd/libzfs_zmount.c | 3 + lib/libzfs_core/libzfs_core.abi | 3484 +++++++++-------- lib/libzfs_core/libzfs_core.c | 10 +- lib/libzpool/Makefile.am | 3 - lib/libzpool/kernel.c | 157 +- lib/libzpool/taskq.c | 15 +- lib/libzpool/util.c | 4 + lib/libzstd/Makefile.am | 3 + lib/libzutil/Makefile.am | 2 - .../os/freebsd/zutil_device_path_os.c | 2 +- lib/libzutil/os/linux/zutil_device_path_os.c | 2 +- lib/libzutil/os/linux/zutil_import_os.c | 8 +- lib/libzutil/zutil_import.c | 2 + man/man5/zfs-module-parameters.5 | 12 - module/avl/avl.c | 1 - module/icp/algs/aes/aes_impl.c | 1 - module/icp/algs/modes/cbc.c | 2 - module/icp/algs/modes/ccm.c | 4 +- module/icp/algs/modes/ctr.c | 1 - module/icp/algs/modes/ecb.c | 1 - module/icp/algs/modes/gcm.c | 10 +- module/icp/asm-x86_64/aes/aes_aesni.S | 18 +- module/icp/asm-x86_64/aes/aes_amd64.S | 12 +- module/icp/asm-x86_64/modes/gcm_pclmulqdq.S | 4 +- module/icp/asm-x86_64/sha1/sha1-x86_64.S | 4 +- module/icp/asm-x86_64/sha2/sha256_impl.S | 4 +- module/icp/asm-x86_64/sha2/sha512_impl.S | 4 +- module/icp/core/kcf_mech_tabs.c | 1 + module/icp/core/kcf_prov_lib.c | 3 + module/icp/core/kcf_prov_tabs.c | 1 - module/icp/core/kcf_sched.c | 21 +- module/icp/io/aes.c | 22 +- module/icp/io/sha1_mod.c | 39 +- module/icp/io/sha2_mod.c | 38 +- module/icp/io/skein_mod.c | 18 +- module/icp/os/modconf.c | 4 + module/icp/os/modhash.c | 9 +- module/lua/llimits.h | 9 +- module/nvpair/fnvpair.c | 5 - module/nvpair/nvpair.c | 6 +- module/nvpair/nvpair_alloc_fixed.c | 5 +- module/os/freebsd/spl/callb.c | 5 +- module/os/freebsd/spl/spl_zlib.c | 10 +- module/os/freebsd/zfs/vdev_file.c | 4 +- module/os/freebsd/zfs/zfs_acl.c | 14 +- module/os/freebsd/zfs/zfs_ctldir.c | 6 +- module/os/freebsd/zfs/zfs_debug.c | 4 +- module/os/freebsd/zfs/zfs_racct.c | 4 + module/os/freebsd/zfs/zfs_vfsops.c | 12 +- module/os/freebsd/zfs/zfs_vnops_os.c | 50 +- module/os/freebsd/zfs/zfs_znode.c | 7 +- module/os/freebsd/zfs/zio_crypt.c | 8 +- module/os/freebsd/zfs/zvol_os.c | 16 +- module/os/linux/zfs/abd_os.c | 2 + module/os/linux/zfs/arc_os.c | 13 +- module/os/linux/zfs/vdev_file.c | 2 +- module/os/linux/zfs/zfs_acl.c | 11 +- module/os/linux/zfs/zfs_debug.c | 4 +- module/os/linux/zfs/zfs_racct.c | 4 + module/os/linux/zfs/zfs_vfsops.c | 17 +- module/os/linux/zfs/zfs_vnops_os.c | 32 +- module/os/linux/zfs/zfs_znode.c | 12 +- module/os/linux/zfs/zio_crypt.c | 4 +- module/os/linux/zfs/zpl_ctldir.c | 20 +- module/zcommon/zfeature_common.c | 1 + module/zcommon/zfs_fletcher.c | 13 +- module/zcommon/zprop_common.c | 2 + module/zfs/abd.c | 14 +- module/zfs/arc.c | 108 +- module/zfs/blkptr.c | 4 +- module/zfs/bpobj.c | 8 +- module/zfs/bptree.c | 4 +- module/zfs/btree.c | 4 +- module/zfs/dbuf.c | 43 +- module/zfs/dbuf_stats.c | 12 +- module/zfs/dmu.c | 12 +- module/zfs/dmu_diff.c | 3 +- module/zfs/dmu_objset.c | 14 +- module/zfs/dmu_recv.c | 56 +- module/zfs/dmu_redact.c | 4 +- module/zfs/dmu_send.c | 5 +- module/zfs/dmu_traverse.c | 4 +- module/zfs/dmu_tx.c | 7 +- module/zfs/dmu_zfetch.c | 2 + module/zfs/dnode.c | 26 +- module/zfs/dnode_sync.c | 5 +- module/zfs/dsl_bookmark.c | 6 +- module/zfs/dsl_dataset.c | 21 +- module/zfs/dsl_destroy.c | 8 +- module/zfs/dsl_dir.c | 25 +- module/zfs/dsl_pool.c | 20 +- module/zfs/dsl_prop.c | 3 +- module/zfs/dsl_scan.c | 26 +- module/zfs/dsl_synctask.c | 3 +- module/zfs/edonr_zfs.c | 3 +- module/zfs/fm.c | 4 +- module/zfs/gzip.c | 5 +- module/zfs/lz4.c | 10 +- module/zfs/lzjb.c | 7 +- module/zfs/metaslab.c | 96 +- module/zfs/mmp.c | 19 +- module/zfs/multilist.c | 2 - module/zfs/range_tree.c | 16 +- module/zfs/sa.c | 16 +- module/zfs/sha256.c | 6 +- module/zfs/skein_zfs.c | 3 +- module/zfs/spa.c | 81 +- module/zfs/spa_checkpoint.c | 25 +- module/zfs/spa_errlog.c | 4 + module/zfs/spa_history.c | 6 +- module/zfs/spa_misc.c | 2 +- module/zfs/space_map.c | 7 +- module/zfs/txg.c | 26 +- module/zfs/vdev.c | 21 +- module/zfs/vdev_draid.c | 11 +- module/zfs/vdev_indirect.c | 20 +- module/zfs/vdev_indirect_births.c | 2 - module/zfs/vdev_indirect_mapping.c | 2 - module/zfs/vdev_initialize.c | 4 +- module/zfs/vdev_mirror.c | 2 + module/zfs/vdev_missing.c | 8 +- module/zfs/vdev_raidz.c | 11 +- module/zfs/vdev_removal.c | 25 +- module/zfs/vdev_trim.c | 1 + module/zfs/zap.c | 9 +- module/zfs/zap_micro.c | 9 +- module/zfs/zcp.c | 8 +- module/zfs/zcp_get.c | 2 +- module/zfs/zcp_synctask.c | 11 +- module/zfs/zfs_byteswap.c | 4 +- module/zfs/zfs_fm.c | 54 +- module/zfs/zfs_ioctl.c | 129 +- module/zfs/zfs_replay.c | 6 +- module/zfs/zfs_vnops.c | 11 +- module/zfs/zil.c | 35 +- module/zfs/zio.c | 41 +- module/zfs/zio_checksum.c | 12 +- module/zfs/zio_compress.c | 4 +- module/zfs/zio_inject.c | 3 +- module/zfs/zvol.c | 14 +- tests/zfs-tests/cmd/btree_test/btree_test.c | 3 +- .../zfs-tests/cmd/largest_file/largest_file.c | 2 +- tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c | 1 + tests/zfs-tests/cmd/rename_dir/rename_dir.c | 11 +- .../rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c | 4 +- tests/zfs-tests/cmd/xattrtest/xattrtest.c | 6 +- .../functional/cli_root/zfs_diff/socket.c | 1 - .../cli_root/zpool_events/ereports.c | 3 +- .../zfs-tests/tests/functional/ctime/ctime.c | 3 +- .../tests/functional/hkdf/hkdf_test.c | 2 +- .../tests/functional/libzfs/many_fds.c | 3 +- .../functional/tmpfile/tmpfile_001_pos.c | 2 +- .../functional/tmpfile/tmpfile_002_pos.c | 2 +- .../functional/tmpfile/tmpfile_003_pos.c | 2 +- .../functional/tmpfile/tmpfile_stat_mode.c | 2 +- 219 files changed, 3524 insertions(+), 2690 deletions(-) diff --git a/cmd/raidz_test/raidz_test.c b/cmd/raidz_test/raidz_test.c index c1610a8d1b0c..5226f42292d4 100644 --- a/cmd/raidz_test/raidz_test.c +++ b/cmd/raidz_test/raidz_test.c @@ -71,12 +71,13 @@ static void print_opts(raidz_test_opts_t *opts, boolean_t force) { char *verbose; switch (opts->rto_v) { - case 0: + case D_ALL: verbose = "no"; break; - case 1: + case D_INFO: verbose = "info"; break; + case D_DEBUG: default: verbose = "debug"; break; @@ -266,6 +267,7 @@ cmp_data(raidz_test_opts_t *opts, raidz_map_t *rm) static int init_rand(void *data, size_t size, void *private) { + (void) private; int i; int *dst = (int *)data; diff --git a/cmd/raidz_test/raidz_test.h b/cmd/raidz_test/raidz_test.h index 0f7f4cee3eb6..b01f22b104bc 100644 --- a/cmd/raidz_test/raidz_test.h +++ b/cmd/raidz_test/raidz_test.h @@ -92,13 +92,13 @@ static inline size_t ilog2(size_t a) #define LOG(lvl, a...) \ { \ - if (rto_opts.rto_v >= lvl) \ + if ((rto_opts.rto_v + 1) >= (lvl + 1)) \ (void) fprintf(stdout, a); \ } \ #define LOG_OPT(lvl, opt, a...) \ { \ - if (opt->rto_v >= lvl) \ + if ((opt->rto_v + 1) >= (lvl + 1)) \ (void) fprintf(stdout, a); \ } \ diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index a33933d89997..12dc9f510e5e 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -352,10 +352,11 @@ livelist_verify(dsl_deadlist_t *dl, void *arg) * Check for errors in the livelist entry and discard the intermediary * data structures */ -/* ARGSUSED */ static int sublivelist_verify_lightweight(void *args, dsl_deadlist_entry_t *dle) { + (void) args; + sublivelist_verify_t sv; zfs_btree_create(&sv.sv_leftover, livelist_block_compare, sizeof (sublivelist_verify_block_t)); @@ -865,13 +866,13 @@ dump_debug_buffer(void) * dmu_bonus_hold(), or pool_match(). abort() is called for other errors. */ -static void +static __attribute__((noreturn)) void fatal(const char *fmt, ...) { va_list ap; - va_start(ap, fmt); (void) fprintf(stderr, "%s: ", cmdname); + va_start(ap, fmt); (void) vfprintf(stderr, fmt, ap); va_end(ap); (void) fprintf(stderr, "\n"); @@ -881,10 +882,10 @@ fatal(const char *fmt, ...) exit(1); } -/* ARGSUSED */ static void dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size) { + (void) size; nvlist_t *nv; size_t nvsize = *(uint64_t *)data; char *packed = umem_alloc(nvsize, UMEM_NOFAIL); @@ -900,10 +901,12 @@ dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size) nvlist_free(nv); } -/* ARGSUSED */ static void dump_history_offsets(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; + (void) size; spa_history_phys_t *shp = data; if (shp == NULL) @@ -1023,26 +1026,34 @@ dump_zap_stats(objset_t *os, uint64_t object) dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0); } -/*ARGSUSED*/ static void dump_none(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; + (void) data; + (void) size; } -/*ARGSUSED*/ static void dump_unknown(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; + (void) data; + (void) size; (void) printf("\tUNKNOWN OBJECT TYPE\n"); } -/*ARGSUSED*/ static void dump_uint8(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; + (void) data; + (void) size; } -/*ARGSUSED*/ static void dump_uint64(objset_t *os, uint64_t object, void *data, size_t size) { @@ -1099,10 +1110,11 @@ dump_uint64(objset_t *os, uint64_t object, void *data, size_t size) kmem_free(arr, oursize); } -/*ARGSUSED*/ static void dump_zap(objset_t *os, uint64_t object, void *data, size_t size) { + (void) data; + (void) size; zap_cursor_t zc; zap_attribute_t attr; void *prop; @@ -1219,10 +1231,11 @@ dump_bpobj(objset_t *os, uint64_t object, void *data, size_t size) } } -/* ARGSUSED */ static void dump_bpobj_subobjs(objset_t *os, uint64_t object, void *data, size_t size) { + (void) data; + (void) size; dmu_object_info_t doi; int64_t i; @@ -1248,18 +1261,20 @@ dump_bpobj_subobjs(objset_t *os, uint64_t object, void *data, size_t size) kmem_free(subobjs, doi.doi_max_offset); } -/*ARGSUSED*/ static void dump_ddt_zap(objset_t *os, uint64_t object, void *data, size_t size) { + (void) data; + (void) size; dump_zap_stats(os, object); /* contents are printed elsewhere, properly decoded */ } -/*ARGSUSED*/ static void dump_sa_attrs(objset_t *os, uint64_t object, void *data, size_t size) { + (void) data; + (void) size; zap_cursor_t zc; zap_attribute_t attr; @@ -1283,10 +1298,11 @@ dump_sa_attrs(objset_t *os, uint64_t object, void *data, size_t size) zap_cursor_fini(&zc); } -/*ARGSUSED*/ static void dump_sa_layouts(objset_t *os, uint64_t object, void *data, size_t size) { + (void) data; + (void) size; zap_cursor_t zc; zap_attribute_t attr; uint16_t *layout_attrs; @@ -1321,10 +1337,11 @@ dump_sa_layouts(objset_t *os, uint64_t object, void *data, size_t size) zap_cursor_fini(&zc); } -/*ARGSUSED*/ static void dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size) { + (void) data; + (void) size; zap_cursor_t zc; zap_attribute_t attr; const char *typenames[] = { @@ -2178,10 +2195,13 @@ dump_history(spa_t *spa) free(buf); } -/*ARGSUSED*/ static void dump_dnode(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; + (void) data; + (void) size; } static uint64_t @@ -2401,7 +2421,6 @@ visit_indirect(spa_t *spa, const dnode_phys_t *dnp, return (err); } -/*ARGSUSED*/ static void dump_indirect(dnode_t *dn) { @@ -2422,10 +2441,11 @@ dump_indirect(dnode_t *dn) (void) printf("\n"); } -/*ARGSUSED*/ static void dump_dsl_dir(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; dsl_dir_phys_t *dd = data; time_t crtime; char nice[32]; @@ -2479,10 +2499,11 @@ dump_dsl_dir(objset_t *os, uint64_t object, void *data, size_t size) (u_longlong_t)dd->dd_clones); } -/*ARGSUSED*/ static void dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; dsl_dataset_phys_t *ds = data; time_t crtime; char used[32], compressed[32], uncompressed[32], unique[32]; @@ -2542,10 +2563,11 @@ dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size) (void) printf("\t\tbp = %s\n", blkbuf); } -/* ARGSUSED */ static int dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { + (void) arg; + (void) tx; char blkbuf[BP_SPRINTF_LEN]; if (bp->blk_birth != 0) { @@ -2583,10 +2605,11 @@ dump_bptree(objset_t *os, uint64_t obj, const char *name) (void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL); } -/* ARGSUSED */ static int dump_bpobj_cb(void *arg, const blkptr_t *bp, boolean_t bp_freed, dmu_tx_t *tx) { + (void) arg; + (void) tx; char blkbuf[BP_SPRINTF_LEN]; ASSERT(bp->blk_birth != 0); @@ -3148,10 +3171,11 @@ dump_znode_symlink(sa_handle_t *hdl) (void) printf("\ttarget %s\n", linktarget); } -/*ARGSUSED*/ static void dump_znode(objset_t *os, uint64_t object, void *data, size_t size) { + (void) data; + (void) size; char path[MAXPATHLEN * 2]; /* allow for xattr and failure prefix */ sa_handle_t *hdl; uint64_t xattr, rdev, gen; @@ -3243,16 +3267,22 @@ dump_znode(objset_t *os, uint64_t object, void *data, size_t size) sa_handle_destroy(hdl); } -/*ARGSUSED*/ static void dump_acl(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; + (void) data; + (void) size; } -/*ARGSUSED*/ static void dump_dmu_objset(objset_t *os, uint64_t object, void *data, size_t size) { + (void) os; + (void) object; + (void) data; + (void) size; } static object_viewer_t *object_viewer[DMU_OT_NUMTYPES + 1] = { @@ -4898,10 +4928,10 @@ static uint64_t dataset_feature_count[SPA_FEATURES]; static uint64_t global_feature_count[SPA_FEATURES]; static uint64_t remap_deadlist_count = 0; -/*ARGSUSED*/ static int dump_one_objset(const char *dsname, void *arg) { + (void) arg; int error; objset_t *os; spa_feature_t f; @@ -5465,7 +5495,6 @@ static metaslab_ops_t zdb_metaslab_ops = { NULL /* alloc */ }; -/* ARGSUSED */ static int load_unflushed_svr_segs_cb(spa_t *spa, space_map_entry_t *sme, uint64_t txg, void *arg) @@ -5494,11 +5523,13 @@ load_unflushed_svr_segs_cb(spa_t *spa, space_map_entry_t *sme, return (0); } -/* ARGSUSED */ static void claim_segment_impl_cb(uint64_t inner_offset, vdev_t *vd, uint64_t offset, uint64_t size, void *arg) { + (void) inner_offset; + (void) arg; + /* * This callback was called through a remap from * a device being removed. Therefore, the vdev that @@ -5572,11 +5603,11 @@ zdb_claim_removing(spa_t *spa, zdb_cb_t *zcb) spa_config_exit(spa, SCL_CONFIG, FTAG); } -/* ARGSUSED */ static int increment_indirect_mapping_cb(void *arg, const blkptr_t *bp, boolean_t bp_freed, dmu_tx_t *tx) { + (void) tx; zdb_cb_t *zcb = arg; spa_t *spa = zcb->zcb_spa; vdev_t *vd; @@ -6188,10 +6219,10 @@ zdb_leak_fini(spa_t *spa, zdb_cb_t *zcb) return (leaks); } -/* ARGSUSED */ static int count_block_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) { + (void) tx; zdb_cb_t *zcb = arg; if (dump_opt['b'] >= 5) { @@ -6648,11 +6679,12 @@ typedef struct zdb_ddt_entry { avl_node_t zdde_node; } zdb_ddt_entry_t; -/* ARGSUSED */ static int zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { + (void) zilog; + (void) dnp; avl_tree_t *t = arg; avl_index_t where; zdb_ddt_entry_t *zdde, zdde_search; @@ -7275,10 +7307,10 @@ verify_checkpoint(spa_t *spa) return (error); } -/* ARGSUSED */ static void mos_leaks_cb(void *arg, uint64_t start, uint64_t size) { + (void) arg; for (uint64_t i = start; i < size; i++) { (void) printf("MOS object %llu referenced but not allocated\n", (u_longlong_t)i); @@ -7879,6 +7911,7 @@ static boolean_t zdb_decompress_block(abd_t *pabd, void *buf, void *lbuf, uint64_t lsize, uint64_t psize, int flags) { + (void) buf; boolean_t exceeded = B_FALSE; /* * We don't know how the data was compressed, so just try diff --git a/cmd/zdb/zdb_il.c b/cmd/zdb/zdb_il.c index 553765b71716..814ee57c1d8f 100644 --- a/cmd/zdb/zdb_il.c +++ b/cmd/zdb/zdb_il.c @@ -60,10 +60,10 @@ print_log_bp(const blkptr_t *bp, const char *prefix) (void) printf("%s%s\n", prefix, blkbuf); } -/* ARGSUSED */ static void zil_prt_rec_create(zilog_t *zilog, int txtype, const void *arg) { + (void) zilog; const lr_create_t *lr = arg; time_t crtime = lr->lr_crtime[0]; char *name, *link; @@ -96,20 +96,22 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, const void *arg) (u_longlong_t)lr->lr_gen, (u_longlong_t)lr->lr_rdev); } -/* ARGSUSED */ static void zil_prt_rec_remove(zilog_t *zilog, int txtype, const void *arg) { + (void) zilog; + (void) txtype; const lr_remove_t *lr = arg; (void) printf("%sdoid %llu, name %s\n", tab_prefix, (u_longlong_t)lr->lr_doid, (char *)(lr + 1)); } -/* ARGSUSED */ static void zil_prt_rec_link(zilog_t *zilog, int txtype, const void *arg) { + (void) zilog; + (void) txtype; const lr_link_t *lr = arg; (void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix, @@ -117,10 +119,11 @@ zil_prt_rec_link(zilog_t *zilog, int txtype, const void *arg) (char *)(lr + 1)); } -/* ARGSUSED */ static void zil_prt_rec_rename(zilog_t *zilog, int txtype, const void *arg) { + (void) zilog; + (void) txtype; const lr_rename_t *lr = arg; char *snm = (char *)(lr + 1); char *tnm = snm + strlen(snm) + 1; @@ -130,10 +133,10 @@ zil_prt_rec_rename(zilog_t *zilog, int txtype, const void *arg) (void) printf("%ssrc %s tgt %s\n", tab_prefix, snm, tnm); } -/* ARGSUSED */ static int zil_prt_rec_write_cb(void *data, size_t len, void *unused) { + (void) unused; char *cdata = data; for (size_t i = 0; i < len; i++) { @@ -146,7 +149,6 @@ zil_prt_rec_write_cb(void *data, size_t len, void *unused) return (0); } -/* ARGSUSED */ static void zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg) { @@ -209,10 +211,11 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg) abd_free(data); } -/* ARGSUSED */ static void zil_prt_rec_truncate(zilog_t *zilog, int txtype, const void *arg) { + (void) zilog; + (void) txtype; const lr_truncate_t *lr = arg; (void) printf("%sfoid %llu, offset 0x%llx, length 0x%llx\n", tab_prefix, @@ -220,10 +223,11 @@ zil_prt_rec_truncate(zilog_t *zilog, int txtype, const void *arg) (u_longlong_t)lr->lr_length); } -/* ARGSUSED */ static void zil_prt_rec_setattr(zilog_t *zilog, int txtype, const void *arg) { + (void) zilog; + (void) txtype; const lr_setattr_t *lr = arg; time_t atime = (time_t)lr->lr_atime[0]; time_t mtime = (time_t)lr->lr_mtime[0]; @@ -266,10 +270,11 @@ zil_prt_rec_setattr(zilog_t *zilog, int txtype, const void *arg) } } -/* ARGSUSED */ static void zil_prt_rec_acl(zilog_t *zilog, int txtype, const void *arg) { + (void) zilog; + (void) txtype; const lr_acl_t *lr = arg; (void) printf("%sfoid %llu, aclcnt %llu\n", tab_prefix, @@ -307,10 +312,11 @@ static zil_rec_info_t zil_rec_info[TX_MAX_TYPE] = { {.zri_print = zil_prt_rec_write, .zri_name = "TX_WRITE2 "}, }; -/* ARGSUSED */ static int print_log_record(zilog_t *zilog, const lr_t *lr, void *arg, uint64_t claim_txg) { + (void) arg; + (void) claim_txg; int txtype; int verbose = MAX(dump_opt['d'], dump_opt['i']); @@ -341,11 +347,11 @@ print_log_record(zilog_t *zilog, const lr_t *lr, void *arg, uint64_t claim_txg) return (0); } -/* ARGSUSED */ static int print_log_block(zilog_t *zilog, const blkptr_t *bp, void *arg, uint64_t claim_txg) { + (void) arg; char blkbuf[BP_SPRINTF_LEN + 10]; int verbose = MAX(dump_opt['d'], dump_opt['i']); const char *claim; @@ -396,7 +402,6 @@ print_log_stats(int verbose) (void) printf("\n"); } -/* ARGSUSED */ void dump_intent_log(zilog_t *zilog) { diff --git a/cmd/zed/agents/fmd_api.c b/cmd/zed/agents/fmd_api.c index 607b387ca3a8..728b69f746f7 100644 --- a/cmd/zed/agents/fmd_api.c +++ b/cmd/zed/agents/fmd_api.c @@ -97,6 +97,7 @@ _umem_logging_init(void) int fmd_hdl_register(fmd_hdl_t *hdl, int version, const fmd_hdl_info_t *mip) { + (void) version; fmd_module_t *mp = (fmd_module_t *)hdl; mp->mod_info = mip; @@ -172,25 +173,27 @@ void * fmd_hdl_getspecific(fmd_hdl_t *hdl) { fmd_module_t *mp = (fmd_module_t *)hdl; - return (mp->mod_spec); } void * fmd_hdl_alloc(fmd_hdl_t *hdl, size_t size, int flags) { + (void) hdl; return (umem_alloc(size, flags)); } void * fmd_hdl_zalloc(fmd_hdl_t *hdl, size_t size, int flags) { + (void) hdl; return (umem_zalloc(size, flags)); } void fmd_hdl_free(fmd_hdl_t *hdl, void *data, size_t size) { + (void) hdl; umem_free(data, size); } @@ -217,6 +220,8 @@ fmd_hdl_debug(fmd_hdl_t *hdl, const char *format, ...) int32_t fmd_prop_get_int32(fmd_hdl_t *hdl, const char *name) { + (void) hdl; + /* * These can be looked up in mp->modinfo->fmdi_props * For now we just hard code for phase 2. In the @@ -234,6 +239,8 @@ fmd_prop_get_int32(fmd_hdl_t *hdl, const char *name) int64_t fmd_prop_get_int64(fmd_hdl_t *hdl, const char *name) { + (void) hdl; + /* * These can be looked up in mp->modinfo->fmdi_props * For now we just hard code for phase 2. In the @@ -337,12 +344,16 @@ fmd_case_uuresolved(fmd_hdl_t *hdl, const char *uuid) int fmd_case_solved(fmd_hdl_t *hdl, fmd_case_t *cp) { + (void) hdl; return ((cp->ci_state >= FMD_CASE_SOLVED) ? FMD_B_TRUE : FMD_B_FALSE); } void fmd_case_add_ereport(fmd_hdl_t *hdl, fmd_case_t *cp, fmd_event_t *ep) { + (void) hdl; + (void) cp; + (void) ep; } static void @@ -443,18 +454,21 @@ fmd_case_add_suspect(fmd_hdl_t *hdl, fmd_case_t *cp, nvlist_t *fault) void fmd_case_setspecific(fmd_hdl_t *hdl, fmd_case_t *cp, void *data) { + (void) hdl; cp->ci_data = data; } void * fmd_case_getspecific(fmd_hdl_t *hdl, fmd_case_t *cp) { + (void) hdl; return (cp->ci_data); } void fmd_buf_create(fmd_hdl_t *hdl, fmd_case_t *cp, const char *name, size_t size) { + (void) name; assert(strcmp(name, "data") == 0); assert(cp->ci_bufptr == NULL); assert(size < (1024 * 1024)); @@ -467,6 +481,8 @@ void fmd_buf_read(fmd_hdl_t *hdl, fmd_case_t *cp, const char *name, void *buf, size_t size) { + (void) hdl; + (void) name; assert(strcmp(name, "data") == 0); assert(cp->ci_bufptr != NULL); assert(size <= cp->ci_bufsiz); @@ -478,6 +494,8 @@ void fmd_buf_write(fmd_hdl_t *hdl, fmd_case_t *cp, const char *name, const void *buf, size_t size) { + (void) hdl; + (void) name; assert(strcmp(name, "data") == 0); assert(cp->ci_bufptr != NULL); assert(cp->ci_bufsiz >= size); @@ -582,6 +600,7 @@ _timer_notify(union sigval sv) fmd_timer_t * fmd_timer_install(fmd_hdl_t *hdl, void *arg, fmd_event_t *ep, hrtime_t delta) { + (void) ep; struct sigevent sev; struct itimerspec its; fmd_timer_t *ftp; @@ -625,6 +644,7 @@ nvlist_t * fmd_nvl_create_fault(fmd_hdl_t *hdl, const char *class, uint8_t certainty, nvlist_t *asru, nvlist_t *fru, nvlist_t *resource) { + (void) hdl; nvlist_t *nvl; int err = 0; @@ -688,6 +708,7 @@ fmd_strmatch(const char *s, const char *p) int fmd_nvl_class_match(fmd_hdl_t *hdl, nvlist_t *nvl, const char *pattern) { + (void) hdl; char *class; return (nvl != NULL && @@ -698,6 +719,9 @@ fmd_nvl_class_match(fmd_hdl_t *hdl, nvlist_t *nvl, const char *pattern) nvlist_t * fmd_nvl_alloc(fmd_hdl_t *hdl, int flags) { + (void) hdl; + (void) flags; + nvlist_t *nvl = NULL; if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0) diff --git a/cmd/zed/agents/zfs_agents.c b/cmd/zed/agents/zfs_agents.c index 35dd818ff80d..f90e68a587b2 100644 --- a/cmd/zed/agents/zfs_agents.c +++ b/cmd/zed/agents/zfs_agents.c @@ -327,6 +327,7 @@ zfs_agent_dispatch(const char *class, const char *subclass, nvlist_t *nvl) static void * zfs_agent_consumer_thread(void *arg) { + (void) arg; for (;;) { agent_event_t *event; diff --git a/cmd/zed/agents/zfs_diagnosis.c b/cmd/zed/agents/zfs_diagnosis.c index 0b27f6702ee8..d6b88367a70e 100644 --- a/cmd/zed/agents/zfs_diagnosis.c +++ b/cmd/zed/agents/zfs_diagnosis.c @@ -121,6 +121,7 @@ uu_list_t *zfs_cases; static void zfs_case_serialize(fmd_hdl_t *hdl, zfs_case_t *zcp) { + (void) hdl; zcp->zc_data.zc_version = CASE_DATA_VERSION_SERD; } @@ -209,10 +210,10 @@ zfs_mark_vdev(uint64_t pool_guid, nvlist_t *vd, er_timeval_t *loaded) } } -/*ARGSUSED*/ static int zfs_mark_pool(zpool_handle_t *zhp, void *unused) { + (void) unused; zfs_case_t *zcp; uint64_t pool_guid; uint64_t *tod; @@ -376,6 +377,7 @@ static void zfs_case_solve(fmd_hdl_t *hdl, zfs_case_t *zcp, const char *faultname, boolean_t checkunusable) { + (void) checkunusable; nvlist_t *detector, *fault; boolean_t serialize; nvlist_t *fru = NULL; @@ -424,10 +426,10 @@ timeval_earlier(er_timeval_t *a, er_timeval_t *b) (a->ertv_sec == b->ertv_sec && a->ertv_nsec < b->ertv_nsec)); } -/*ARGSUSED*/ static void zfs_ereport_when(fmd_hdl_t *hdl, nvlist_t *nvl, er_timeval_t *when) { + (void) hdl; int64_t *tod; uint_t nelem; @@ -443,7 +445,6 @@ zfs_ereport_when(fmd_hdl_t *hdl, nvlist_t *nvl, er_timeval_t *when) /* * Main fmd entry point. */ -/*ARGSUSED*/ static void zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class) { @@ -854,7 +855,6 @@ zfs_fm_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class) * The timeout is fired when we diagnosed an I/O error, and it was not due to * device removal (which would cause the timeout to be cancelled). */ -/* ARGSUSED */ static void zfs_fm_timeout(fmd_hdl_t *hdl, id_t id, void *data) { diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c index b564f2b12a26..64eac0700189 100644 --- a/cmd/zed/agents/zfs_mod.c +++ b/cmd/zed/agents/zfs_mod.c @@ -660,7 +660,7 @@ devid_iter(const char *devid, zfs_process_func_t func, boolean_t is_slice) * phys_path: 'pci-0000:04:00.0-sas-0x4433221106000000-lun-0' */ static int -zfs_deliver_add(nvlist_t *nvl, boolean_t is_lofi) +zfs_deliver_add(nvlist_t *nvl) { char *devpath = NULL, *devid; boolean_t is_slice; @@ -838,18 +838,15 @@ static int zfs_slm_deliver_event(const char *class, const char *subclass, nvlist_t *nvl) { int ret; - boolean_t is_lofi = B_FALSE, is_check = B_FALSE, is_dle = B_FALSE; + boolean_t is_check = B_FALSE, is_dle = B_FALSE; if (strcmp(class, EC_DEV_ADD) == 0) { /* * We're mainly interested in disk additions, but we also listen * for new loop devices, to allow for simplified testing. */ - if (strcmp(subclass, ESC_DISK) == 0) - is_lofi = B_FALSE; - else if (strcmp(subclass, ESC_LOFI) == 0) - is_lofi = B_TRUE; - else + if (strcmp(subclass, ESC_DISK) != 0 && + strcmp(subclass, ESC_LOFI) != 0) return (0); is_check = B_FALSE; @@ -873,15 +870,15 @@ zfs_slm_deliver_event(const char *class, const char *subclass, nvlist_t *nvl) else if (is_check) ret = zfs_deliver_check(nvl); else - ret = zfs_deliver_add(nvl, is_lofi); + ret = zfs_deliver_add(nvl); return (ret); } -/*ARGSUSED*/ static void * zfs_enum_pools(void *arg) { + (void) arg; (void) zpool_iter(g_zfshdl, zfs_unavail_pool, (void *)&g_pool_list); /* * Linux - instead of using a thread pool, each list entry diff --git a/cmd/zed/agents/zfs_retire.c b/cmd/zed/agents/zfs_retire.c index 1c4cc885b5e5..808b1fb2ac8f 100644 --- a/cmd/zed/agents/zfs_retire.c +++ b/cmd/zed/agents/zfs_retire.c @@ -261,7 +261,6 @@ replace_with_spare(fmd_hdl_t *hdl, zpool_handle_t *zhp, nvlist_t *vdev) * ASRU is now usable. ZFS has found the device to be present and * functioning. */ -/*ARGSUSED*/ static void zfs_vdev_repair(fmd_hdl_t *hdl, nvlist_t *nvl) { @@ -300,11 +299,11 @@ zfs_vdev_repair(fmd_hdl_t *hdl, nvlist_t *nvl) vdev_guid, pool_guid); } -/*ARGSUSED*/ static void zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, const char *class) { + (void) ep; uint64_t pool_guid, vdev_guid; zpool_handle_t *zhp; nvlist_t *resource, *fault; diff --git a/cmd/zed/zed.c b/cmd/zed/zed.c index 0aa03fded468..5e586c63f8e9 100644 --- a/cmd/zed/zed.c +++ b/cmd/zed/zed.c @@ -36,6 +36,7 @@ static volatile sig_atomic_t _got_hup = 0; static void _exit_handler(int signum) { + (void) signum; _got_exit = 1; } @@ -45,6 +46,7 @@ _exit_handler(int signum) static void _hup_handler(int signum) { + (void) signum; _got_hup = 1; } diff --git a/cmd/zed/zed_exec.c b/cmd/zed/zed_exec.c index 1eecfa0a92c4..8f8e4e18fbfc 100644 --- a/cmd/zed/zed_exec.c +++ b/cmd/zed/zed_exec.c @@ -185,11 +185,14 @@ _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog, static void _nop(int sig) -{} +{ + (void) sig; +} static void * _reap_children(void *arg) { + (void) arg; struct launched_process_node node, *pnode; pid_t pid; int status; diff --git a/cmd/zfs/zfs_iter.c b/cmd/zfs/zfs_iter.c index f2359508c16d..872581a744f4 100644 --- a/cmd/zfs/zfs_iter.c +++ b/cmd/zfs/zfs_iter.c @@ -219,10 +219,11 @@ zfs_sort_only_by_name(const zfs_sort_column_t *sc) sc->sc_prop == ZFS_PROP_NAME); } -/* ARGSUSED */ static int zfs_compare(const void *larg, const void *rarg, void *unused) { + (void) unused; + zfs_handle_t *l = ((zfs_node_t *)larg)->zn_handle; zfs_handle_t *r = ((zfs_node_t *)rarg)->zn_handle; const char *lname = zfs_get_name(l); diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index c194cb6b6073..3ad8f7012c92 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -3734,7 +3734,6 @@ zfs_do_list(int argc, char **argv) * The '-p' flag creates all the non-existing ancestors of the target first. * The '-u' flag prevents file systems from being remounted during rename. */ -/* ARGSUSED */ static int zfs_do_rename(int argc, char **argv) { @@ -3833,7 +3832,6 @@ zfs_do_rename(int argc, char **argv) * * Promotes the given clone fs to be the parent */ -/* ARGSUSED */ static int zfs_do_promote(int argc, char **argv) { @@ -5061,10 +5059,11 @@ who_type2weight(zfs_deleg_who_type_t who_type) return (res); } -/* ARGSUSED */ static int who_perm_compare(const void *larg, const void *rarg, void *unused) { + (void) unused; + const who_perm_node_t *l = larg; const who_perm_node_t *r = rarg; zfs_deleg_who_type_t ltype = l->who_perm.who_type; @@ -5084,10 +5083,11 @@ who_perm_compare(const void *larg, const void *rarg, void *unused) return (-1); } -/* ARGSUSED */ static int deleg_perm_compare(const void *larg, const void *rarg, void *unused) { + (void) unused; + const deleg_perm_node_t *l = larg; const deleg_perm_node_t *r = rarg; int res = strncmp(l->dpn_perm.dp_name, r->dpn_perm.dp_name, @@ -7176,10 +7176,11 @@ typedef struct unshare_unmount_node { uu_avl_node_t un_avlnode; } unshare_unmount_node_t; -/* ARGSUSED */ static int unshare_unmount_compare(const void *larg, const void *rarg, void *unused) { + (void) unused; + const unshare_unmount_node_t *l = larg; const unshare_unmount_node_t *r = rarg; @@ -8575,6 +8576,9 @@ zfs_do_wait(int argc, char **argv) static int zfs_do_version(int argc, char **argv) { + (void) argc; + (void) argv; + if (zfs_version_print() == -1) return (1); @@ -8699,7 +8703,6 @@ main(int argc, char **argv) /* * Attach/detach the given dataset to/from the given jail */ -/* ARGSUSED */ static int zfs_do_jail_impl(int argc, char **argv, boolean_t attach) { @@ -8737,7 +8740,6 @@ zfs_do_jail_impl(int argc, char **argv, boolean_t attach) * * Attach the given dataset to the given jail */ -/* ARGSUSED */ static int zfs_do_jail(int argc, char **argv) { @@ -8749,7 +8751,6 @@ zfs_do_jail(int argc, char **argv) * * Detach the given dataset from the given jail */ -/* ARGSUSED */ static int zfs_do_unjail(int argc, char **argv) { diff --git a/cmd/zhack/zhack.c b/cmd/zhack/zhack.c index b27423f538e7..5d2a48b56b28 100644 --- a/cmd/zhack/zhack.c +++ b/cmd/zhack/zhack.c @@ -100,14 +100,14 @@ fatal(spa_t *spa, void *tag, const char *fmt, ...) exit(1); } -/* ARGSUSED */ static int space_delta_cb(dmu_object_type_t bonustype, const void *data, zfs_file_info_t *zoi) { - /* - * Is it a valid type of object to track? - */ + (void) data; + (void) zoi; + + /* Is it a valid type of object to track? */ if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA) return (ENOENT); (void) fprintf(stderr, "modifying object that needs user accounting"); diff --git a/cmd/zinject/zinject.c b/cmd/zinject/zinject.c index bf97b0d68713..28f0c4bd8141 100644 --- a/cmd/zinject/zinject.c +++ b/cmd/zinject/zinject.c @@ -497,11 +497,13 @@ print_all_handlers(void) return (count + total); } -/* ARGSUSED */ static int cancel_one_handler(int id, const char *pool, zinject_record_t *record, void *data) { + (void) pool; + (void) record; + (void) data; zfs_cmd_t zc = {"\0"}; zc.zc_guid = (uint64_t)id; diff --git a/cmd/zpool/os/freebsd/zpool_vdev_os.c b/cmd/zpool/os/freebsd/zpool_vdev_os.c index aa66d29fa604..440ab16e185e 100644 --- a/cmd/zpool/os/freebsd/zpool_vdev_os.c +++ b/cmd/zpool/os/freebsd/zpool_vdev_os.c @@ -86,6 +86,7 @@ int check_device(const char *name, boolean_t force, boolean_t isspare, boolean_t iswholedisk) { + (void) iswholedisk; char path[MAXPATHLEN]; if (strncmp(name, _PATH_DEV, sizeof (_PATH_DEV) - 1) != 0) @@ -99,6 +100,8 @@ check_device(const char *name, boolean_t force, boolean_t isspare, boolean_t check_sector_size_database(char *path, int *sector_size) { + (void) path; + (void) sector_size; return (0); } diff --git a/cmd/zpool/os/linux/zpool_vdev_os.c b/cmd/zpool/os/linux/zpool_vdev_os.c index da87aa79f365..4393282ac522 100644 --- a/cmd/zpool/os/linux/zpool_vdev_os.c +++ b/cmd/zpool/os/linux/zpool_vdev_os.c @@ -409,4 +409,5 @@ check_device(const char *path, boolean_t force, void after_zpool_upgrade(zpool_handle_t *zhp) { + (void) zhp; } diff --git a/cmd/zpool/zpool_iter.c b/cmd/zpool/zpool_iter.c index 3d7a0cfc35e6..dd73bbc802d1 100644 --- a/cmd/zpool/zpool_iter.c +++ b/cmd/zpool/zpool_iter.c @@ -62,10 +62,11 @@ struct zpool_list { zprop_list_t **zl_proplist; }; -/* ARGSUSED */ static int zpool_compare(const void *larg, const void *rarg, void *unused) { + (void) unused; + zpool_handle_t *l = ((zpool_node_t *)larg)->zn_handle; zpool_handle_t *r = ((zpool_node_t *)rarg)->zn_handle; const char *lname = zpool_get_name(l); diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 00dabbb2d1f6..87cc76d089d5 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -867,8 +867,7 @@ add_prop_list(const char *propname, char *propval, nvlist_t **props, * Set a default property pair (name, string-value) in a property nvlist */ static int -add_prop_list_default(const char *propname, char *propval, nvlist_t **props, - boolean_t poolprop) +add_prop_list_default(const char *propname, char *propval, nvlist_t **props) { char *pval; @@ -1428,7 +1427,7 @@ zpool_do_create(int argc, char **argv) ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE)) goto errout; if (add_prop_list_default(zpool_prop_to_name( - ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + ZPOOL_PROP_CACHEFILE), "none", &props)) goto errout; break; case 'm': @@ -1506,7 +1505,7 @@ zpool_do_create(int argc, char **argv) ZPOOL_PROP_TNAME), optarg, &props, B_TRUE)) goto errout; if (add_prop_list_default(zpool_prop_to_name( - ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + ZPOOL_PROP_CACHEFILE), "none", &props)) goto errout; tname = optarg; break; @@ -3539,7 +3538,7 @@ zpool_do_import(int argc, char **argv) ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE)) goto error; if (add_prop_list_default(zpool_prop_to_name( - ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + ZPOOL_PROP_CACHEFILE), "none", &props)) goto error; break; case 's': @@ -3548,7 +3547,7 @@ zpool_do_import(int argc, char **argv) case 't': flags |= ZFS_IMPORT_TEMP_NAME; if (add_prop_list_default(zpool_prop_to_name( - ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + ZPOOL_PROP_CACHEFILE), "none", &props)) goto error; break; @@ -4487,8 +4486,7 @@ single_histo_average(uint64_t *histo, unsigned int buckets) } static void -print_iostat_queues(iostat_cbdata_t *cb, nvlist_t *oldnv, - nvlist_t *newnv) +print_iostat_queues(iostat_cbdata_t *cb, nvlist_t *newnv) { int i; uint64_t val; @@ -4710,7 +4708,7 @@ print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv, if (cb->cb_flags & IOS_LATENCY_M) print_iostat_latency(cb, oldnv, newnv); if (cb->cb_flags & IOS_QUEUES_M) - print_iostat_queues(cb, oldnv, newnv); + print_iostat_queues(cb, newnv); if (cb->cb_flags & IOS_ANYHISTO_M) { printf("\n"); print_iostat_histos(cb, oldnv, newnv, scale, name); @@ -6498,7 +6496,6 @@ zpool_do_attach_or_replace(int argc, char **argv, int replacing) * * Replace with . */ -/* ARGSUSED */ int zpool_do_replace(int argc, char **argv) { @@ -6534,7 +6531,6 @@ zpool_do_attach(int argc, char **argv) * is the last device in the mirror, or if the DTLs indicate that this device * has the only valid copy of some data. */ -/* ARGSUSED */ int zpool_do_detach(int argc, char **argv) { @@ -6841,7 +6837,6 @@ zpool_do_online(int argc, char **argv) * -t Only take the device off-line temporarily. The offline/faulted * state will not be persistent across reboots. */ -/* ARGSUSED */ int zpool_do_offline(int argc, char **argv) { @@ -8985,7 +8980,6 @@ upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg) return (0); } -/* ARGSUSED */ static int upgrade_one(zpool_handle_t *zhp, void *data) { @@ -9750,7 +9744,7 @@ zpool_do_events_next(ev_opts_t *opts) } static int -zpool_do_events_clear(ev_opts_t *opts) +zpool_do_events_clear(void) { int count, ret; @@ -9817,7 +9811,7 @@ zpool_do_events(int argc, char **argv) } if (opts.clear) - ret = zpool_do_events_clear(&opts); + ret = zpool_do_events_clear(); else ret = zpool_do_events_next(&opts); @@ -10579,6 +10573,9 @@ find_command_idx(char *command, int *idx) static int zpool_do_version(int argc, char **argv) { + (void) argc; + (void) argv; + if (zfs_version_print() == -1) return (1); diff --git a/cmd/zpool_influxdb/zpool_influxdb.c b/cmd/zpool_influxdb/zpool_influxdb.c index a30c1588569f..51116d9d5228 100644 --- a/cmd/zpool_influxdb/zpool_influxdb.c +++ b/cmd/zpool_influxdb/zpool_influxdb.c @@ -258,10 +258,10 @@ print_scan_status(nvlist_t *nvroot, const char *pool_name) * get a vdev name that corresponds to the top-level vdev names * printed by `zpool status` */ -static char * -get_vdev_name(nvlist_t *nvroot, const char *parent_name) +static void +get_vdev_name(nvlist_t *nvroot, const char *parent_name, + char *vdev_name, size_t size) { - static char vdev_name[256]; char *vdev_type = NULL; uint64_t vdev_id = 0; @@ -274,14 +274,14 @@ get_vdev_name(nvlist_t *nvroot, const char *parent_name) vdev_id = UINT64_MAX; } if (parent_name == NULL) { - (void) snprintf(vdev_name, sizeof (vdev_name), "%s", - vdev_type); + strlcpy(vdev_name, vdev_type, size); } else { - (void) snprintf(vdev_name, sizeof (vdev_name), - "%s/%s-%llu", + int len = + snprintf(vdev_name, size, "%s/%s-%llu", parent_name, vdev_type, (u_longlong_t)vdev_id); + if (len >= size) /* don't care about truncation */ + vdev_name[size - 1] = '\0'; } - return (vdev_name); } /* @@ -685,9 +685,8 @@ print_recursive_stats(stat_printer_f func, nvlist_t *nvroot, if (descend && nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, &child, &children) == 0) { - (void) strncpy(vdev_name, get_vdev_name(nvroot, parent_name), - sizeof (vdev_name)); - vdev_name[sizeof (vdev_name) - 1] = '\0'; + get_vdev_name( + nvroot, parent_name, vdev_name, sizeof (vdev_name)); for (c = 0; c < children; c++) { print_recursive_stats(func, child[c], pool_name, diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 23a2d818322d..6ca4669a127b 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -1189,10 +1189,10 @@ ztest_kill(ztest_shared_t *zs) (void) kill(getpid(), SIGKILL); } -/* ARGSUSED */ static void ztest_record_enospc(const char *s) { + (void) s; ztest_shared->zs_enospc_count++; } @@ -2387,10 +2387,10 @@ zil_replay_func_t *ztest_replay_vector[TX_MAX_TYPE] = { * ZIL get_data callbacks */ -/* ARGSUSED */ static void ztest_get_done(zgd_t *zgd, int error) { + (void) error; ztest_ds_t *zd = zgd->zgd_private; uint64_t object = ((rl_t *)zgd->zgd_lr)->rl_object; @@ -2407,6 +2407,7 @@ static int ztest_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf, struct lwb *lwb, zio_t *zio) { + (void) arg2; ztest_ds_t *zd = arg; objset_t *os = zd->zd_os; uint64_t object = lr->lr_foid; @@ -2867,10 +2868,10 @@ ztest_object_init(ztest_ds_t *zd, ztest_od_t *od, size_t size, boolean_t remove) return (rv); } -/* ARGSUSED */ void ztest_zil_commit(ztest_ds_t *zd, uint64_t id) { + (void) id; zilog_t *zilog = zd->zd_zilog; (void) pthread_rwlock_rdlock(&zd->zd_zilog_lock); @@ -2896,10 +2897,10 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_t id) * mount/unmount operation. We hold the dataset across these operations in an * attempt to expose any implicit assumptions about ZIL management. */ -/* ARGSUSED */ void ztest_zil_remount(ztest_ds_t *zd, uint64_t id) { + (void) id; objset_t *os = zd->zd_os; /* @@ -2933,10 +2934,11 @@ ztest_zil_remount(ztest_ds_t *zd, uint64_t id) * Verify that we can't destroy an active pool, create an existing pool, * or create a pool with a bad vdev spec. */ -/* ARGSUSED */ void ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; ztest_shared_opts_t *zo = &ztest_opts; spa_t *spa; nvlist_t *nvroot; @@ -2996,10 +2998,11 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id) * Start and then stop the MMP threads to ensure the startup and shutdown code * works properly. Actual protection and property-related code tested via ZTS. */ -/* ARGSUSED */ void ztest_mmp_enable_disable(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; ztest_shared_opts_t *zo = &ztest_opts; spa_t *spa = ztest_spa; @@ -3042,10 +3045,11 @@ ztest_mmp_enable_disable(ztest_ds_t *zd, uint64_t id) spa_config_exit(spa, SCL_CONFIG, FTAG); } -/* ARGSUSED */ void ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; spa_t *spa; uint64_t initial_version = SPA_VERSION_INITIAL; uint64_t version, newversion; @@ -3162,10 +3166,11 @@ ztest_spa_discard_checkpoint(spa_t *spa) } -/* ARGSUSED */ void ztest_spa_checkpoint_create_discard(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; spa_t *spa = ztest_spa; mutex_enter(&ztest_checkpoint_lock); @@ -3206,10 +3211,11 @@ spa_num_top_vdevs(spa_t *spa) /* * Verify that vdev_add() works as expected. */ -/* ARGSUSED */ void ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; ztest_shared_t *zs = ztest_shared; spa_t *spa = ztest_spa; uint64_t leaves; @@ -3296,10 +3302,10 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id) mutex_exit(&ztest_vdev_lock); } -/* ARGSUSED */ void ztest_vdev_class_add(ztest_ds_t *zd, uint64_t id) { + (void) id; ztest_shared_t *zs = ztest_shared; spa_t *spa = ztest_spa; uint64_t leaves; @@ -3377,10 +3383,11 @@ ztest_vdev_class_add(ztest_ds_t *zd, uint64_t id) /* * Verify that adding/removing aux devices (l2arc, hot spare) works as expected. */ -/* ARGSUSED */ void ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; ztest_shared_t *zs = ztest_shared; spa_t *spa = ztest_spa; vdev_t *rvd = spa->spa_root_vdev; @@ -3489,10 +3496,11 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id) /* * split a pool if it has mirror tlvdevs */ -/* ARGSUSED */ void ztest_split_pool(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; ztest_shared_t *zs = ztest_shared; spa_t *spa = ztest_spa; vdev_t *rvd = spa->spa_root_vdev; @@ -3584,10 +3592,11 @@ ztest_split_pool(ztest_ds_t *zd, uint64_t id) /* * Verify that we can attach and detach devices. */ -/* ARGSUSED */ void ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; ztest_shared_t *zs = ztest_shared; spa_t *spa = ztest_spa; spa_aux_vdev_t *sav = &spa->spa_spares; @@ -3827,10 +3836,11 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id) umem_free(newpath, MAXPATHLEN); } -/* ARGSUSED */ void ztest_device_removal(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; spa_t *spa = ztest_spa; vdev_t *vd; uint64_t guid; @@ -3920,10 +3930,10 @@ grow_vdev(vdev_t *vd, void *arg) /* * Callback function which expands a given vdev by calling vdev_online(). */ -/* ARGSUSED */ static vdev_t * online_vdev(vdev_t *vd, void *arg) { + (void) arg; spa_t *spa = vd->vdev_spa; vdev_t *tvd = vd->vdev_top; uint64_t guid = vd->vdev_guid; @@ -4004,10 +4014,11 @@ vdev_walk_tree(vdev_t *vd, vdev_t *(*func)(vdev_t *, void *), void *arg) /* * Verify that dynamic LUN growth works as expected. */ -/* ARGSUSED */ void ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; spa_t *spa = ztest_spa; vdev_t *vd, *tvd; metaslab_class_t *mc; @@ -4159,10 +4170,12 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id) /* * Verify that dmu_objset_{create,destroy,open,close} work as expected. */ -/* ARGSUSED */ static void ztest_objset_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx) { + (void) arg; + (void) cr; + /* * Create the objects common to all ztest datasets. */ @@ -4239,10 +4252,10 @@ ztest_dataset_create(char *dsname) ZFS_SYNC_ALWAYS, B_FALSE)); } -/* ARGSUSED */ static int ztest_objset_destroy_cb(const char *name, void *arg) { + (void) arg; objset_t *os; dmu_object_info_t doi; int error; @@ -4315,10 +4328,10 @@ ztest_snapshot_destroy(char *osname, uint64_t id) return (B_TRUE); } -/* ARGSUSED */ void ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id) { + (void) zd; ztest_ds_t *zdtmp; int iters; int error; @@ -4640,6 +4653,8 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t id) void ztest_dmu_object_next_chunk(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; objset_t *os = zd->zd_os; int dnodes_per_chunk = 1 << dmu_object_alloc_chunk_shift; uint64_t object; @@ -5186,10 +5201,10 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id) umem_free(od, size); } -/* ARGSUSED */ void ztest_dmu_write_parallel(ztest_ds_t *zd, uint64_t id) { + (void) id; ztest_od_t *od; od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL); @@ -5448,10 +5463,10 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id) umem_free(od, sizeof (ztest_od_t)); } -/* ARGSUSED */ void ztest_zap_parallel(ztest_ds_t *zd, uint64_t id) { + (void) id; objset_t *os = zd->zd_os; ztest_od_t *od; uint64_t txg, object, count, wsize, wc, zl_wsize, zl_wc; @@ -5783,10 +5798,10 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id) * are consistent what was stored in the block tag when it was created, * and that its unused bonus buffer space has not been overwritten. */ -/* ARGSUSED */ void ztest_verify_dnode_bt(ztest_ds_t *zd, uint64_t id) { + (void) id; objset_t *os = zd->zd_os; uint64_t obj; int err = 0; @@ -5818,10 +5833,11 @@ ztest_verify_dnode_bt(ztest_ds_t *zd, uint64_t id) } } -/* ARGSUSED */ void ztest_dsl_prop_get_set(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; zfs_prop_t proplist[] = { ZFS_PROP_CHECKSUM, ZFS_PROP_COMPRESSION, @@ -5842,10 +5858,11 @@ ztest_dsl_prop_get_set(ztest_ds_t *zd, uint64_t id) (void) pthread_rwlock_unlock(&ztest_name_lock); } -/* ARGSUSED */ void ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; nvlist_t *props = NULL; (void) pthread_rwlock_rdlock(&ztest_name_lock); @@ -6006,10 +6023,11 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id) /* * Inject random faults into the on-disk data. */ -/* ARGSUSED */ void ztest_fault_inject(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; ztest_shared_t *zs = ztest_shared; spa_t *spa = ztest_spa; int fd; @@ -6322,10 +6340,11 @@ ztest_scrub_impl(spa_t *spa) /* * Scrub the pool. */ -/* ARGSUSED */ void ztest_scrub(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; spa_t *spa = ztest_spa; int error; @@ -6350,10 +6369,11 @@ ztest_scrub(ztest_ds_t *zd, uint64_t id) /* * Change the guid for the pool. */ -/* ARGSUSED */ void ztest_reguid(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; spa_t *spa = ztest_spa; uint64_t orig, load; int error; @@ -6383,6 +6403,8 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id) void ztest_fletcher(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; hrtime_t end = gethrtime() + NANOSEC; while (gethrtime() <= end) { @@ -6452,6 +6474,8 @@ ztest_fletcher(ztest_ds_t *zd, uint64_t id) void ztest_fletcher_incr(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; void *buf; size_t size; int *ptr; @@ -6655,10 +6679,11 @@ ztest_random_concrete_vdev_leaf(vdev_t *vd) return (ztest_random_concrete_vdev_leaf(eligible[child_no])); } -/* ARGSUSED */ void ztest_initialize(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; spa_t *spa = ztest_spa; int error = 0; @@ -6683,7 +6708,7 @@ ztest_initialize(ztest_ds_t *zd, uint64_t id) char *path = strdup(rand_vd->vdev_path); boolean_t active = rand_vd->vdev_initialize_thread != NULL; - zfs_dbgmsg("vd %px, guid %llu", rand_vd, guid); + zfs_dbgmsg("vd %px, guid %"PRIu64"", rand_vd, guid); spa_config_exit(spa, SCL_VDEV, FTAG); uint64_t cmd = ztest_random(POOL_INITIALIZE_FUNCS); @@ -6727,10 +6752,11 @@ ztest_initialize(ztest_ds_t *zd, uint64_t id) mutex_exit(&ztest_vdev_lock); } -/* ARGSUSED */ void ztest_trim(ztest_ds_t *zd, uint64_t id) { + (void) zd; + (void) id; spa_t *spa = ztest_spa; int error = 0; @@ -6755,7 +6781,7 @@ ztest_trim(ztest_ds_t *zd, uint64_t id) char *path = strdup(rand_vd->vdev_path); boolean_t active = rand_vd->vdev_trim_thread != NULL; - zfs_dbgmsg("vd %p, guid %llu", rand_vd, guid); + zfs_dbgmsg("vd %p, guid %"PRIu64"", rand_vd, guid); spa_config_exit(spa, SCL_VDEV, FTAG); uint64_t cmd = ztest_random(POOL_TRIM_FUNCS); @@ -7244,10 +7270,10 @@ ztest_dataset_close(int d) ztest_zd_fini(zd); } -/* ARGSUSED */ static int ztest_replay_zil_cb(const char *name, void *arg) { + (void) arg; objset_t *os; ztest_ds_t *zdtmp; @@ -7371,6 +7397,7 @@ ztest_freeze(void) static void ztest_import_impl(ztest_shared_t *zs) { + (void) zs; importargs_t args = { 0 }; nvlist_t *cfg = NULL; int nsearch = 1; diff --git a/config/Rules.am b/config/Rules.am index ef10d493896d..97a216848d4e 100644 --- a/config/Rules.am +++ b/config/Rules.am @@ -26,6 +26,7 @@ AM_LIBTOOLFLAGS = --silent AM_CFLAGS = -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes AM_CFLAGS += -fno-strict-aliasing AM_CFLAGS += $(NO_OMIT_FRAME_POINTER) +AM_CFLAGS += $(UNUSED_BUT_SET_VARIABLE) $(UNUSED_PARAMETER) AM_CFLAGS += $(DEBUG_CFLAGS) AM_CFLAGS += $(ASAN_CFLAGS) AM_CFLAGS += $(CODE_COVERAGE_CFLAGS) $(NO_FORMAT_ZERO_LENGTH) diff --git a/config/always-compiler-options.m4 b/config/always-compiler-options.m4 index a84123317989..f303d5560e4d 100644 --- a/config/always-compiler-options.m4 +++ b/config/always-compiler-options.m4 @@ -151,14 +151,37 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [ NO_UNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable + UNUSED_BUT_SET_VARIABLE=-Wunused-but-set-variable AC_MSG_RESULT([yes]) ], [ NO_UNUSED_BUT_SET_VARIABLE= + UNUSED_BUT_SET_VARIABLE= AC_MSG_RESULT([no]) ]) CFLAGS="$saved_flags" - AC_SUBST([NO_UNUSED_BUT_SET_VARIABLE]) + AC_SUBST([UNUSED_BUT_SET_VARIABLE]) +]) + +dnl # +dnl # Check if gcc supports -Wunused-parameter option. +dnl # +AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_UNUSED_PARAMETER], [ + AC_MSG_CHECKING([whether $CC supports -Wunused-parameter]) + + saved_flags="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wunused-parameter" + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [ + UNUSED_PARAMETER=-Wunused-parameter + AC_MSG_RESULT([yes]) + ], [ + UNUSED_PARAMETER= + AC_MSG_RESULT([no]) + ]) + + CFLAGS="$saved_flags" + AC_SUBST([UNUSED_PARAMETER]) ]) dnl # diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index c4fe07c810b0..f1b5af5423cb 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -54,6 +54,7 @@ AC_DEFUN([ZFS_AC_DEBUG], [ AC_SUBST(DEBUG_LDFLAGS) AC_SUBST(DEBUG_ZFS) AC_SUBST(WITH_DEBUG) + AM_CONDITIONAL([WITH_DEBUG], [test x"${WITH_DEBUG}" = xtrue]) AC_SUBST(KERNEL_DEBUG_CFLAGS) AC_SUBST(KERNEL_DEBUG_CPPFLAGS) @@ -193,6 +194,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [ AC_SUBST(CPU_COUNT) ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE + ZFS_AC_CONFIG_ALWAYS_CC_UNUSED_PARAMETER ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION @@ -200,6 +202,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [ ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA ZFS_AC_CONFIG_ALWAYS_CC_ASAN + ZFS_AC_CONFIG_ALWAYS_CC_UNUSED_PARAMETER ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD ZFS_AC_CONFIG_ALWAYS_SYSTEM ZFS_AC_CONFIG_ALWAYS_ARCH diff --git a/contrib/pam_zfs_key/Makefile.am b/contrib/pam_zfs_key/Makefile.am index f0f2550afccb..74ff07ad04f9 100644 --- a/contrib/pam_zfs_key/Makefile.am +++ b/contrib/pam_zfs_key/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/config/Rules.am AM_CFLAGS += $(LIBCRYPTO_CFLAGS) -pammodule_LTLIBRARIES=pam_zfs_key.la +pammodule_LTLIBRARIES = pam_zfs_key.la pam_zfs_key_la_SOURCES = pam_zfs_key.c diff --git a/contrib/pam_zfs_key/pam_zfs_key.c b/contrib/pam_zfs_key/pam_zfs_key.c index 4cafc37b9b47..18303cea5098 100644 --- a/contrib/pam_zfs_key/pam_zfs_key.c +++ b/contrib/pam_zfs_key/pam_zfs_key.c @@ -46,6 +46,7 @@ static void pam_syslog(pam_handle_t *pamh, int loglevel, const char *fmt, ...) { + (void) pamh; va_list args; va_start(args, fmt); vsyslog(loglevel, fmt, args); @@ -179,6 +180,9 @@ pw_clear(pam_handle_t *pamh) static void destroy_pw(pam_handle_t *pamh, void *data, int errcode) { + (void) pamh; + (void) errcode; + if (data != NULL) { pw_free((pw_password_t *)data); } @@ -598,6 +602,10 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) { + (void) flags; + (void) argc; + (void) argv; + if (pw_fetch_lazy(pamh) == NULL) { return (PAM_AUTH_ERR); } @@ -610,6 +618,10 @@ PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv) { + (void) pamh; + (void) flags; + (void) argc; + (void) argv; return (PAM_SUCCESS); } @@ -620,7 +632,7 @@ pam_sm_chauthtok(pam_handle_t *pamh, int flags, { if (geteuid() != 0) { pam_syslog(pamh, LOG_ERR, - "Cannot zfs_mount when not being root."); + "Cannot zfs_mount when not root."); return (PAM_PERM_DENIED); } zfs_key_config_t config; @@ -697,9 +709,11 @@ PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { + (void) flags; + if (geteuid() != 0) { pam_syslog(pamh, LOG_ERR, - "Cannot zfs_mount when not being root."); + "Cannot zfs_mount when not root."); return (PAM_SUCCESS); } zfs_key_config_t config; @@ -751,9 +765,11 @@ PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { + (void) flags; + if (geteuid() != 0) { pam_syslog(pamh, LOG_ERR, - "Cannot zfs_mount when not being root."); + "Cannot zfs_mount when not root."); return (PAM_SUCCESS); } zfs_key_config_t config; diff --git a/include/os/freebsd/linux/compiler.h b/include/os/freebsd/linux/compiler.h index 05e93efa64d7..7a5b86aaa5d1 100644 --- a/include/os/freebsd/linux/compiler.h +++ b/include/os/freebsd/linux/compiler.h @@ -40,14 +40,14 @@ #define __force #define __nocast #define __iomem -#define __chk_user_ptr(x) ((void)0) -#define __chk_io_ptr(x) ((void)0) +#define __chk_user_ptr(x) ((void)sizeof (x)) +#define __chk_io_ptr(x) ((void)sizeof (x)) #define __builtin_warning(x, y...) (1) #define __acquires(x) #define __releases(x) #define __acquire(x) do { } while (0) #define __release(x) do { } while (0) -#define __cond_lock(x, c) (c) +#define __cond_lock(x, c) ((void)sizeof (x), c) #define __bitwise #define __devinitdata #define __deprecated diff --git a/include/os/freebsd/spl/sys/ccompile.h b/include/os/freebsd/spl/sys/ccompile.h index 9970443103bf..c7ac2d5fa710 100644 --- a/include/os/freebsd/spl/sys/ccompile.h +++ b/include/os/freebsd/spl/sys/ccompile.h @@ -37,10 +37,10 @@ extern "C" { #endif #if defined(_KERNEL) || defined(_STANDALONE) -#define __NORETURN __sun_attr__((__noreturn__)) +#define __NORETURN __attribute__((noreturn)) #endif /* _KERNEL || _STANDALONE */ -#define __CONST __sun_attr__((__const__)) -#define __PURE __sun_attr__((__pure__)) +#define __CONST __attribute__((const)) +#define __PURE __attribute__((pure)) #if defined(INVARIANTS) && !defined(ZFS_DEBUG) #define ZFS_DEBUG diff --git a/include/os/freebsd/spl/sys/debug.h b/include/os/freebsd/spl/sys/debug.h index 1f820bc3345f..3c4f349469d6 100644 --- a/include/os/freebsd/spl/sys/debug.h +++ b/include/os/freebsd/spl/sys/debug.h @@ -133,14 +133,14 @@ void spl_dumpstack(void); */ #ifdef NDEBUG -#define ASSERT(x) ((void)0) -#define ASSERT3B(x,y,z) ((void)0) -#define ASSERT3S(x,y,z) ((void)0) -#define ASSERT3U(x,y,z) ((void)0) -#define ASSERT3P(x,y,z) ((void)0) -#define ASSERT0(x) ((void)0) -#define IMPLY(A, B) ((void)0) -#define EQUIV(A, B) ((void)0) +#define ASSERT(x) ((void)sizeof(x)) +#define ASSERT3B(x,y,z) ((void)sizeof((x) y (z))) +#define ASSERT3S(x,y,z) ((void)sizeof((x) y (z))) +#define ASSERT3U(x,y,z) ((void)sizeof((x) y (z))) +#define ASSERT3P(x,y,z) ((void)sizeof((x) y (z))) +#define ASSERT0(x) ((void)sizeof(x)) +#define IMPLY(A, B) ((void)sizeof(!(A) || (B))) +#define EQUIV(A, B) ((void)sizeof(!(A) || (B))) /* * Debugging enabled (--enable-debug) diff --git a/include/os/freebsd/zfs/sys/zfs_vfsops_os.h b/include/os/freebsd/zfs/sys/zfs_vfsops_os.h index ccbbf4f73224..3edb7c4ec693 100644 --- a/include/os/freebsd/zfs/sys/zfs_vfsops_os.h +++ b/include/os/freebsd/zfs/sys/zfs_vfsops_os.h @@ -132,19 +132,19 @@ struct zfsvfs { rms_try_rlock(&(zfsvfs)->z_teardown_lock) #define ZFS_TEARDOWN_ENTER_READ(zfsvfs, tag) \ - rms_rlock(&(zfsvfs)->z_teardown_lock); + ((void)sizeof (tag), rms_rlock(&(zfsvfs)->z_teardown_lock)); #define ZFS_TEARDOWN_EXIT_READ(zfsvfs, tag) \ - rms_runlock(&(zfsvfs)->z_teardown_lock) + ((void)sizeof (tag), rms_runlock(&(zfsvfs)->z_teardown_lock)) #define ZFS_TEARDOWN_ENTER_WRITE(zfsvfs, tag) \ - rms_wlock(&(zfsvfs)->z_teardown_lock) + ((void)sizeof (tag), rms_wlock(&(zfsvfs)->z_teardown_lock)) #define ZFS_TEARDOWN_EXIT_WRITE(zfsvfs) \ rms_wunlock(&(zfsvfs)->z_teardown_lock) #define ZFS_TEARDOWN_EXIT(zfsvfs, tag) \ - rms_unlock(&(zfsvfs)->z_teardown_lock) + ((void)sizeof (tag), rms_unlock(&(zfsvfs)->z_teardown_lock)) #define ZFS_TEARDOWN_READ_HELD(zfsvfs) \ rms_rowned(&(zfsvfs)->z_teardown_lock) diff --git a/include/os/linux/kernel/linux/vfs_compat.h b/include/os/linux/kernel/linux/vfs_compat.h index 91e908598fbb..8a38d22ccf83 100644 --- a/include/os/linux/kernel/linux/vfs_compat.h +++ b/include/os/linux/kernel/linux/vfs_compat.h @@ -455,7 +455,8 @@ zpl_is_32bit_api(void) #define zpl_generic_fillattr(user_ns, ip, sp) \ generic_fillattr(user_ns, ip, sp) #else -#define zpl_generic_fillattr(user_ns, ip, sp) generic_fillattr(ip, sp) +#define zpl_generic_fillattr(user_ns, ip, sp) \ + ((void)sizeof (user_ns), generic_fillattr(ip, sp)) #endif #endif /* _ZFS_VFS_H */ diff --git a/include/os/linux/spl/sys/debug.h b/include/os/linux/spl/sys/debug.h index dc6b85eebff7..06e517cd9a60 100644 --- a/include/os/linux/spl/sys/debug.h +++ b/include/os/linux/spl/sys/debug.h @@ -133,14 +133,14 @@ void spl_dumpstack(void); */ #ifdef NDEBUG -#define ASSERT(x) ((void)0) -#define ASSERT3B(x,y,z) ((void)0) -#define ASSERT3S(x,y,z) ((void)0) -#define ASSERT3U(x,y,z) ((void)0) -#define ASSERT3P(x,y,z) ((void)0) -#define ASSERT0(x) ((void)0) -#define IMPLY(A, B) ((void)0) -#define EQUIV(A, B) ((void)0) +#define ASSERT(x) ((void)sizeof(x)) +#define ASSERT3B(x,y,z) ((void)sizeof((x) y (z))) +#define ASSERT3S(x,y,z) ((void)sizeof((x) y (z))) +#define ASSERT3U(x,y,z) ((void)sizeof((x) y (z))) +#define ASSERT3P(x,y,z) ((void)sizeof((x) y (z))) +#define ASSERT0(x) ((void)sizeof(x)) +#define IMPLY(A, B) ((void)sizeof(!(A) || (B))) +#define EQUIV(A, B) ((void)sizeof(!(A) || (B))) /* * Debugging enabled (--enable-debug) diff --git a/include/os/linux/spl/sys/thread.h b/include/os/linux/spl/sys/thread.h index 220742387b62..f704a33fbc37 100644 --- a/include/os/linux/spl/sys/thread.h +++ b/include/os/linux/spl/sys/thread.h @@ -46,14 +46,12 @@ typedef void (*thread_func_t)(void *); #define thread_create_named(name, stk, stksize, func, arg, len, \ pp, state, pri) \ - __thread_create(stk, stksize, (thread_func_t)func, \ - name, arg, len, pp, state, pri) + __thread_create(stk, stksize, (thread_func_t)func, name, \ + arg, len, pp, state, pri) -/* BEGIN CSTYLED */ #define thread_create(stk, stksize, func, arg, len, pp, state, pri) \ - __thread_create(stk, stksize, (thread_func_t)func, \ - #func, arg, len, pp, state, pri) -/* END CSTYLED */ + __thread_create(stk, stksize, (thread_func_t)func, #func, \ + arg, len, pp, state, pri) #define thread_exit() __thread_exit() #define thread_join(t) VERIFY(0) diff --git a/include/os/linux/spl/sys/zone.h b/include/os/linux/spl/sys/zone.h index 00e30f690c38..c6899620f69e 100644 --- a/include/os/linux/spl/sys/zone.h +++ b/include/os/linux/spl/sys/zone.h @@ -28,8 +28,9 @@ #define GLOBAL_ZONEID 0 -#define zone_dataset_visible(x, y) (1) +#define zone_dataset_visible(x, y) \ + ((void)sizeof ((char *)y - (char *)x), 1) #define crgetzoneid(x) (GLOBAL_ZONEID) -#define INGLOBALZONE(z) (1) +#define INGLOBALZONE(z) ((void)sizeof (z), 1) #endif /* SPL_ZONE_H */ diff --git a/include/sys/abd_impl.h b/include/sys/abd_impl.h index 435a8dc6d9ce..f1facaf5d704 100644 --- a/include/sys/abd_impl.h +++ b/include/sys/abd_impl.h @@ -94,15 +94,15 @@ void abd_iter_unmap(struct abd_iter *); #if defined(_KERNEL) #if defined(__FreeBSD__) -#define abd_enter_critical(flags) critical_enter() -#define abd_exit_critical(flags) critical_exit() +#define abd_enter_critical(flags) ((void)sizeof (flags), critical_enter()) +#define abd_exit_critical(flags) ((void)sizeof (flags), critical_exit()) #else #define abd_enter_critical(flags) local_irq_save(flags) #define abd_exit_critical(flags) local_irq_restore(flags) #endif #else /* !_KERNEL */ -#define abd_enter_critical(flags) ((void)0) -#define abd_exit_critical(flags) ((void)0) +#define abd_enter_critical(flags) ((void)sizeof (flags)) +#define abd_exit_critical(flags) ((void)sizeof (flags)) #endif #ifdef __cplusplus diff --git a/include/sys/arc.h b/include/sys/arc.h index dbb32ede0af4..fff2462fe310 100644 --- a/include/sys/arc.h +++ b/include/sys/arc.h @@ -276,7 +276,7 @@ arc_buf_t *arc_loan_raw_buf(spa_t *spa, uint64_t dsobj, boolean_t byteorder, void arc_return_buf(arc_buf_t *buf, void *tag); void arc_loan_inuse_buf(arc_buf_t *buf, void *tag); void arc_buf_destroy(arc_buf_t *buf, void *tag); -void arc_buf_info(arc_buf_t *buf, arc_buf_info_t *abi, int state_index); +void arc_buf_info(arc_buf_t *buf, arc_buf_info_t *abi); uint64_t arc_buf_size(arc_buf_t *buf); uint64_t arc_buf_lsize(arc_buf_t *buf); void arc_buf_access(arc_buf_t *buf); @@ -285,9 +285,7 @@ int arc_released(arc_buf_t *buf); void arc_buf_sigsegv(int sig, siginfo_t *si, void *unused); void arc_buf_freeze(arc_buf_t *buf); void arc_buf_thaw(arc_buf_t *buf); -#ifdef ZFS_DEBUG int arc_referenced(arc_buf_t *buf); -#endif int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_read_done_func_t *done, void *priv, zio_priority_t priority, diff --git a/include/sys/bitops.h b/include/sys/bitops.h index 69d07d76552a..5de43325adea 100644 --- a/include/sys/bitops.h +++ b/include/sys/bitops.h @@ -50,13 +50,13 @@ extern "C" { #define BF64_GET(x, low, len) BF64_DECODE(x, low, len) #define BF32_SET(x, low, len, val) do { \ - ASSERT3U(val, <, 1U << (len)); \ + ASSERT3U((val) + 0U, <, 1U << (len)); \ ASSERT3U(low + len, <=, 32); \ (x) ^= BF32_ENCODE((x >> low) ^ (val), low, len); \ } while (0) #define BF64_SET(x, low, len, val) do { \ - ASSERT3U(val, <, 1ULL << (len)); \ + ASSERT3U((val) + 0ULL, <, 1ULL << (len)); \ ASSERT3U(low + len, <=, 64); \ ((x) ^= BF64_ENCODE((x >> low) ^ (val), low, len)); \ } while (0) diff --git a/include/sys/dmu.h b/include/sys/dmu.h index 10e29a45c89f..387f0be7a040 100644 --- a/include/sys/dmu.h +++ b/include/sys/dmu.h @@ -662,7 +662,6 @@ typedef struct dmu_buf_user { * NOTE: This function should only be called once on a given dmu_buf_user_t. * To allow enforcement of this, dbu must already be zeroed on entry. */ -/*ARGSUSED*/ static inline void dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func_sync, dmu_buf_evict_func_t *evict_func_async, diff --git a/include/sys/dnode.h b/include/sys/dnode.h index 1f2c4278a3aa..cb5905a08709 100644 --- a/include/sys/dnode.h +++ b/include/sys/dnode.h @@ -614,7 +614,10 @@ extern dnode_stats_t dnode_stats; #else -#define dprintf_dnode(db, fmt, ...) +extern int _not_dprintf_dnode(struct dnode *, const char *, ...) + __attribute__((format(printf, 2, 3))); +#define dprintf_dnode(dn, fmt, ...) \ + ((void)sizeof (_not_dprintf_dnode(dn, fmt, __VA_ARGS__))) #define DNODE_VERIFY(dn) #define FREE_VERIFY(db, start, end, tx) diff --git a/include/sys/efi_partition.h b/include/sys/efi_partition.h index 88bdfd2b1ca3..a76e1f081055 100644 --- a/include/sys/efi_partition.h +++ b/include/sys/efi_partition.h @@ -368,7 +368,6 @@ extern int efi_alloc_and_read(int, struct dk_gpt **); extern int efi_write(int, struct dk_gpt *); extern int efi_rescan(int); extern void efi_free(struct dk_gpt *); -extern int efi_type(int); extern void efi_err_check(struct dk_gpt *); extern int efi_auto_sense(int fd, struct dk_gpt **); extern int efi_use_whole_disk(int fd); diff --git a/include/sys/lua/lualib.h b/include/sys/lua/lualib.h index 7b848787c8f0..f3babdb9bd8d 100644 --- a/include/sys/lua/lualib.h +++ b/include/sys/lua/lualib.h @@ -49,7 +49,7 @@ LUALIB_API void (luaL_openlibs) (lua_State *L); #if !defined(lua_assert) -#define lua_assert(x) ((void)0) +#define lua_assert(x) ((void)sizeof(x)) #endif diff --git a/include/sys/qat.h b/include/sys/qat.h index 9ae8eb173572..390748a6ae10 100644 --- a/include/sys/qat.h +++ b/include/sys/qat.h @@ -192,7 +192,11 @@ extern int qat_checksum(uint64_t cksum, uint8_t *buf, uint64_t size, #define qat_crypt_use_accel(s_len) 0 #define qat_checksum_use_accel(s_len) 0 #define qat_compress(dir, s, sl, d, dl, cl) 0 -#define qat_crypt(dir, s, d, a, al, i, db, k, c, el) 0 +#define qat_crypt(dir, s, d, a, al, i, db, k, c, el) \ + ((void)sizeof (dir), (void)sizeof (s), (void)sizeof (d), \ + (void) sizeof (a), (void) sizeof (al), (void) sizeof (i), \ + (void) sizeof (db), (void) sizeof (k), (void) sizeof (c), \ + (void) sizeof (el), 0) #define qat_checksum(c, buf, s, z) 0 #endif diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 35c3c6a4674e..fe7a41b03dfd 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -223,11 +223,13 @@ typedef pthread_t kthread_t; #define kpreempt(x) yield() #define getcomm() "unknown" -#define thread_create_named(name, stk, stksize, func, arg, len, \ - pp, state, pri) \ - zk_thread_create(func, arg, stksize, state) +extern int _not_thread_create(int _, ...); +#define thread_create_named(name, stk, stksize, func, arg, len, pp, state, pri)\ + ((void)sizeof (_not_thread_create(0, name, stk, len, pp, pri)), \ + zk_thread_create(func, arg, stksize, state)) #define thread_create(stk, stksize, func, arg, len, pp, state, pri) \ - zk_thread_create(func, arg, stksize, state) + ((void)sizeof (_not_thread_create(0, stk, len, pp, pri)), \ + zk_thread_create(func, arg, stksize, state)) #define thread_exit() pthread_exit(NULL) #define thread_join(t) pthread_join((pthread_t)(t), NULL) diff --git a/include/sys/zfs_debug.h b/include/sys/zfs_debug.h index 8b9629fb5e25..d219090a666d 100644 --- a/include/sys/zfs_debug.h +++ b/include/sys/zfs_debug.h @@ -61,7 +61,7 @@ extern int zfs_dbgmsg_enable; extern void __set_error(const char *file, const char *func, int line, int err); extern void __zfs_dbgmsg(char *buf); extern void __dprintf(boolean_t dprint, const char *file, const char *func, - int line, const char *fmt, ...); + int line, const char *fmt, ...) __attribute__((format(printf, 5, 6))); /* * Some general principles for using zfs_dbgmsg(): @@ -92,8 +92,10 @@ extern void __dprintf(boolean_t dprint, const char *file, const char *func, if (zfs_flags & ZFS_DEBUG_DPRINTF) \ __dprintf(B_TRUE, __FILE__, __func__, __LINE__, __VA_ARGS__) #else -#define dprintf(...) ((void)0) -#endif /* ZFS_DEBUG */ +extern int _not_dprintf(const char *, ...) + __attribute__((format(printf, 1, 2))); +#define dprintf(...) ((void)sizeof (_not_dprintf(__VA_ARGS__))) +#endif extern void zfs_panic_recover(const char *fmt, ...); diff --git a/include/sys/zfs_refcount.h b/include/sys/zfs_refcount.h index fc0cbea1cf7c..39e4ca1c0cce 100644 --- a/include/sys/zfs_refcount.h +++ b/include/sys/zfs_refcount.h @@ -98,12 +98,14 @@ typedef struct refcount { #define zfs_refcount_destroy_many(rc, number) ((rc)->rc_count = 0) #define zfs_refcount_is_zero(rc) ((rc)->rc_count == 0) #define zfs_refcount_count(rc) ((rc)->rc_count) -#define zfs_refcount_add(rc, holder) atomic_inc_64_nv(&(rc)->rc_count) -#define zfs_refcount_remove(rc, holder) atomic_dec_64_nv(&(rc)->rc_count) +#define zfs_refcount_add(rc, holder) \ + ((void)sizeof (holder), atomic_inc_64_nv(&(rc)->rc_count)) +#define zfs_refcount_remove(rc, holder) \ + ((void)sizeof (holder), atomic_dec_64_nv(&(rc)->rc_count)) #define zfs_refcount_add_many(rc, number, holder) \ - atomic_add_64_nv(&(rc)->rc_count, number) + ((void)sizeof (holder), atomic_add_64_nv(&(rc)->rc_count, number)) #define zfs_refcount_remove_many(rc, number, holder) \ - atomic_add_64_nv(&(rc)->rc_count, -number) + ((void)sizeof (holder), atomic_add_64_nv(&(rc)->rc_count, -number)) #define zfs_refcount_transfer(dst, src) { \ uint64_t __tmp = (src)->rc_count; \ atomic_add_64(&(src)->rc_count, -__tmp); \ diff --git a/lib/libefi/rdwr_efi.c b/lib/libefi/rdwr_efi.c index 1e022cc8eeaa..c143a1929a2e 100644 --- a/lib/libefi/rdwr_efi.c +++ b/lib/libefi/rdwr_efi.c @@ -1575,33 +1575,6 @@ efi_free(struct dk_gpt *ptr) free(ptr); } -/* - * Input: File descriptor - * Output: 1 if disk has an EFI label, or > 2TB with no VTOC or legacy MBR. - * Otherwise 0. - */ -int -efi_type(int fd) -{ -#if 0 - struct vtoc vtoc; - struct extvtoc extvtoc; - - if (ioctl(fd, DKIOCGEXTVTOC, &extvtoc) == -1) { - if (errno == ENOTSUP) - return (1); - else if (errno == ENOTTY) { - if (ioctl(fd, DKIOCGVTOC, &vtoc) == -1) - if (errno == ENOTSUP) - return (1); - } - } - return (0); -#else - return (ENOSYS); -#endif -} - void efi_err_check(struct dk_gpt *vtoc) { diff --git a/lib/libnvpair/libnvpair.c b/lib/libnvpair/libnvpair.c index fd43a44c1c0d..4e390272f9f2 100644 --- a/lib/libnvpair/libnvpair.c +++ b/lib/libnvpair/libnvpair.c @@ -253,11 +253,13 @@ NVLIST_ARRPRTFUNC(int64_array, int64_t, longlong_t, "%lld") NVLIST_ARRPRTFUNC(uint64_array, uint64_t, u_longlong_t, "0x%llx") NVLIST_ARRPRTFUNC(string_array, char *, char *, "%s") -/*ARGSUSED*/ static int nvprint_nvlist(nvlist_prtctl_t pctl, void *private, nvlist_t *nvl, const char *name, nvlist_t *value) { + (void) private; + (void) nvl; + FILE *fp = pctl->nvprt_fp; indent(pctl, 1); @@ -273,11 +275,13 @@ nvprint_nvlist(nvlist_prtctl_t pctl, void *private, return (1); } -/*ARGSUSED*/ static int nvaprint_nvlist_array(nvlist_prtctl_t pctl, void *private, nvlist_t *nvl, const char *name, nvlist_t **valuep, uint_t count) { + (void) private; + (void) nvl; + FILE *fp = pctl->nvprt_fp; uint_t i; diff --git a/lib/libnvpair/nvpair_alloc_system.c b/lib/libnvpair/nvpair_alloc_system.c index 54dde1ee644f..9771f58f67f3 100644 --- a/lib/libnvpair/nvpair_alloc_system.c +++ b/lib/libnvpair/nvpair_alloc_system.c @@ -36,10 +36,10 @@ nv_alloc_sys(nv_alloc_t *nva, size_t size) return (kmem_alloc(size, (int)(uintptr_t)nva->nva_arg)); } -/*ARGSUSED*/ static void nv_free_sys(nv_alloc_t *nva, void *buf, size_t size) { + (void) nva; kmem_free(buf, size); } diff --git a/lib/libshare/os/freebsd/nfs.c b/lib/libshare/os/freebsd/nfs.c index b82491f2ebe8..663ab1d6b7f4 100644 --- a/lib/libshare/os/freebsd/nfs.c +++ b/lib/libshare/os/freebsd/nfs.c @@ -233,6 +233,8 @@ nfs_enable_share(sa_share_impl_t impl_share) static int nfs_disable_share_impl(sa_share_impl_t impl_share, char *filename) { + (void) impl_share; + (void) filename; return (SA_OK); } @@ -281,6 +283,7 @@ nfs_is_shared(sa_share_impl_t impl_share) static int nfs_validate_shareopts(const char *shareopts) { + (void) shareopts; return (SA_OK); } diff --git a/lib/libshare/os/freebsd/smb.c b/lib/libshare/os/freebsd/smb.c index 5b606ab96955..e31306827e8f 100644 --- a/lib/libshare/os/freebsd/smb.c +++ b/lib/libshare/os/freebsd/smb.c @@ -47,6 +47,7 @@ static sa_fstype_t *smb_fstype; static int smb_enable_share(sa_share_impl_t impl_share) { + (void) impl_share; fprintf(stderr, "No SMB support in FreeBSD yet.\n"); return (SA_NOT_SUPPORTED); } @@ -56,6 +57,7 @@ smb_enable_share(sa_share_impl_t impl_share) static int smb_disable_share(sa_share_impl_t impl_share) { + (void) impl_share; fprintf(stderr, "No SMB support in FreeBSD yet.\n"); return (SA_NOT_SUPPORTED); } @@ -66,6 +68,7 @@ smb_disable_share(sa_share_impl_t impl_share) static int smb_validate_shareopts(const char *shareopts) { + (void) shareopts; fprintf(stderr, "No SMB support in FreeBSD yet.\n"); return (SA_NOT_SUPPORTED); } @@ -76,6 +79,7 @@ smb_validate_shareopts(const char *shareopts) static boolean_t smb_is_share_active(sa_share_impl_t impl_share) { + (void) impl_share; return (B_FALSE); } @@ -88,6 +92,8 @@ smb_is_share_active(sa_share_impl_t impl_share) static int smb_update_shareopts(sa_share_impl_t impl_share, const char *shareopts) { + (void) impl_share; + (void) shareopts; return (SA_OK); } diff --git a/lib/libshare/os/linux/nfs.c b/lib/libshare/os/linux/nfs.c index c236f25698f2..ab146227f6e6 100644 --- a/lib/libshare/os/linux/nfs.c +++ b/lib/libshare/os/linux/nfs.c @@ -497,6 +497,8 @@ nfs_enable_share(sa_share_impl_t impl_share) static int nfs_disable_share_impl(sa_share_impl_t impl_share, char *filename) { + (void) impl_share; + (void) filename; return (SA_OK); } diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h index 84dbccdc4a12..1cd821307960 100644 --- a/lib/libspl/include/assert.h +++ b/lib/libspl/include/assert.h @@ -38,7 +38,7 @@ extern int libspl_assert_ok; /* printf version of libspl_assert */ extern void libspl_assertf(const char *file, const char *func, int line, - const char *format, ...); + const char *format, ...) __attribute__((format(printf, 4, 5))); static inline int libspl_assert(const char *buf, const char *file, const char *func, int line) @@ -120,15 +120,15 @@ do { \ __compile_time_assertion__ ## y[(x) ? 1 : -1] #ifdef NDEBUG -#define ASSERT3B(x, y, z) ((void)0) -#define ASSERT3S(x, y, z) ((void)0) -#define ASSERT3U(x, y, z) ((void)0) -#define ASSERT3P(x, y, z) ((void)0) -#define ASSERT0(x) ((void)0) -#define ASSERT(x) ((void)0) -#define assert(x) ((void)0) -#define IMPLY(A, B) ((void)0) -#define EQUIV(A, B) ((void)0) +#define ASSERT3B(x, y, z) ((void)sizeof ((x) y(z))) +#define ASSERT3S(x, y, z) ((void)sizeof ((x) y(z))) +#define ASSERT3U(x, y, z) ((void)sizeof ((x) y(z))) +#define ASSERT3P(x, y, z) ((void)sizeof ((x) y(z))) +#define ASSERT0(x) ((void)sizeof (x)) +#define ASSERT(x) ((void)sizeof (x)) +#define assert(x) ((void)sizeof (x)) +#define IMPLY(A, B) ((void)sizeof (!(A) || (B))) +#define EQUIV(A, B) ((void)sizeof (!(A) || (B))) #else #define ASSERT3B VERIFY3B #define ASSERT3S VERIFY3S diff --git a/lib/libspl/include/sys/kmem.h b/lib/libspl/include/sys/kmem.h index 83d47565aeaf..eb5a0c699acf 100644 --- a/lib/libspl/include/sys/kmem.h +++ b/lib/libspl/include/sys/kmem.h @@ -35,8 +35,8 @@ extern "C" { #define KM_SLEEP 0x00000000 /* same as KM_SLEEP */ #define KM_NOSLEEP 0x00000001 /* same as KM_NOSLEEP */ -#define kmem_alloc(size, flags) malloc(size) -#define kmem_free(ptr, size) free(ptr) +#define kmem_alloc(size, flags) ((void)sizeof (flags), malloc(size)) +#define kmem_free(ptr, size) ((void)sizeof (size), free(ptr)) #ifdef __cplusplus } diff --git a/lib/libspl/os/linux/getmntany.c b/lib/libspl/os/linux/getmntany.c index d458b28ad309..3713ff38e17f 100644 --- a/lib/libspl/os/linux/getmntany.c +++ b/lib/libspl/os/linux/getmntany.c @@ -83,7 +83,7 @@ _sol_getmntent(FILE *fp, struct mnttab *mgetp) } static int -getextmntent_impl(FILE *fp, struct extmnttab *mp, int len) +getextmntent_impl(FILE *fp, struct extmnttab *mp) { int ret; struct stat64 st; @@ -137,7 +137,7 @@ getextmntent(const char *path, struct extmnttab *entry, struct stat64 *statbuf) */ match = 0; - while (getextmntent_impl(fp, entry, sizeof (*entry)) == 0) { + while (getextmntent_impl(fp, entry) == 0) { if (makedev(entry->mnt_major, entry->mnt_minor) == statbuf->st_dev) { match = 1; diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am index e3527ffe7058..2e627288ba56 100644 --- a/lib/libzfs/Makefile.am +++ b/lib/libzfs/Makefile.am @@ -5,8 +5,6 @@ VPATH = \ $(top_srcdir)/module/zcommon \ $(top_srcdir)/lib/libzfs -# Suppress unused but set variable warnings often due to ASSERTs -AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE) AM_CFLAGS += $(LIBCRYPTO_CFLAGS) $(ZLIB_CFLAGS) AM_CFLAGS += -fvisibility=hidden diff --git a/lib/libzfs/libzfs_changelist.c b/lib/libzfs/libzfs_changelist.c index 4d90a511f607..def3fb1d5ffb 100644 --- a/lib/libzfs/libzfs_changelist.c +++ b/lib/libzfs/libzfs_changelist.c @@ -592,10 +592,11 @@ compare_props(const void *a, const void *b, zfs_prop_t prop) return (strcmp(propb, propa)); } -/*ARGSUSED*/ static int compare_mountpoints(const void *a, const void *b, void *unused) { + (void) unused; + /* * When unsharing or unmounting filesystems, we need to do it in * mountpoint order. This allows the user to have a mountpoint @@ -605,10 +606,10 @@ compare_mountpoints(const void *a, const void *b, void *unused) return (compare_props(a, b, ZFS_PROP_MOUNTPOINT)); } -/*ARGSUSED*/ static int compare_dataset_names(const void *a, const void *b, void *unused) { + (void) unused; return (compare_props(a, b, ZFS_PROP_NAME)); } diff --git a/lib/libzfs/libzfs_config.c b/lib/libzfs/libzfs_config.c index a3ecc4a327dc..1bb55695f0bd 100644 --- a/lib/libzfs/libzfs_config.c +++ b/lib/libzfs/libzfs_config.c @@ -56,10 +56,11 @@ typedef struct config_node { uu_avl_node_t cn_avl; } config_node_t; -/* ARGSUSED */ static int config_node_compare(const void *a, const void *b, void *unused) { + (void) unused; + int ret; const config_node_t *ca = (config_node_t *)a; diff --git a/lib/libzfs/libzfs_crypto.c b/lib/libzfs/libzfs_crypto.c index c3cded24f6ba..efdf0cddf196 100644 --- a/lib/libzfs/libzfs_crypto.c +++ b/lib/libzfs/libzfs_crypto.c @@ -476,6 +476,9 @@ get_key_material_file(libzfs_handle_t *hdl, const char *uri, const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey, uint8_t **restrict buf, size_t *restrict len_out) { + (void) fsname; + (void) newkey; + FILE *f = NULL; int ret = 0; @@ -502,6 +505,9 @@ get_key_material_https(libzfs_handle_t *hdl, const char *uri, const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey, uint8_t **restrict buf, size_t *restrict len_out) { + (void) fsname; + (void) newkey; + int ret = 0; FILE *key = NULL; boolean_t is_http = strncmp(uri, "http:", strlen("http:")) == 0; @@ -769,6 +775,8 @@ derive_key(libzfs_handle_t *hdl, zfs_keyformat_t format, uint64_t iters, uint8_t *key_material, size_t key_material_len, uint64_t salt, uint8_t **key_out) { + (void) key_material_len; + int ret; uint8_t *key; @@ -1168,6 +1176,9 @@ int zfs_crypto_clone_check(libzfs_handle_t *hdl, zfs_handle_t *origin_zhp, char *parent_name, nvlist_t *props) { + (void) origin_zhp; + (void) parent_name; + char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 0e3198d9c856..77446daed4c5 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -3148,6 +3148,7 @@ userquota_propname_decode(const char *propname, boolean_t zoned, if (errno != 0 || *end != '\0') return (EINVAL); #else + (void) domainlen; return (ENOSYS); #endif /* HAVE_IDMAP */ } else { diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index b074a6e6f371..589fd2a738ae 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -247,9 +247,8 @@ zfs_is_mounted(zfs_handle_t *zhp, char **where) * mountpoint to the extent the caller wants. */ static boolean_t -zfs_is_mountable_internal(zfs_handle_t *zhp, const char *mountpoint) +zfs_is_mountable_internal(zfs_handle_t *zhp) { - if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && getzoneid() == GLOBAL_ZONEID) return (B_FALSE); @@ -282,7 +281,7 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen, if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) return (B_FALSE); - if (!zfs_is_mountable_internal(zhp, buf)) + if (!zfs_is_mountable_internal(zhp)) return (B_FALSE); if (zfs_prop_get_int(zhp, ZFS_PROP_REDACTED) && !(flags & MS_FORCE)) @@ -402,7 +401,7 @@ zfs_mount_at(zfs_handle_t *zhp, const char *options, int flags, remount = 1; /* Potentially duplicates some checks if invoked by zfs_mount(). */ - if (!zfs_is_mountable_internal(zhp, mountpoint)) + if (!zfs_is_mountable_internal(zhp)) return (0); /* diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 2ba673fd09f7..67486b5ada05 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -3075,7 +3075,7 @@ created_before(libzfs_handle_t *hdl, avl_tree_t *avl, */ static int recv_fix_encryption_hierarchy(libzfs_handle_t *hdl, const char *top_zfs, - nvlist_t *stream_nv, avl_tree_t *stream_avl) + nvlist_t *stream_nv) { int err; nvpair_t *fselem = NULL; @@ -3702,7 +3702,7 @@ zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname, if (raw && softerr == 0 && *top_zfs != NULL) { softerr = recv_fix_encryption_hierarchy(hdl, *top_zfs, - stream_nv, stream_avl); + stream_nv); } out: @@ -4935,8 +4935,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, * Check properties we were asked to override (both -o|-x) */ static boolean_t -zfs_receive_checkprops(libzfs_handle_t *hdl, nvlist_t *props, - const char *errbuf) +zfs_receive_checkprops(libzfs_handle_t *hdl, nvlist_t *props) { nvpair_t *nvp; zfs_prop_t prop; @@ -5000,7 +4999,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, "cannot receive")); /* check cmdline props, raise an error if they cannot be received */ - if (!zfs_receive_checkprops(hdl, cmdprops, errbuf)) { + if (!zfs_receive_checkprops(hdl, cmdprops)) { return (zfs_error(hdl, EZFS_BADPROP, errbuf)); } diff --git a/lib/libzfs/libzfs_status.c b/lib/libzfs/libzfs_status.c index 33d6e1bfdf80..b7713b2bfe09 100644 --- a/lib/libzfs/libzfs_status.c +++ b/lib/libzfs/libzfs_status.c @@ -96,48 +96,48 @@ static char *zfs_msgid_table[] = { #define NMSGID (sizeof (zfs_msgid_table) / sizeof (zfs_msgid_table[0])) -/* ARGSUSED */ static int vdev_missing(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_CANT_OPEN && vs->vs_aux == VDEV_AUX_OPEN_FAILED); } -/* ARGSUSED */ static int vdev_faulted(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_FAULTED); } -/* ARGSUSED */ static int vdev_errors(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_DEGRADED || vs->vs_read_errors != 0 || vs->vs_write_errors != 0 || vs->vs_checksum_errors != 0); } -/* ARGSUSED */ static int vdev_broken(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_CANT_OPEN); } -/* ARGSUSED */ static int vdev_offlined(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_OFFLINE); } -/* ARGSUSED */ static int vdev_removed(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_REMOVED); } diff --git a/lib/libzfs/os/freebsd/libzfs_compat.c b/lib/libzfs/os/freebsd/libzfs_compat.c index 4d7421df8d3b..f7d98c9116ba 100644 --- a/lib/libzfs/os/freebsd/libzfs_compat.c +++ b/lib/libzfs/os/freebsd/libzfs_compat.c @@ -42,6 +42,7 @@ void libzfs_set_pipe_max(int infd) { + (void) infd; /* FreeBSD automatically resizes */ } @@ -252,18 +253,25 @@ libzfs_load_module(void) int zpool_relabel_disk(libzfs_handle_t *hdl, const char *path, const char *msg) { + (void) hdl; + (void) path; + (void) msg; return (0); } int zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) { + (void) hdl; + (void) zhp; + (void) name; return (0); } int find_shares_object(differ_info_t *di) { + (void) di; return (0); } diff --git a/lib/libzfs/os/freebsd/libzfs_ioctl_compat.c b/lib/libzfs/os/freebsd/libzfs_ioctl_compat.c index 18b93fe27969..a7e36c9913da 100644 --- a/lib/libzfs/os/freebsd/libzfs_ioctl_compat.c +++ b/lib/libzfs/os/freebsd/libzfs_ioctl_compat.c @@ -44,7 +44,9 @@ void zfs_cmd_compat_get(zfs_cmd_t *zc, caddr_t addr, const int cflag) { - + (void) zc; + (void) addr; + (void) cflag; } #if 0 static int diff --git a/lib/libzfs/os/freebsd/libzfs_zmount.c b/lib/libzfs/os/freebsd/libzfs_zmount.c index e1febe6a2d91..b99e8b543641 100644 --- a/lib/libzfs/os/freebsd/libzfs_zmount.c +++ b/lib/libzfs/os/freebsd/libzfs_zmount.c @@ -77,6 +77,9 @@ static int do_mount_(const char *spec, const char *dir, int mflag, char *fstype, char *dataptr, int datalen, char *optptr, int optlen) { + (void) dataptr; + (void) datalen; + (void) optlen; struct iovec *iov; char *optstr, *p, *tofree; int iovlen, rv; diff --git a/lib/libzfs_core/libzfs_core.abi b/lib/libzfs_core/libzfs_core.abi index 574928cba089..51ea54b91bf8 100644 --- a/lib/libzfs_core/libzfs_core.abi +++ b/lib/libzfs_core/libzfs_core.abi @@ -158,7 +158,6 @@ - @@ -291,60 +290,60 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -354,234 +353,234 @@ - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - + + + - - + + - - - - - - - + + + + + + + - + - + - + - + - + + + + + + + + + - + - + - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -589,12 +588,12 @@ - + - + @@ -605,48 +604,48 @@ - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + @@ -656,105 +655,105 @@ - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -762,78 +761,78 @@ - + - + - + - + - - - - + + + + - + - - - - + + + + - - - + + + - - + + - - - - + + + + - + - + - + - + - + - + - - - + + + @@ -865,66 +864,66 @@ - + - + - + - - - - + + + + - + - - - - + + + + - + - - + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - + @@ -932,133 +931,133 @@ - - - - - + + + + + - - - - - - - - + + + + + + + + - + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - - - - + + + + + + + - + - + - + - + - + - + - - - - - - - + + + + + + + - + - + - + - + - + @@ -1073,55 +1072,55 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1129,58 +1128,58 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1258,79 +1257,79 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1346,53 +1345,53 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1400,116 +1399,116 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1517,187 +1516,187 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - - - - - + + + + + + + - + - - + + - - + + - - - - - - - + + + + + + + - - - - - + + + + + - - + + - - - - - - + + + + + + - - - + + + - + - - - - - - + + + + + + - + - - - - - - - - + + + + + + + + - - - - + + + + - + @@ -1709,377 +1708,390 @@ - + - - - - + + + + - + - - - - - + + + + + - + - - - - - + + + + + - - - + + + - - - + + + - - - - - - + + + + + + - + + + + + + + + - + - - - + + + - + - - - - + + + + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - - - + + + + + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - + - + - - + + - + - + - - + + - - - - - + + + + + - - + + - - - - - - + + + + + + - - - - + + + + - - + + + + + + + + + - - - + + + - - - - - - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + - + @@ -2089,202 +2101,202 @@ - + - + + - + - + - + - + - + - + - + - + - + - + - - - - - - - + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - + - - - - - - - - - + - + - + - + - + - - - - - - + + + + + + + + + + + + + + + + + + - + - + - + - + - - + + - + - - + + - + - + - - + + - + - + - + - + - + - + @@ -2293,79 +2305,79 @@ - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - + - + - + - + - - + + @@ -2373,12 +2385,12 @@ - - - + + + - + @@ -2386,71 +2398,71 @@ - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - + - + - + - + - + - + - + - + - + - + - + @@ -2458,21 +2470,21 @@ - + - - - + + + - + - + @@ -2480,167 +2492,167 @@ - - - - - - + + + + + + - - - - + + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + @@ -2658,432 +2670,432 @@ - + - + - - + + - - + + - + - + - + - + - - - + + + - - + + - - + + - + - + - - + + - - + + - - - + + + - - + + - + - + - + - - + + - + - + - + - + - + - + - + - + - - - + + + - + - + - - - - + + + + - + - + - + - + - + - + - + - + - - - - + + + + - + - - - - + + + + - - + + - + - + - - + + - - - - + + + + - - - - - + + + + + - - + + - - + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - + + + + + - - + + - - - + + + - - + + - - - + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -3096,70 +3108,70 @@ - - + + - + - + - + - - + + - + - + - + - + - - - - - + + + + + - + - + - + - + - - + + - + - + - + - + @@ -3167,103 +3179,103 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - + - + @@ -3273,80 +3285,80 @@ - + - + - - + + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + @@ -3354,726 +3366,726 @@ - - + + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - + + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -4088,378 +4100,378 @@ - + - - + + - + - + - + - + - + - - - - + + + + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - + + + + + + + - - - - + + + + - - + + - + - + - + - + - + - + - + - - - - + + + + - - + + - - - - + + + + - - - + + + - - - - + + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - + - - - + + + - - + + - - + + - - + + - - - - - + + + + + - - + + - + - + - - + + - - - - - + + + + + - - - - - + + + + + - - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -4467,19 +4479,19 @@ - - - + + + - - + + - + - + @@ -4487,75 +4499,71 @@ - - - - - - + + + + + + - + - - - + + + - - + + - - + + - - - + + + - + - + - + - + - - - - - + - - + + - - - + + + diff --git a/lib/libzfs_core/libzfs_core.c b/lib/libzfs_core/libzfs_core.c index ce33b2153062..5663a026ebf3 100644 --- a/lib/libzfs_core/libzfs_core.c +++ b/lib/libzfs_core/libzfs_core.c @@ -476,10 +476,10 @@ lzc_exists(const char *dataset) * It was added to preserve the function signature in case it is * needed in the future. */ -/*ARGSUSED*/ int lzc_sync(const char *pool_name, nvlist_t *innvl, nvlist_t **outnvl) { + (void) outnvl; return (lzc_ioctl(ZFS_IOC_POOL_SYNC, pool_name, innvl, NULL)); } @@ -1020,7 +1020,7 @@ lzc_receive_with_header(const char *snapname, nvlist_t *props, * The 'errflags' value will contain zprop_errflags_t flags which are * used to describe any failures. * - * The 'action_handle' and 'cleanup_fd' are no longer used, and are ignored. + * 'action_handle' and 'cleanup_fd' are no longer used, and are ignored. * * The 'errors' nvlist contains an entry for each unapplied received * property. Callers are responsible for freeing this nvlist. @@ -1032,6 +1032,9 @@ lzc_receive_one(const char *snapname, nvlist_t *props, uint64_t *read_bytes, uint64_t *errflags, uint64_t *action_handle, nvlist_t **errors) { + (void) cleanup_fd; + (void) action_handle; + return (recv_impl(snapname, props, NULL, NULL, 0, origin, force, resumable, raw, input_fd, begin_record, read_bytes, errflags, errors)); @@ -1053,6 +1056,9 @@ lzc_receive_with_cmdprops(const char *snapname, nvlist_t *props, uint64_t *read_bytes, uint64_t *errflags, uint64_t *action_handle, nvlist_t **errors) { + (void) cleanup_fd; + (void) action_handle; + return (recv_impl(snapname, props, cmdprops, wkeydata, wkeylen, origin, force, resumable, raw, input_fd, begin_record, read_bytes, errflags, errors)); diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am index c9a55591e5ca..db7c376318d5 100644 --- a/lib/libzpool/Makefile.am +++ b/lib/libzpool/Makefile.am @@ -17,9 +17,6 @@ endif # Unconditionally enable debugging for libzpool AM_CPPFLAGS += -DDEBUG -UNDEBUG -DZFS_DEBUG -# Suppress unused but set variable warnings often due to ASSERTs -AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE) - # Includes kernel code generate warnings for large stack frames AM_CFLAGS += $(FRAME_LARGER_THAN) diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c index feebb7eeb572..423bc24f77bf 100644 --- a/lib/libzpool/kernel.c +++ b/lib/libzpool/kernel.c @@ -74,7 +74,6 @@ struct proc p0; #define TS_STACK_MIN MAX(PTHREAD_STACK_MIN, 32768) #define TS_STACK_MAX (256 * 1024) -/*ARGSUSED*/ kthread_t * zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state) { @@ -117,7 +116,8 @@ zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state) VERIFY0(pthread_attr_setstacksize(&attr, stksize)); VERIFY0(pthread_attr_setguardsize(&attr, PAGESIZE)); - VERIFY0(pthread_create(&tid, &attr, (void *(*)(void *))func, arg)); + VERIFY0(pthread_create( + &tid, &attr, (void *(*)(void *))(void *)func, arg)); VERIFY0(pthread_attr_destroy(&attr)); return ((void *)(uintptr_t)tid); @@ -128,60 +128,79 @@ zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state) * kstats * ========================================================================= */ -/*ARGSUSED*/ kstat_t * kstat_create(const char *module, int instance, const char *name, const char *class, uchar_t type, ulong_t ndata, uchar_t ks_flag) { + (void) module; + (void) instance; + (void) name; + (void) class; + (void) type; + (void) ndata; + (void) ks_flag; return (NULL); } -/*ARGSUSED*/ void kstat_install(kstat_t *ksp) -{} +{ + (void) ksp; +} -/*ARGSUSED*/ void kstat_delete(kstat_t *ksp) -{} +{ + (void) ksp; +} -/*ARGSUSED*/ void kstat_waitq_enter(kstat_io_t *kiop) -{} +{ + (void) kiop; +} -/*ARGSUSED*/ void kstat_waitq_exit(kstat_io_t *kiop) -{} +{ + (void) kiop; +} -/*ARGSUSED*/ void kstat_runq_enter(kstat_io_t *kiop) -{} +{ + (void) kiop; +} -/*ARGSUSED*/ void kstat_runq_exit(kstat_io_t *kiop) -{} +{ + (void) kiop; +} -/*ARGSUSED*/ void kstat_waitq_to_runq(kstat_io_t *kiop) -{} +{ + (void) kiop; +} -/*ARGSUSED*/ void kstat_runq_back_to_waitq(kstat_io_t *kiop) -{} +{ + (void) kiop; +} void kstat_set_raw_ops(kstat_t *ksp, int (*headers)(char *buf, size_t size), int (*data)(char *buf, size_t size, void *data), void *(*addr)(kstat_t *ksp, loff_t index)) -{} +{ + (void) ksp; + (void) headers; + (void) data; + (void) addr; +} /* * ========================================================================= @@ -192,6 +211,10 @@ kstat_set_raw_ops(kstat_t *ksp, void mutex_init(kmutex_t *mp, char *name, int type, void *cookie) { + (void) name; + (void) type; + (void) cookie; + VERIFY0(pthread_mutex_init(&mp->m_lock, NULL)); memset(&mp->m_owner, 0, sizeof (pthread_t)); } @@ -240,6 +263,10 @@ mutex_exit(kmutex_t *mp) void rw_init(krwlock_t *rwlp, char *name, int type, void *arg) { + (void) name; + (void) type; + (void) arg; + VERIFY0(pthread_rwlock_init(&rwlp->rw_lock, NULL)); rwlp->rw_readers = 0; rwlp->rw_owner = 0; @@ -298,19 +325,19 @@ rw_tryenter(krwlock_t *rwlp, krw_t rw) return (0); } -/* ARGSUSED */ uint32_t zone_get_hostid(void *zonep) { - /* - * We're emulating the system's hostid in userland. - */ + (void) zonep; + + /* We're emulating the system's hostid in userland. */ return (strtoul(hw_serial, NULL, 10)); } int rw_tryupgrade(krwlock_t *rwlp) { + (void) rwlp; return (0); } @@ -323,6 +350,10 @@ rw_tryupgrade(krwlock_t *rwlp) void cv_init(kcondvar_t *cv, char *name, int type, void *arg) { + (void) name; + (void) type; + (void) arg; + VERIFY0(pthread_cond_init(cv, NULL)); } @@ -380,11 +411,12 @@ cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime) return (1); } -/*ARGSUSED*/ int cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res, int flag) { + (void) res; + int error; struct timeval tv; struct timespec ts; @@ -440,7 +472,10 @@ cv_broadcast(kcondvar_t *cv) void seq_printf(struct seq_file *m, const char *fmt, ...) -{} +{ + (void) m; + (void) fmt; +} void procfs_list_install(const char *module, @@ -453,6 +488,14 @@ procfs_list_install(const char *module, int (*clear)(procfs_list_t *procfs_list), size_t procfs_list_node_off) { + (void) module; + (void) submodule; + (void) name; + (void) mode; + (void) show; + (void) show_header; + (void) clear; + mutex_init(&procfs_list->pl_lock, NULL, MUTEX_DEFAULT, NULL); list_create(&procfs_list->pl_list, procfs_list_node_off + sizeof (procfs_list_node_t), @@ -463,7 +506,9 @@ procfs_list_install(const char *module, void procfs_list_uninstall(procfs_list_t *procfs_list) -{} +{ + (void) procfs_list; +} void procfs_list_destroy(procfs_list_t *procfs_list) @@ -776,6 +821,8 @@ random_get_pseudo_bytes(uint8_t *ptr, size_t len) int ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result) { + (void) nptr; + char *end; *result = strtoul(hw_serial, &end, base); @@ -787,6 +834,8 @@ ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result) int ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result) { + (void) nptr; + char *end; *result = strtoull(str, &end, base); @@ -825,7 +874,7 @@ kernel_init(int mode) physmem = sysconf(_SC_PHYS_PAGES); - dprintf("physmem = %llu pages (%.2f GB)\n", physmem, + dprintf("physmem = %"PRIu64" pages (%.2f GB)\n", physmem, (double)physmem * sysconf(_SC_PAGE_SIZE) / (1ULL << 30)); (void) snprintf(hw_serial, sizeof (hw_serial), "%ld", @@ -864,60 +913,75 @@ kernel_fini(void) uid_t crgetuid(cred_t *cr) { + (void) cr; return (0); } uid_t crgetruid(cred_t *cr) { + (void) cr; return (0); } gid_t crgetgid(cred_t *cr) { + (void) cr; return (0); } int crgetngroups(cred_t *cr) { + (void) cr; return (0); } gid_t * crgetgroups(cred_t *cr) { + (void) cr; return (NULL); } int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr) { + (void) name; + (void) cr; return (0); } int zfs_secpolicy_rename_perms(const char *from, const char *to, cred_t *cr) { + (void) from; + (void) to; + (void) cr; return (0); } int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr) { + (void) name; + (void) cr; return (0); } int secpolicy_zfs(const cred_t *cr) { + (void) cr; return (0); } int secpolicy_zfs_proc(const cred_t *cr, proc_t *proc) { + (void) cr; + (void) proc; return (0); } @@ -964,25 +1028,29 @@ kmem_asprintf(const char *fmt, ...) return (buf); } -/* ARGSUSED */ int zfs_onexit_fd_hold(int fd, minor_t *minorp) { + (void) fd; *minorp = 0; return (0); } -/* ARGSUSED */ void zfs_onexit_fd_rele(int fd) { + (void) fd; + } -/* ARGSUSED */ int zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data, uint64_t *action_handle) { + (void) minor; + (void) func; + (void) data; + (void) action_handle; return (0); } @@ -995,6 +1063,8 @@ spl_fstrans_mark(void) void spl_fstrans_unmark(fstrans_cookie_t cookie) { + (void) cookie; + } int @@ -1014,22 +1084,33 @@ void *zvol_tag = "zvol_tag"; void zvol_create_minor(const char *name) { + (void) name; + } void zvol_create_minors_recursive(const char *name) { + (void) name; } void zvol_remove_minors(spa_t *spa, const char *name, boolean_t async) { + (void) spa; + (void) name; + (void) async; } void zvol_rename_minors(spa_t *spa, const char *oldname, const char *newname, boolean_t async) { + (void) spa; + (void) oldname; + (void) newname; + (void) async; + } /* @@ -1323,6 +1404,8 @@ zfs_file_getattr(zfs_file_t *fp, zfs_file_attr_t *zfattr) int zfs_file_fsync(zfs_file_t *fp, int flags) { + (void) flags; + int rc; rc = fsync(fp->f_fd); @@ -1348,6 +1431,10 @@ zfs_file_fallocate(zfs_file_t *fp, int mode, loff_t offset, loff_t len) #ifdef __linux__ return (fallocate(fp->f_fd, mode, offset, len)); #else + (void) fp; + (void) mode; + (void) offset; + (void) len; return (EOPNOTSUPP); #endif } @@ -1392,9 +1479,9 @@ zfs_file_unlink(const char *path) int zfs_file_get(int fd, zfs_file_t **fpp) { + (void) fd; + (void) fpp; abort(); - - return (EOPNOTSUPP); } /* @@ -1407,10 +1494,14 @@ zfs_file_get(int fd, zfs_file_t **fpp) void zfs_file_put(int fd) { + (void) fd; abort(); } void zfsvfs_update_fromname(const char *oldname, const char *newname) { + (void) oldname; + (void) newname; + } diff --git a/lib/libzpool/taskq.c b/lib/libzpool/taskq.c index 456080f7f247..1a7605879052 100644 --- a/lib/libzpool/taskq.c +++ b/lib/libzpool/taskq.c @@ -134,9 +134,14 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags) } taskqid_t -taskq_dispatch_delay(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags, +taskq_dispatch_delay(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags, clock_t expire_time) { + (void) tq; + (void) func; + (void) arg; + (void) tqflags; + (void) expire_time; return (0); } @@ -199,12 +204,14 @@ taskq_wait(taskq_t *tq) void taskq_wait_id(taskq_t *tq, taskqid_t id) { + (void) id; taskq_wait(tq); } void taskq_wait_outstanding(taskq_t *tq, taskqid_t id) { + (void) id; taskq_wait(tq); } @@ -247,7 +254,6 @@ taskq_thread(void *arg) thread_exit(); } -/*ARGSUSED*/ taskq_t * taskq_create(const char *name, int nthreads, pri_t pri, int minalloc, int maxalloc, uint_t flags) @@ -291,9 +297,10 @@ taskq_create(const char *name, int nthreads, pri_t pri, mutex_exit(&tq->tq_lock); } - for (t = 0; t < nthreads; t++) + for (t = 0; t < nthreads; t++) { VERIFY((tq->tq_threadlist[t] = thread_create(NULL, 0, taskq_thread, tq, 0, &p0, TS_RUN, pri)) != NULL); + } return (tq); } @@ -356,6 +363,8 @@ taskq_of_curthread(void) int taskq_cancel_id(taskq_t *tq, taskqid_t id) { + (void) tq; + (void) id; return (ENOENT); } diff --git a/lib/libzpool/util.c b/lib/libzpool/util.c index 20cabe7c2e29..294cdcec935f 100644 --- a/lib/libzpool/util.c +++ b/lib/libzpool/util.c @@ -242,6 +242,7 @@ set_global_var(char const *arg) static nvlist_t * refresh_config(void *unused, nvlist_t *tryconfig) { + (void) unused; return (spa_tryimport(tryconfig)); } @@ -249,6 +250,9 @@ static int pool_active(void *unused, const char *name, uint64_t guid, boolean_t *isactive) { + (void) unused; + (void) guid; + zfs_cmd_t *zcp; nvlist_t *innvl; char *packed = NULL; diff --git a/lib/libzstd/Makefile.am b/lib/libzstd/Makefile.am index c9ed7e2aafbc..615af8fbc133 100644 --- a/lib/libzstd/Makefile.am +++ b/lib/libzstd/Makefile.am @@ -5,6 +5,9 @@ VPATH = $(top_srcdir)/module/zstd # -fno-tree-vectorize is set for gcc in zstd/common/compiler.h # Set it for other compilers, too. AM_CFLAGS += -fno-tree-vectorize +if !WITH_DEBUG +AM_CFLAGS = -D"assert(x)=((void)sizeof (x))" +endif noinst_LTLIBRARIES = libzstd.la diff --git a/lib/libzutil/Makefile.am b/lib/libzutil/Makefile.am index 2f0357e9f900..6351e0ebf64b 100644 --- a/lib/libzutil/Makefile.am +++ b/lib/libzutil/Makefile.am @@ -1,7 +1,5 @@ include $(top_srcdir)/config/Rules.am -# Suppress unused but set variable warnings often due to ASSERTs -AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE) AM_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUDEV_CFLAGS) DEFAULT_INCLUDES += -I$(srcdir) diff --git a/lib/libzutil/os/freebsd/zutil_device_path_os.c b/lib/libzutil/os/freebsd/zutil_device_path_os.c index 71c936005242..ac4748ec7ac8 100644 --- a/lib/libzutil/os/freebsd/zutil_device_path_os.c +++ b/lib/libzutil/os/freebsd/zutil_device_path_os.c @@ -124,9 +124,9 @@ zpool_label_disk_wait(const char *path, int timeout_ms) return (ENODEV); } -/* ARGSUSED */ boolean_t is_mpath_whole_disk(const char *path) { + (void) path; return (B_FALSE); } diff --git a/lib/libzutil/os/linux/zutil_device_path_os.c b/lib/libzutil/os/linux/zutil_device_path_os.c index 2a6f4ae2a222..d6bd5fa9e9c4 100644 --- a/lib/libzutil/os/linux/zutil_device_path_os.c +++ b/lib/libzutil/os/linux/zutil_device_path_os.c @@ -528,10 +528,10 @@ is_mpath_whole_disk(const char *path) #else /* HAVE_LIBUDEV */ -/* ARGSUSED */ boolean_t is_mpath_whole_disk(const char *path) { + (void) path; return (B_FALSE); } diff --git a/lib/libzutil/os/linux/zutil_import_os.c b/lib/libzutil/os/linux/zutil_import_os.c index 84c3cb44fec7..29ad64dd509d 100644 --- a/lib/libzutil/os/linux/zutil_import_os.c +++ b/lib/libzutil/os/linux/zutil_import_os.c @@ -577,17 +577,21 @@ udev_device_is_ready(struct udev_device *dev) #else -/* ARGSUSED */ int zfs_device_get_devid(struct udev_device *dev, char *bufptr, size_t buflen) { + (void) dev; + (void) bufptr; + (void) buflen; return (ENODATA); } -/* ARGSUSED */ int zfs_device_get_physical(struct udev_device *dev, char *bufptr, size_t buflen) { + (void) dev; + (void) bufptr; + (void) buflen; return (ENODATA); } diff --git a/lib/libzutil/zutil_import.c b/lib/libzutil/zutil_import.c index 3e4dd34da80a..5e6b1524b646 100644 --- a/lib/libzutil/zutil_import.c +++ b/lib/libzutil/zutil_import.c @@ -1368,6 +1368,8 @@ static nvlist_t * zpool_find_import_impl(libpc_handle_t *hdl, importargs_t *iarg, pthread_mutex_t *lock, avl_tree_t *cache) { + (void) lock; + nvlist_t *ret = NULL; pool_list_t pools = { 0 }; pool_entry_t *pe, *penext; diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index f4045fd3e035..7c61333fb62a 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -1527,18 +1527,6 @@ The maximum size in bytes of the internal ZFS debug log. Default value: \fB4M\fR. .RE -.sp -.ne 2 -.na -\fBzfs_dbuf_state_index\fR (int) -.ad -.RS 12n -This feature is currently unused. It is normally used for controlling what -reporting is available under /proc/spl/kstat/zfs. -.sp -Default value: \fB0\fR. -.RE - .sp .ne 2 .na diff --git a/module/avl/avl.c b/module/avl/avl.c index 1a95092bc2b6..a96a0d339927 100644 --- a/module/avl/avl.c +++ b/module/avl/avl.c @@ -910,7 +910,6 @@ avl_create(avl_tree_t *tree, int (*compar) (const void *, const void *), /* * Delete a tree. */ -/* ARGSUSED */ void avl_destroy(avl_tree_t *tree) { diff --git a/module/icp/algs/aes/aes_impl.c b/module/icp/algs/aes/aes_impl.c index 037be0db60d7..a5b88b8aab25 100644 --- a/module/icp/algs/aes/aes_impl.c +++ b/module/icp/algs/aes/aes_impl.c @@ -206,7 +206,6 @@ aes_decrypt_block(const void *ks, const uint8_t *ct, uint8_t *pt) * size Size of key schedule allocated, in bytes * kmflag Flag passed to kmem_alloc(9F); ignored in userland. */ -/* ARGSUSED */ void * aes_alloc_keysched(size_t *size, int kmflag) { diff --git a/module/icp/algs/modes/cbc.c b/module/icp/algs/modes/cbc.c index 85864f56dead..bddb5b64ddd3 100644 --- a/module/icp/algs/modes/cbc.c +++ b/module/icp/algs/modes/cbc.c @@ -137,7 +137,6 @@ cbc_encrypt_contiguous_blocks(cbc_ctx_t *ctx, char *data, size_t length, #define OTHER(a, ctx) \ (((a) == (ctx)->cbc_lastblock) ? (ctx)->cbc_iv : (ctx)->cbc_lastblock) -/* ARGSUSED */ int cbc_decrypt_contiguous_blocks(cbc_ctx_t *ctx, char *data, size_t length, crypto_data_t *out, size_t block_size, @@ -259,7 +258,6 @@ cbc_init_ctx(cbc_ctx_t *cbc_ctx, char *param, size_t param_len, return (CRYPTO_SUCCESS); } -/* ARGSUSED */ void * cbc_alloc_ctx(int kmflag) { diff --git a/module/icp/algs/modes/ccm.c b/module/icp/algs/modes/ccm.c index 5d6507c49db1..99a78e79d6be 100644 --- a/module/icp/algs/modes/ccm.c +++ b/module/icp/algs/modes/ccm.c @@ -190,7 +190,6 @@ calculate_ccm_mac(ccm_ctx_t *ctx, uint8_t *ccm_mac, } } -/* ARGSUSED */ int ccm_encrypt_final(ccm_ctx_t *ctx, crypto_data_t *out, size_t block_size, int (*encrypt_block)(const void *, const uint8_t *, uint8_t *), @@ -342,7 +341,6 @@ ccm_decrypt_incomplete_block(ccm_ctx_t *ctx, * returned to the caller. It will be returned when decrypt_final() is * called if the MAC matches */ -/* ARGSUSED */ int ccm_mode_decrypt_contiguous_blocks(ccm_ctx_t *ctx, char *data, size_t length, crypto_data_t *out, size_t block_size, @@ -350,6 +348,8 @@ ccm_mode_decrypt_contiguous_blocks(ccm_ctx_t *ctx, char *data, size_t length, void (*copy_block)(uint8_t *, uint8_t *), void (*xor_block)(uint8_t *, uint8_t *)) { + (void) out; + size_t remainder = length; size_t need = 0; uint8_t *datap = (uint8_t *)data; diff --git a/module/icp/algs/modes/ctr.c b/module/icp/algs/modes/ctr.c index 0188bdd395ff..82295cda877e 100644 --- a/module/icp/algs/modes/ctr.c +++ b/module/icp/algs/modes/ctr.c @@ -214,7 +214,6 @@ ctr_init_ctx(ctr_ctx_t *ctr_ctx, ulong_t count, uint8_t *cb, return (CRYPTO_SUCCESS); } -/* ARGSUSED */ void * ctr_alloc_ctx(int kmflag) { diff --git a/module/icp/algs/modes/ecb.c b/module/icp/algs/modes/ecb.c index 025f5825cf04..ffbdb9d57d0a 100644 --- a/module/icp/algs/modes/ecb.c +++ b/module/icp/algs/modes/ecb.c @@ -114,7 +114,6 @@ ecb_cipher_contiguous_blocks(ecb_ctx_t *ctx, char *data, size_t length, return (CRYPTO_SUCCESS); } -/* ARGSUSED */ void * ecb_alloc_ctx(int kmflag) { diff --git a/module/icp/algs/modes/gcm.c b/module/icp/algs/modes/gcm.c index 7332834cbe37..c6a69eaf8a28 100644 --- a/module/icp/algs/modes/gcm.c +++ b/module/icp/algs/modes/gcm.c @@ -199,13 +199,14 @@ gcm_mode_encrypt_contiguous_blocks(gcm_ctx_t *ctx, char *data, size_t length, return (CRYPTO_SUCCESS); } -/* ARGSUSED */ int gcm_encrypt_final(gcm_ctx_t *ctx, crypto_data_t *out, size_t block_size, int (*encrypt_block)(const void *, const uint8_t *, uint8_t *), void (*copy_block)(uint8_t *, uint8_t *), void (*xor_block)(uint8_t *, uint8_t *)) { + (void) copy_block; + #ifdef CAN_USE_GCM_ASM if (ctx->gcm_use_avx == B_TRUE) return (gcm_encrypt_final_avx(ctx, out, block_size)); @@ -324,7 +325,6 @@ gcm_decrypt_incomplete_block(gcm_ctx_t *ctx, size_t block_size, size_t index, } } -/* ARGSUSED */ int gcm_mode_decrypt_contiguous_blocks(gcm_ctx_t *ctx, char *data, size_t length, crypto_data_t *out, size_t block_size, @@ -332,6 +332,12 @@ gcm_mode_decrypt_contiguous_blocks(gcm_ctx_t *ctx, char *data, size_t length, void (*copy_block)(uint8_t *, uint8_t *), void (*xor_block)(uint8_t *, uint8_t *)) { + (void) out; + (void) block_size; + (void) encrypt_block; + (void) copy_block; + (void) xor_block; + size_t new_len; uint8_t *new; diff --git a/module/icp/asm-x86_64/aes/aes_aesni.S b/module/icp/asm-x86_64/aes/aes_aesni.S index 4a80c62097ae..7990f0e320af 100644 --- a/module/icp/asm-x86_64/aes/aes_aesni.S +++ b/module/icp/asm-x86_64/aes/aes_aesni.S @@ -154,26 +154,36 @@ #include -/* ARGSUSED */ void aes_encrypt_intel(const uint32_t rk[], int Nr, const uint32_t pt[4], uint32_t ct[4]) { + (void) rk; + (void) Nr; + (void) pt; + (void) ct; } -/* ARGSUSED */ void aes_decrypt_intel(const uint32_t rk[], int Nr, const uint32_t ct[4], uint32_t pt[4]) { + (void) rk; + (void) Nr; + (void) ct; + (void) pt; } -/* ARGSUSED */ int rijndael_key_setup_enc_intel(uint32_t rk[], const uint32_t cipherKey[], uint64_t keyBits) { + (void) rk; + (void) cipherKey; + (void) keyBits; return (0); } -/* ARGSUSED */ int rijndael_key_setup_dec_intel(uint32_t rk[], const uint32_t cipherKey[], uint64_t keyBits) { + (void) rk; + (void) cipherKey; + (void) keyBits; return (0); } diff --git a/module/icp/asm-x86_64/aes/aes_amd64.S b/module/icp/asm-x86_64/aes/aes_amd64.S index 9db3a3179230..0fee824ad8ef 100644 --- a/module/icp/asm-x86_64/aes/aes_amd64.S +++ b/module/icp/asm-x86_64/aes/aes_amd64.S @@ -186,15 +186,23 @@ #if defined(lint) || defined(__lint) #include -/* ARGSUSED */ + void aes_encrypt_amd64(const uint32_t rk[], int Nr, const uint32_t pt[4], uint32_t ct[4]) { + (void) rk; + (void) Nr; + (void) pt; + (void) ct; } -/* ARGSUSED */ + void aes_decrypt_amd64(const uint32_t rk[], int Nr, const uint32_t ct[4], uint32_t pt[4]) { + (void) rk; + (void) Nr; + (void) ct; + (void) pt; } diff --git a/module/icp/asm-x86_64/modes/gcm_pclmulqdq.S b/module/icp/asm-x86_64/modes/gcm_pclmulqdq.S index 59edc4c8d56c..7d0ec50ffbd5 100644 --- a/module/icp/asm-x86_64/modes/gcm_pclmulqdq.S +++ b/module/icp/asm-x86_64/modes/gcm_pclmulqdq.S @@ -85,9 +85,11 @@ #include -/* ARGSUSED */ void gcm_mul_pclmulqdq(uint64_t *x_in, uint64_t *y, uint64_t *res) { + (void) x_in; + (void) y; + (void) res; } #elif defined(HAVE_PCLMULQDQ) /* guard by instruction set */ diff --git a/module/icp/asm-x86_64/sha1/sha1-x86_64.S b/module/icp/asm-x86_64/sha1/sha1-x86_64.S index fc844cd8c74f..2034b10a638d 100644 --- a/module/icp/asm-x86_64/sha1/sha1-x86_64.S +++ b/module/icp/asm-x86_64/sha1/sha1-x86_64.S @@ -59,10 +59,12 @@ #include -/* ARGSUSED */ void sha1_block_data_order(SHA1_CTX *ctx, const void *inpp, size_t blocks) { + (void) ctx; + (void) inpp; + (void) blocks; } #else diff --git a/module/icp/asm-x86_64/sha2/sha256_impl.S b/module/icp/asm-x86_64/sha2/sha256_impl.S index 28b048d2db24..ab7f88f509c4 100644 --- a/module/icp/asm-x86_64/sha2/sha256_impl.S +++ b/module/icp/asm-x86_64/sha2/sha256_impl.S @@ -71,10 +71,12 @@ #include #include -/* ARGSUSED */ void SHA256TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num) { + (void) ctx; + (void) in; + (void) num; } diff --git a/module/icp/asm-x86_64/sha2/sha512_impl.S b/module/icp/asm-x86_64/sha2/sha512_impl.S index 746c85a98566..70144d3013fd 100644 --- a/module/icp/asm-x86_64/sha2/sha512_impl.S +++ b/module/icp/asm-x86_64/sha2/sha512_impl.S @@ -72,10 +72,12 @@ #include #include -/* ARGSUSED */ void SHA512TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num) { + (void) ctx; + (void) in; + (void) num; } diff --git a/module/icp/core/kcf_mech_tabs.c b/module/icp/core/kcf_mech_tabs.c index 2642b317d698..209646db4370 100644 --- a/module/icp/core/kcf_mech_tabs.c +++ b/module/icp/core/kcf_mech_tabs.c @@ -786,6 +786,7 @@ kcf_get_mech_entry(crypto_mech_type_t mech_type, kcf_mech_entry_t **mep) crypto_mech_type_t crypto_mech2id_common(char *mechname, boolean_t load_module) { + (void) load_module; crypto_mech_type_t mt = kcf_mech_hash_find(mechname); return (mt); } diff --git a/module/icp/core/kcf_prov_lib.c b/module/icp/core/kcf_prov_lib.c index 1b115d976232..36b00dd23ae4 100644 --- a/module/icp/core/kcf_prov_lib.c +++ b/module/icp/core/kcf_prov_lib.c @@ -40,6 +40,9 @@ int crypto_uio_data(crypto_data_t *data, uchar_t *buf, int len, cmd_type_t cmd, void *digest_ctx, void (*update)(void)) { + (void) digest_ctx; + (void) update; + zfs_uio_t *uiop = data->cd_uio; off_t offset = data->cd_offset; size_t length = len; diff --git a/module/icp/core/kcf_prov_tabs.c b/module/icp/core/kcf_prov_tabs.c index 139b6920e1ec..19e62a144163 100644 --- a/module/icp/core/kcf_prov_tabs.c +++ b/module/icp/core/kcf_prov_tabs.c @@ -147,7 +147,6 @@ kcf_prov_tab_rem_provider(crypto_provider_id_t prov_id) kcf_provider_desc_t *prov_desc; ASSERT(prov_tab != NULL); - ASSERT(prov_tab_num >= 0); /* * Validate provider id, since it can be specified by a 3rd-party diff --git a/module/icp/core/kcf_sched.c b/module/icp/core/kcf_sched.c index 81fd15f8ea26..b4705539a211 100644 --- a/module/icp/core/kcf_sched.c +++ b/module/icp/core/kcf_sched.c @@ -970,10 +970,12 @@ kcf_enqueue(kcf_areq_node_t *node) /* * kmem_cache_alloc constructor for sync request structure. */ -/* ARGSUSED */ static int kcf_sreq_cache_constructor(void *buf, void *cdrarg, int kmflags) { + (void) cdrarg; + (void) kmflags; + kcf_sreq_node_t *sreq = (kcf_sreq_node_t *)buf; sreq->sn_type = CRYPTO_SYNCH; @@ -983,10 +985,11 @@ kcf_sreq_cache_constructor(void *buf, void *cdrarg, int kmflags) return (0); } -/* ARGSUSED */ static void kcf_sreq_cache_destructor(void *buf, void *cdrarg) { + (void) cdrarg; + kcf_sreq_node_t *sreq = (kcf_sreq_node_t *)buf; mutex_destroy(&sreq->sn_lock); @@ -996,10 +999,12 @@ kcf_sreq_cache_destructor(void *buf, void *cdrarg) /* * kmem_cache_alloc constructor for async request structure. */ -/* ARGSUSED */ static int kcf_areq_cache_constructor(void *buf, void *cdrarg, int kmflags) { + (void) cdrarg; + (void) kmflags; + kcf_areq_node_t *areq = (kcf_areq_node_t *)buf; areq->an_type = CRYPTO_ASYNCH; @@ -1011,10 +1016,11 @@ kcf_areq_cache_constructor(void *buf, void *cdrarg, int kmflags) return (0); } -/* ARGSUSED */ static void kcf_areq_cache_destructor(void *buf, void *cdrarg) { + (void) cdrarg; + kcf_areq_node_t *areq = (kcf_areq_node_t *)buf; ASSERT(areq->an_refcnt == 0); @@ -1026,10 +1032,12 @@ kcf_areq_cache_destructor(void *buf, void *cdrarg) /* * kmem_cache_alloc constructor for kcf_context structure. */ -/* ARGSUSED */ static int kcf_context_cache_constructor(void *buf, void *cdrarg, int kmflags) { + (void) cdrarg; + (void) kmflags; + kcf_context_t *kctx = (kcf_context_t *)buf; kctx->kc_refcnt = 0; @@ -1038,10 +1046,11 @@ kcf_context_cache_constructor(void *buf, void *cdrarg, int kmflags) return (0); } -/* ARGSUSED */ static void kcf_context_cache_destructor(void *buf, void *cdrarg) { + (void) cdrarg; + kcf_context_t *kctx = (kcf_context_t *)buf; ASSERT(kctx->kc_refcnt == 0); diff --git a/module/icp/io/aes.c b/module/icp/io/aes.c index f77583360235..801b33d9b5f7 100644 --- a/module/icp/io/aes.c +++ b/module/icp/io/aes.c @@ -311,10 +311,10 @@ init_keysched(crypto_key_t *key, void *newbie) /* * KCF software provider control entry points. */ -/* ARGSUSED */ static void aes_provider_status(crypto_provider_handle_t provider, uint_t *status) { + (void) provider; *status = CRYPTO_PROVIDER_READY; } @@ -617,11 +617,12 @@ aes_decrypt(crypto_ctx_t *ctx, crypto_data_t *ciphertext, } -/* ARGSUSED */ static int aes_encrypt_update(crypto_ctx_t *ctx, crypto_data_t *plaintext, crypto_data_t *ciphertext, crypto_req_handle_t req) { + (void) req; + off_t saved_offset; size_t saved_length, out_len; int ret = CRYPTO_SUCCESS; @@ -769,11 +770,12 @@ aes_decrypt_update(crypto_ctx_t *ctx, crypto_data_t *ciphertext, return (ret); } -/* ARGSUSED */ static int aes_encrypt_final(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) { + (void) req; + aes_ctx_t *aes_ctx; int ret; @@ -826,11 +828,12 @@ aes_encrypt_final(crypto_ctx_t *ctx, crypto_data_t *data, return (CRYPTO_SUCCESS); } -/* ARGSUSED */ static int aes_decrypt_final(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) { + (void) req; + aes_ctx_t *aes_ctx; int ret; off_t saved_offset; @@ -929,13 +932,15 @@ aes_decrypt_final(crypto_ctx_t *ctx, crypto_data_t *data, return (CRYPTO_SUCCESS); } -/* ARGSUSED */ static int aes_encrypt_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_data_t *plaintext, crypto_data_t *ciphertext, crypto_spi_ctx_template_t template, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + aes_ctx_t aes_ctx; /* on the stack */ off_t saved_offset; size_t saved_length; @@ -1065,13 +1070,15 @@ aes_encrypt_atomic(crypto_provider_handle_t provider, return (ret); } -/* ARGSUSED */ static int aes_decrypt_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_data_t *ciphertext, crypto_data_t *plaintext, crypto_spi_ctx_template_t template, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + aes_ctx_t aes_ctx; /* on the stack */ off_t saved_offset; size_t saved_length; @@ -1235,12 +1242,13 @@ aes_decrypt_atomic(crypto_provider_handle_t provider, /* * KCF software provider context template entry points. */ -/* ARGSUSED */ static int aes_create_ctx_template(crypto_provider_handle_t provider, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_spi_ctx_template_t *tmpl, size_t *tmpl_size, crypto_req_handle_t req) { + (void) provider; + void *keysched; size_t size; int rv; diff --git a/module/icp/io/sha1_mod.c b/module/icp/io/sha1_mod.c index 6dcee6b2ecf2..b08eed675a8c 100644 --- a/module/icp/io/sha1_mod.c +++ b/module/icp/io/sha1_mod.c @@ -227,17 +227,16 @@ sha1_mod_fini(void) /* * KCF software provider control entry points. */ -/* ARGSUSED */ static void sha1_provider_status(crypto_provider_handle_t provider, uint_t *status) { + (void) provider; *status = CRYPTO_PROVIDER_READY; } /* * KCF software provider digest entry points. */ - static int sha1_digest_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, crypto_req_handle_t req) @@ -409,11 +408,12 @@ sha1_digest_final_uio(SHA1_CTX *sha1_ctx, crypto_data_t *digest, return (CRYPTO_SUCCESS); } -/* ARGSUSED */ static int sha1_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; ASSERT(ctx->cc_provider_private != NULL); @@ -483,11 +483,12 @@ sha1_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest, return (ret); } -/* ARGSUSED */ static int sha1_digest_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; ASSERT(ctx->cc_provider_private != NULL); @@ -512,11 +513,12 @@ sha1_digest_update(crypto_ctx_t *ctx, crypto_data_t *data, return (ret); } -/* ARGSUSED */ static int sha1_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; ASSERT(ctx->cc_provider_private != NULL); @@ -561,13 +563,16 @@ sha1_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest, return (ret); } -/* ARGSUSED */ static int sha1_digest_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_data_t *data, crypto_data_t *digest, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + (void) req; + int ret = CRYPTO_SUCCESS; SHA1_CTX sha1_ctx; @@ -682,8 +687,6 @@ sha1_mac_init_ctx(sha1_hmac_ctx_t *ctx, void *keyval, uint_t length_in_bytes) SHA1Update(&ctx->hc_ocontext, (uint8_t *)opad, SHA1_HMAC_BLOCK_SIZE); } -/* - */ static int sha1_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_spi_ctx_template_t ctx_template, @@ -754,10 +757,11 @@ sha1_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, return (ret); } -/* ARGSUSED */ static int sha1_mac_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; ASSERT(ctx->cc_provider_private != NULL); @@ -783,10 +787,11 @@ sha1_mac_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) return (ret); } -/* ARGSUSED */ static int sha1_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; uchar_t digest[SHA1_DIGEST_LENGTH]; uint32_t digest_len = SHA1_DIGEST_LENGTH; @@ -877,13 +882,16 @@ sha1_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac, crypto_req_handle_t req) } \ } -/* ARGSUSED */ static int sha1_mac_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac, crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + (void) req; + int ret = CRYPTO_SUCCESS; uchar_t digest[SHA1_DIGEST_LENGTH]; sha1_hmac_ctx_t sha1_hmac_ctx; @@ -993,13 +1001,16 @@ sha1_mac_atomic(crypto_provider_handle_t provider, return (ret); } -/* ARGSUSED */ static int sha1_mac_verify_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac, crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + (void) req; + int ret = CRYPTO_SUCCESS; uchar_t digest[SHA1_DIGEST_LENGTH]; sha1_hmac_ctx_t sha1_hmac_ctx; @@ -1146,14 +1157,14 @@ sha1_mac_verify_atomic(crypto_provider_handle_t provider, /* * KCF software provider context management entry points. */ - -/* ARGSUSED */ static int sha1_create_ctx_template(crypto_provider_handle_t provider, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_spi_ctx_template_t *ctx_template, size_t *ctx_template_size, crypto_req_handle_t req) { + (void) provider; + sha1_hmac_ctx_t *sha1_hmac_ctx_tmpl; uint_t keylen_in_bytes = CRYPTO_BITS2BYTES(key->ck_length); diff --git a/module/icp/io/sha2_mod.c b/module/icp/io/sha2_mod.c index d690cd0bcb05..75a35d5ca10a 100644 --- a/module/icp/io/sha2_mod.c +++ b/module/icp/io/sha2_mod.c @@ -254,22 +254,20 @@ sha2_mod_fini(void) /* * KCF software provider control entry points. */ -/* ARGSUSED */ static void sha2_provider_status(crypto_provider_handle_t provider, uint_t *status) { + (void) provider; *status = CRYPTO_PROVIDER_READY; } /* * KCF software provider digest entry points. */ - static int sha2_digest_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, crypto_req_handle_t req) { - /* * Allocate and initialize SHA2 context. */ @@ -438,11 +436,12 @@ sha2_digest_final_uio(SHA2_CTX *sha2_ctx, crypto_data_t *digest, return (CRYPTO_SUCCESS); } -/* ARGSUSED */ static int sha2_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; uint_t sha_digest_len; @@ -526,11 +525,12 @@ sha2_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest, return (ret); } -/* ARGSUSED */ static int sha2_digest_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; ASSERT(ctx->cc_provider_private != NULL); @@ -555,11 +555,12 @@ sha2_digest_update(crypto_ctx_t *ctx, crypto_data_t *data, return (ret); } -/* ARGSUSED */ static int sha2_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; uint_t sha_digest_len; @@ -618,13 +619,16 @@ sha2_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest, return (ret); } -/* ARGSUSED */ static int sha2_digest_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_data_t *data, crypto_data_t *digest, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + (void) req; + int ret = CRYPTO_SUCCESS; SHA2_CTX sha2_ctx; uint32_t sha_digest_len; @@ -840,11 +844,12 @@ sha2_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, return (ret); } -/* ARGSUSED */ static int sha2_mac_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; ASSERT(ctx->cc_provider_private != NULL); @@ -870,10 +875,11 @@ sha2_mac_update(crypto_ctx_t *ctx, crypto_data_t *data, return (ret); } -/* ARGSUSED */ static int sha2_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac, crypto_req_handle_t req) { + (void) req; + int ret = CRYPTO_SUCCESS; uchar_t digest[SHA512_DIGEST_LENGTH]; uint32_t digest_len, sha_digest_len; @@ -983,13 +989,16 @@ sha2_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac, crypto_req_handle_t req) } \ } -/* ARGSUSED */ static int sha2_mac_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac, crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + (void) req; + int ret = CRYPTO_SUCCESS; uchar_t digest[SHA512_DIGEST_LENGTH]; sha2_hmac_ctx_t sha2_hmac_ctx; @@ -1121,13 +1130,16 @@ sha2_mac_atomic(crypto_provider_handle_t provider, return (ret); } -/* ARGSUSED */ static int sha2_mac_verify_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac, crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + (void) req; + int ret = CRYPTO_SUCCESS; uchar_t digest[SHA512_DIGEST_LENGTH]; sha2_hmac_ctx_t sha2_hmac_ctx; @@ -1300,14 +1312,14 @@ sha2_mac_verify_atomic(crypto_provider_handle_t provider, /* * KCF software provider context management entry points. */ - -/* ARGSUSED */ static int sha2_create_ctx_template(crypto_provider_handle_t provider, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_spi_ctx_template_t *ctx_template, size_t *ctx_template_size, crypto_req_handle_t req) { + (void) provider; + sha2_hmac_ctx_t *sha2_hmac_ctx_tmpl; uint_t keylen_in_bytes = CRYPTO_BITS2BYTES(key->ck_length); uint32_t sha_digest_len, sha_hmac_block_size; diff --git a/module/icp/io/skein_mod.c b/module/icp/io/skein_mod.c index ac7d201eb708..1855f77d411b 100644 --- a/module/icp/io/skein_mod.c +++ b/module/icp/io/skein_mod.c @@ -250,10 +250,10 @@ skein_mod_fini(void) /* * KCF software provider control entry points. */ -/* ARGSUSED */ static void skein_provider_status(crypto_provider_handle_t provider, uint_t *status) { + (void) provider; *status = CRYPTO_PROVIDER_READY; } @@ -462,10 +462,11 @@ skein_digest(crypto_ctx_t *ctx, crypto_data_t *data, crypto_data_t *digest, * can push more data). This is used both for digest and MAC operation. * Supported input data formats are raw, uio and mblk. */ -/*ARGSUSED*/ static int skein_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) { + (void) req; + int error = CRYPTO_SUCCESS; ASSERT(SKEIN_CTX(ctx) != NULL); @@ -491,7 +492,6 @@ skein_update(crypto_ctx_t *ctx, crypto_data_t *data, crypto_req_handle_t req) * for digest and MAC operation. * Supported output digest formats are raw, uio and mblk. */ -/*ARGSUSED*/ static int skein_final(crypto_ctx_t *ctx, crypto_data_t *digest, crypto_req_handle_t req) { @@ -537,12 +537,15 @@ skein_final(crypto_ctx_t *ctx, crypto_data_t *digest, crypto_req_handle_t req) * `data' and writing the output to `digest'. * Supported input/output formats are raw, uio and mblk. */ -/*ARGSUSED*/ static int skein_digest_atomic(crypto_provider_handle_t provider, crypto_session_id_t session_id, crypto_mechanism_t *mechanism, crypto_data_t *data, crypto_data_t *digest, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + (void) req; + int error; skein_ctx_t skein_ctx; crypto_ctx_t ctx; @@ -640,7 +643,6 @@ skein_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, * The MAC update and final calls are reused from the regular digest code. */ -/*ARGSUSED*/ /* * Same as skein_digest_atomic, performs an atomic Skein MAC operation in * one step. All the same properties apply to the arguments of this @@ -652,6 +654,9 @@ skein_mac_atomic(crypto_provider_handle_t provider, crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac, crypto_spi_ctx_template_t ctx_template, crypto_req_handle_t req) { + (void) provider; + (void) session_id; + /* faux crypto context just for skein_digest_{update,final} */ int error; crypto_ctx_t ctx; @@ -686,13 +691,14 @@ skein_mac_atomic(crypto_provider_handle_t provider, * properties apply to the arguments of this function as to those of * skein_mac_init. */ -/*ARGSUSED*/ static int skein_create_ctx_template(crypto_provider_handle_t provider, crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_spi_ctx_template_t *ctx_template, size_t *ctx_template_size, crypto_req_handle_t req) { + (void) provider; + int error; skein_ctx_t *ctx_tmpl; diff --git a/module/icp/os/modconf.c b/module/icp/os/modconf.c index 3743416ed951..b426d542b09e 100644 --- a/module/icp/os/modconf.c +++ b/module/icp/os/modconf.c @@ -47,6 +47,8 @@ struct mod_ops mod_cryptoops = { static int mod_null(struct modlmisc *modl, struct modlinkage *modlp) { + (void) modl; + (void) modlp; return (0); } @@ -56,6 +58,8 @@ mod_null(struct modlmisc *modl, struct modlinkage *modlp) static int mod_infonull(void *modl, struct modlinkage *modlp, int *p0) { + (void) modl; + (void) modlp; *p0 = -1; /* for modinfo display */ return (0); } diff --git a/module/icp/os/modhash.c b/module/icp/os/modhash.c index a897871001ce..a287549315c8 100644 --- a/module/icp/os/modhash.c +++ b/module/icp/os/modhash.c @@ -172,16 +172,16 @@ kmutex_t mh_head_lock; * mod_hash_null_valdtor() * no-op key and value destructors. */ -/*ARGSUSED*/ void mod_hash_null_keydtor(mod_hash_key_t key) { + (void) key; } -/*ARGSUSED*/ void mod_hash_null_valdtor(mod_hash_val_t val) { + (void) val; } /* @@ -198,10 +198,11 @@ mod_hash_null_valdtor(mod_hash_val_t val) * "Compilers: Principles, Tools & Techniques", by Aho, Sethi, Ullman */ -/*ARGSUSED*/ uint_t mod_hash_bystr(void *hash_data, mod_hash_key_t key) { + (void) hash_data; + uint_t hash = 0; uint_t g; char *p, *k = (char *)key; @@ -672,10 +673,10 @@ mod_hash_reserve_nosleep(mod_hash_t *hash, mod_hash_hndl_t *handlep) } -/*ARGSUSED*/ void mod_hash_cancel(mod_hash_t *hash, mod_hash_hndl_t *handlep) { + (void) hash; kmem_cache_free(mh_e_cache, *handlep); *handlep = (mod_hash_hndl_t)0; } diff --git a/module/lua/llimits.h b/module/lua/llimits.h index 177092fbc228..0f6317c9f129 100644 --- a/module/lua/llimits.h +++ b/module/lua/llimits.h @@ -56,14 +56,13 @@ typedef LUAI_UACNUMBER l_uacNumber; /* internal assertions for in-house debugging */ #if defined(lua_assert) -#define check_exp(c,e) (lua_assert(c), (e)) /* to avoid problems with conditions too long */ #define lua_longassert(c) { if (!(c)) lua_assert(0); } #else -#define lua_assert(c) ((void)0) -#define check_exp(c,e) (e) -#define lua_longassert(c) ((void)0) +#define lua_assert(c) ((void)sizeof(c)) +#define lua_longassert(c) ((void)sizeof(c)) #endif +#define check_exp(c,e) (lua_assert(c), (e)) /* ** assertion for checking API calls @@ -297,7 +296,7 @@ union luai_Cast { double l_d; LUA_INT32 l_p[2]; }; ** macro to control inclusion of some hard tests on stack reallocation */ #if !defined(HARDSTACKTESTS) -#define condmovestack(L) ((void)0) +#define condmovestack(L) ((void)sizeof(L)) #else /* realloc stack keeping its size */ #define condmovestack(L) luaD_reallocstack((L), (L)->stacksize) diff --git a/module/nvpair/fnvpair.c b/module/nvpair/fnvpair.c index dc8257e48594..cf878d7ed250 100644 --- a/module/nvpair/fnvpair.c +++ b/module/nvpair/fnvpair.c @@ -82,15 +82,10 @@ fnvlist_pack(nvlist_t *nvl, size_t *sizep) return (packed); } -/*ARGSUSED*/ void fnvlist_pack_free(char *pack, size_t size) { -#ifdef _KERNEL kmem_free(pack, size); -#else - free(pack); -#endif } nvlist_t * diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c index 990a4482c993..a875922927bd 100644 --- a/module/nvpair/nvpair.c +++ b/module/nvpair/nvpair.c @@ -574,6 +574,7 @@ nvlist_nv_alloc(int kmflag) return (nv_alloc_pushpage); } #else + (void) kmflag; return (nv_alloc_nosleep); #endif /* _KERNEL */ } @@ -2274,10 +2275,11 @@ nvlist_add_nvpair(nvlist_t *nvl, nvpair_t *nvp) * the values are taken from nvl in the case of duplicates. * Return 0 on success. */ -/*ARGSUSED*/ int nvlist_merge(nvlist_t *dst, nvlist_t *nvl, int flag) { + (void) flag; + if (nvl == NULL || dst == NULL) return (EINVAL); @@ -2781,10 +2783,10 @@ nvs_native_create(nvstream_t *nvs, nvs_native_t *native, char *buf, } } -/*ARGSUSED*/ static void nvs_native_destroy(nvstream_t *nvs) { + (void) nvs; } static int diff --git a/module/nvpair/nvpair_alloc_fixed.c b/module/nvpair/nvpair_alloc_fixed.c index c8a604a2bfac..dff744570d9f 100644 --- a/module/nvpair/nvpair_alloc_fixed.c +++ b/module/nvpair/nvpair_alloc_fixed.c @@ -85,11 +85,12 @@ nv_fixed_alloc(nv_alloc_t *nva, size_t size) return ((void *)new); } -/*ARGSUSED*/ static void nv_fixed_free(nv_alloc_t *nva, void *buf, size_t size) { - /* don't free memory in the pre-allocated buffer */ + (void) nva; + (void) buf; + (void) size; } static void diff --git a/module/os/freebsd/spl/callb.c b/module/os/freebsd/spl/callb.c index 0b7fefc89a26..1aff918cff0c 100644 --- a/module/os/freebsd/spl/callb.c +++ b/module/os/freebsd/spl/callb.c @@ -40,6 +40,8 @@ #include /* For TASKQ_NAMELEN */ #include +#pragma GCC diagnostic error "-Wunused-parameter" + #define CB_MAXNAME TASKQ_NAMELEN /* @@ -338,10 +340,11 @@ callb_generic_cpr(void *arg, int code) * The generic callback function associated with kernel threads which * are always considered safe. */ -/* ARGSUSED */ boolean_t callb_generic_cpr_safe(void *arg, int code) { + (void) arg; + (void) code; return (B_TRUE); } /* diff --git a/module/os/freebsd/spl/spl_zlib.c b/module/os/freebsd/spl/spl_zlib.c index 3644eba77ca1..b553ef91b084 100644 --- a/module/os/freebsd/spl/spl_zlib.c +++ b/module/os/freebsd/spl/spl_zlib.c @@ -39,20 +39,20 @@ __FBSDID("$FreeBSD$"); #endif #include +#pragma GCC diagnostic error "-Wunused-parameter" + -/*ARGSUSED*/ static void * zcalloc(void *opaque, uint_t items, uint_t size) { - + (void) opaque; return (malloc((size_t)items*size, M_SOLARIS, M_NOWAIT)); } -/*ARGSUSED*/ static void zcfree(void *opaque, void *ptr) { - + (void) opaque; free(ptr, M_SOLARIS); } @@ -119,12 +119,14 @@ static void * zlib_workspace_alloc(int flags) { // return (kmem_cache_alloc(zlib_workspace_cache, flags)); + (void) flags; return (NULL); } static void zlib_workspace_free(void *workspace) { + (void) workspace; // kmem_cache_free(zlib_workspace_cache, workspace); } diff --git a/module/os/freebsd/zfs/vdev_file.c b/module/os/freebsd/zfs/vdev_file.c index fc04a7476154..676a912c68c5 100644 --- a/module/os/freebsd/zfs/vdev_file.c +++ b/module/os/freebsd/zfs/vdev_file.c @@ -34,6 +34,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * Virtual device vector for files. */ @@ -286,10 +288,10 @@ vdev_file_io_start(zio_t *zio) TQ_SLEEP), !=, 0); } -/* ARGSUSED */ static void vdev_file_io_done(zio_t *zio) { + (void) zio; } vdev_ops_t vdev_file_ops = { diff --git a/module/os/freebsd/zfs/zfs_acl.c b/module/os/freebsd/zfs/zfs_acl.c index 9d42755b963b..46340ab989b5 100644 --- a/module/os/freebsd/zfs/zfs_acl.c +++ b/module/os/freebsd/zfs/zfs_acl.c @@ -53,6 +53,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + #define ALLOW ACE_ACCESS_ALLOWED_ACE_TYPE #define DENY ACE_ACCESS_DENIED_ACE_TYPE @@ -144,10 +146,10 @@ zfs_ace_v0_set_who(void *acep, uint64_t who) ((zfs_oldace_t *)acep)->z_fuid = who; } -/*ARGSUSED*/ static size_t zfs_ace_v0_size(void *acep) { + (void) acep; return (sizeof (zfs_oldace_t)); } @@ -163,10 +165,10 @@ zfs_ace_v0_mask_off(void) return (offsetof(zfs_oldace_t, z_access_mask)); } -/*ARGSUSED*/ static int zfs_ace_v0_data(void *acep, void **datap) { + (void) acep; *datap = NULL; return (0); } @@ -631,11 +633,12 @@ zfs_acl_next_ace(zfs_acl_t *aclp, void *start, uint64_t *who, return (NULL); } -/*ARGSUSED*/ static uint64_t zfs_ace_walk(void *datap, uint64_t cookie, int aclcnt, uint16_t *flags, uint16_t *type, uint32_t *mask) { + (void) aclcnt; + zfs_acl_t *aclp = datap; zfs_ace_hdr_t *acep = (zfs_ace_hdr_t *)(uintptr_t)cookie; uint64_t who; @@ -1055,6 +1058,7 @@ int zfs_acl_node_read(znode_t *zp, boolean_t have_lock, zfs_acl_t **aclpp, boolean_t will_modify) { + (void) have_lock; zfs_acl_t *aclp; int aclsize; int acl_count; @@ -1120,11 +1124,12 @@ zfs_acl_node_read(znode_t *zp, boolean_t have_lock, zfs_acl_t **aclpp, return (error); } -/*ARGSUSED*/ void zfs_acl_data_locator(void **dataptr, uint32_t *length, uint32_t buflen, boolean_t start, void *userdata) { + (void) buflen; + zfs_acl_locator_cb_t *cb = (zfs_acl_locator_cb_t *)userdata; if (start) { @@ -2314,6 +2319,7 @@ zfs_zaccess_append(znode_t *zp, uint32_t *working_mode, boolean_t *check_privs, int zfs_fastaccesschk_execute(znode_t *zdp, cred_t *cr) { + (void) cr; boolean_t is_attr; if (zdp->z_pflags & ZFS_AV_QUARANTINED) diff --git a/module/os/freebsd/zfs/zfs_ctldir.c b/module/os/freebsd/zfs/zfs_ctldir.c index 3b405e9d68eb..ee57427b138e 100644 --- a/module/os/freebsd/zfs/zfs_ctldir.c +++ b/module/os/freebsd/zfs/zfs_ctldir.c @@ -88,6 +88,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* Common access mode for all virtual directories under the ctldir */ const uint16_t zfsctl_ctldir_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; @@ -146,6 +148,7 @@ static int sfs_vnode_insert(struct vnode *vp, int flags, uint64_t parent_id, uint64_t id, struct vnode **vpp) { + (void) parent_id; int err; KASSERT(vp->v_data != NULL, ("sfs_vnode_insert with NULL v_data")); @@ -456,10 +459,10 @@ zfsctl_common_open(struct vop_open_args *ap) /* * Common close routine. Nothing to do here. */ -/* ARGSUSED */ static int zfsctl_common_close(struct vop_close_args *ap) { + (void) ap; return (0); } @@ -1273,6 +1276,7 @@ zfsctl_lookup_objset(vfs_t *vfsp, uint64_t objsetid, zfsvfs_t **zfsvfsp) int zfsctl_umount_snapshots(vfs_t *vfsp, int fflags, cred_t *cr) { + (void) cr; char snapname[ZFS_MAX_DATASET_NAME_LEN]; zfsvfs_t *zfsvfs = vfsp->vfs_data; struct mount *mp; diff --git a/module/os/freebsd/zfs/zfs_debug.c b/module/os/freebsd/zfs/zfs_debug.c index 7239db80851c..5f4f92b595ca 100644 --- a/module/os/freebsd/zfs/zfs_debug.c +++ b/module/os/freebsd/zfs/zfs_debug.c @@ -57,7 +57,6 @@ static int zfs_dbgmsg_headers(char *buf, size_t size) { (void) snprintf(buf, size, "%-12s %-8s\n", "timestamp", "message"); - return (0); } @@ -68,7 +67,6 @@ zfs_dbgmsg_data(char *buf, size_t size, void *data) (void) snprintf(buf, size, "%-12llu %-s\n", (u_longlong_t)zdm->zdm_timestamp, zdm->zdm_msg); - return (0); } @@ -181,7 +179,7 @@ __set_error(const char *file, const char *func, int line, int err) * $ echo 512 >/sys/module/zfs/parameters/zfs_flags */ if (zfs_flags & ZFS_DEBUG_SET_ERROR) - __dprintf(B_FALSE, file, func, line, "error %lu", err); + __dprintf(B_FALSE, file, func, line, "error %u", err); } #ifdef _KERNEL diff --git a/module/os/freebsd/zfs/zfs_racct.c b/module/os/freebsd/zfs/zfs_racct.c index b46cc046268e..883255bc1901 100644 --- a/module/os/freebsd/zfs/zfs_racct.c +++ b/module/os/freebsd/zfs/zfs_racct.c @@ -37,6 +37,8 @@ zfs_racct_read(uint64_t size, uint64_t iops) racct_add_force(curproc, RACCT_READIOPS, iops); PROC_UNLOCK(curproc); } +#else + (void) size; #endif /* RACCT */ } @@ -51,5 +53,7 @@ zfs_racct_write(uint64_t size, uint64_t iops) racct_add_force(curproc, RACCT_WRITEIOPS, iops); PROC_UNLOCK(curproc); } +#else + (void) size; #endif /* RACCT */ } diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c index 4e22206de329..5e99d9668caa 100644 --- a/module/os/freebsd/zfs/zfs_vfsops.c +++ b/module/os/freebsd/zfs/zfs_vfsops.c @@ -69,6 +69,8 @@ #include "zfs_comutil.h" +#pragma GCC diagnostic error "-Wunused-parameter" + #ifndef MNTK_VMSETSIZE_BUG #define MNTK_VMSETSIZE_BUG 0 #endif @@ -399,7 +401,6 @@ zfs_is_readonly(zfsvfs_t *zfsvfs) return (!!(zfsvfs->z_vfs->vfs_flag & VFS_RDONLY)); } -/*ARGSUSED*/ static int zfs_sync(vfs_t *vfsp, int waitfor) { @@ -1312,7 +1313,6 @@ fetch_osname_options(char *name, bool *checkpointrewind) } } -/*ARGSUSED*/ static int zfs_mount(vfs_t *vfsp) { @@ -1643,7 +1643,6 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting) return (0); } -/*ARGSUSED*/ static int zfs_umount(vfs_t *vfsp, int fflag) { @@ -1874,7 +1873,9 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp) gen_mask = -1ULL >> (64 - 8 * i); - dprintf("getting %llu [%u mask %llx]\n", object, fid_gen, gen_mask); + dprintf("getting %llu [%llu mask %llx]\n", + (u_longlong_t)object, + (u_longlong_t)fid_gen, (u_longlong_t)gen_mask); if ((err = zfs_zget(zfsvfs, object, &zp))) { ZFS_EXIT(zfsvfs); return (err); @@ -1885,7 +1886,8 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp) if (zp_gen == 0) zp_gen = 1; if (zp->z_unlinked || zp_gen != fid_gen) { - dprintf("znode gen (%u) != fid gen (%u)\n", zp_gen, fid_gen); + dprintf("znode gen (%llu) != fid gen (%llu)\n", + (u_longlong_t)zp_gen, (u_longlong_t)fid_gen); vrele(ZTOV(zp)); ZFS_EXIT(zfsvfs); return (SET_ERROR(EINVAL)); diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c index 46a632b0385c..41b0029ea9bc 100644 --- a/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/module/os/freebsd/zfs/zfs_vnops_os.c @@ -91,6 +91,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + #ifndef VN_OPEN_INVFS #define VN_OPEN_INVFS 0x0 #endif @@ -215,10 +217,10 @@ VFS_SMR_DECLARE; * return (error); // done, report error */ -/* ARGSUSED */ static int zfs_open(vnode_t **vpp, int flag, cred_t *cr) { + (void) cr; znode_t *zp = VTOZ(*vpp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; @@ -239,10 +241,11 @@ zfs_open(vnode_t **vpp, int flag, cred_t *cr) return (0); } -/* ARGSUSED */ static int zfs_close(vnode_t *vp, int flag, int count, offset_t offset, cred_t *cr) { + (void) offset; + (void) cr; znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; @@ -257,11 +260,13 @@ zfs_close(vnode_t *vp, int flag, int count, offset_t offset, cred_t *cr) return (0); } -/* ARGSUSED */ static int zfs_ioctl(vnode_t *vp, ulong_t com, intptr_t data, int flag, cred_t *cred, int *rvalp) { + (void) flag; + (void) cred; + (void) rvalp; loff_t off; int error; @@ -668,6 +673,7 @@ zfs_zrele_async(znode_t *zp) static int zfs_dd_callback(struct mount *mp, void *arg, int lkflags, struct vnode **vpp) { + (void) mp; int error; *vpp = arg; @@ -758,12 +764,12 @@ zfs_lookup_lock(vnode_t *dvp, vnode_t *vp, const char *name, int lkflags) * Timestamps: * NA */ -/* ARGSUSED */ static int zfs_lookup(vnode_t *dvp, const char *nm, vnode_t **vpp, struct componentname *cnp, int nameiop, cred_t *cr, kthread_t *td, int flags, boolean_t cached) { + (void) td; znode_t *zdp = VTOZ(dvp); znode_t *zp; zfsvfs_t *zfsvfs = zdp->z_zfsvfs; @@ -1029,11 +1035,13 @@ zfs_lookup(vnode_t *dvp, const char *nm, vnode_t **vpp, * vp - ctime|mtime always, atime if new */ -/* ARGSUSED */ int zfs_create(znode_t *dzp, const char *name, vattr_t *vap, int excl, int mode, znode_t **zpp, cred_t *cr, int flag, vsecattr_t *vsecp) { + (void) excl; + (void) mode; + (void) flag; znode_t *zp; zfsvfs_t *zfsvfs = dzp->z_zfsvfs; zilog_t *zilog; @@ -1196,7 +1204,6 @@ zfs_create(znode_t *dzp, const char *name, vattr_t *vap, int excl, int mode, * vp - ctime (if nlink > 0) */ -/*ARGSUSED*/ static int zfs_remove_(vnode_t *dvp, vnode_t *vp, const char *name, cred_t *cr) { @@ -1351,6 +1358,7 @@ zfs_lookup_internal(znode_t *dzp, const char *name, vnode_t **vpp, int zfs_remove(znode_t *dzp, const char *name, cred_t *cr, int flags) { + (void) flags; vnode_t *vp; int error; struct componentname cn; @@ -1382,11 +1390,12 @@ zfs_remove(znode_t *dzp, const char *name, cred_t *cr, int flags) * dvp - ctime|mtime updated * vp - ctime|mtime|atime updated */ -/*ARGSUSED*/ int zfs_mkdir(znode_t *dzp, const char *dirname, vattr_t *vap, znode_t **zpp, cred_t *cr, int flags, vsecattr_t *vsecp) { + (void) flags; + (void) vsecp; znode_t *zp; zfsvfs_t *zfsvfs = dzp->z_zfsvfs; zilog_t *zilog; @@ -1559,7 +1568,6 @@ cache_vop_rmdir(struct vnode *dvp, struct vnode *vp) * Timestamps: * dvp - ctime|mtime updated */ -/*ARGSUSED*/ static int zfs_rmdir_(vnode_t *dvp, vnode_t *vp, const char *name, cred_t *cr) { @@ -1623,6 +1631,8 @@ zfs_rmdir_(vnode_t *dvp, vnode_t *vp, const char *name, cred_t *cr) int zfs_rmdir(znode_t *dzp, const char *name, znode_t *cwd, cred_t *cr, int flags) { + (void) cwd; + (void) flags; struct componentname cn; vnode_t *vp; int error; @@ -1660,7 +1670,6 @@ zfs_rmdir(znode_t *dzp, const char *name, znode_t *cwd, cred_t *cr, int flags) * We use 0 for '.', and 1 for '..'. If this is the root of the filesystem, * we use the offset 2 for the '.zfs' directory. */ -/* ARGSUSED */ static int zfs_readdir(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, int *eofp, int *ncookies, ulong_t **cookies) @@ -1986,7 +1995,6 @@ zfs_readdir(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, int *eofp, * * RETURN: 0 (always succeeds). */ -/* ARGSUSED */ static int zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr) { @@ -2200,7 +2208,6 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr) * Timestamps: * vp - ctime updated, mtime updated if size changed. */ -/* ARGSUSED */ int zfs_setattr(znode_t *zp, vattr_t *vap, int flags, cred_t *cr) { @@ -3180,12 +3187,12 @@ cache_vop_rename(struct vnode *fdvp, struct vnode *fvp, struct vnode *tdvp, * Timestamps: * sdvp,tdvp - ctime|mtime updated */ -/*ARGSUSED*/ static int zfs_rename_(vnode_t *sdvp, vnode_t **svpp, struct componentname *scnp, vnode_t *tdvp, vnode_t **tvpp, struct componentname *tcnp, cred_t *cr, int log) { + (void) log; zfsvfs_t *zfsvfs; znode_t *sdzp, *tdzp, *szp, *tzp; zilog_t *zilog = NULL; @@ -3457,6 +3464,7 @@ int zfs_rename(znode_t *sdzp, const char *sname, znode_t *tdzp, const char *tname, cred_t *cr, int flags) { + (void) flags; struct componentname scn, tcn; vnode_t *sdvp, *tdvp; vnode_t *svp, *tvp; @@ -3506,11 +3514,11 @@ zfs_rename(znode_t *sdzp, const char *sname, znode_t *tdzp, const char *tname, * Timestamps: * dvp - ctime|mtime updated */ -/*ARGSUSED*/ int zfs_symlink(znode_t *dzp, const char *name, vattr_t *vap, const char *link, znode_t **zpp, cred_t *cr, int flags) { + (void) flags; znode_t *zp; dmu_tx_t *tx; zfsvfs_t *zfsvfs = dzp->z_zfsvfs; @@ -3645,10 +3653,11 @@ zfs_symlink(znode_t *dzp, const char *name, vattr_t *vap, * Timestamps: * vp - atime updated */ -/* ARGSUSED */ static int zfs_readlink(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, caller_context_t *ct) { + (void) cr; + (void) ct; znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; int error; @@ -3682,11 +3691,11 @@ zfs_readlink(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, caller_context_t *ct) * tdvp - ctime|mtime updated * svp - ctime updated */ -/* ARGSUSED */ int zfs_link(znode_t *tdzp, znode_t *szp, const char *name, cred_t *cr, int flags) { + (void) flags; znode_t *tzp; zfsvfs_t *zfsvfs = tdzp->z_zfsvfs; zilog_t *zilog; @@ -3831,11 +3840,11 @@ zfs_link(znode_t *tdzp, znode_t *szp, const char *name, cred_t *cr, * Timestamps: * ip - ctime|mtime updated */ -/* ARGSUSED */ int zfs_space(znode_t *zp, int cmd, flock64_t *bfp, int flag, offset_t offset, cred_t *cr) { + (void) offset; zfsvfs_t *zfsvfs = ZTOZSB(zp); uint64_t off, len; int error; @@ -3882,10 +3891,11 @@ zfs_space(znode_t *zp, int cmd, flock64_t *bfp, int flag, return (error); } -/*ARGSUSED*/ static void zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct) { + (void) cr; + (void) ct; znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; int error; @@ -3932,10 +3942,10 @@ zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct) CTASSERT(sizeof (struct zfid_short) <= sizeof (struct fid)); CTASSERT(sizeof (struct zfid_long) <= sizeof (struct fid)); -/*ARGSUSED*/ static int zfs_fid(vnode_t *vp, fid_t *fidp, caller_context_t *ct) { + (void) ct; znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; uint32_t gen; @@ -3993,6 +4003,8 @@ static int zfs_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr, caller_context_t *ct) { + (void) cr; + (void) ct; znode_t *zp; zfsvfs_t *zfsvfs; @@ -5973,7 +5985,7 @@ struct vop_aclcheck_args { static int zfs_freebsd_aclcheck(struct vop_aclcheck_args *ap) { - + (void) ap; return (EOPNOTSUPP); } diff --git a/module/os/freebsd/zfs/zfs_znode.c b/module/os/freebsd/zfs/zfs_znode.c index 6a59c0eae766..62d5bb78f076 100644 --- a/module/os/freebsd/zfs/zfs_znode.c +++ b/module/os/freebsd/zfs/zfs_znode.c @@ -67,6 +67,8 @@ #include "zfs_prop.h" #include "zfs_comutil.h" +#pragma GCC diagnostic error "-Wunused-parameter" + /* Used by fstat(1). */ SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, sizeof (znode_t), "sizeof(znode_t)"); @@ -137,6 +139,8 @@ zfs_rangelock_cb(zfs_locked_range_t *new, void *arg) static int zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) { + (void) arg; + (void) kmflags; znode_t *zp = buf; POINTER_INVALIDATE(&zp->z_zfsvfs); @@ -156,10 +160,10 @@ zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) return (0); } -/*ARGSUSED*/ static void zfs_znode_cache_destructor(void *buf, void *arg) { + (void) arg; znode_t *zp = buf; ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); @@ -1578,6 +1582,7 @@ zfs_trunc(znode_t *zp, uint64_t end) int zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log) { + (void) flag; dmu_tx_t *tx; zfsvfs_t *zfsvfs = zp->z_zfsvfs; zilog_t *zilog = zfsvfs->z_log; diff --git a/module/os/freebsd/zfs/zio_crypt.c b/module/os/freebsd/zfs/zio_crypt.c index 832378a92a8d..89ba7e1e9bde 100644 --- a/module/os/freebsd/zfs/zio_crypt.c +++ b/module/os/freebsd/zfs/zio_crypt.c @@ -27,6 +27,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * This file is responsible for handling all of the details of generating * encryption parameters and performing encryption and authentication. @@ -1033,7 +1035,6 @@ zio_crypt_do_dnode_hmac_updates(crypto_context_t ctx, uint64_t version, * and le_bswap indicates whether a byteswap is needed to get this block * into little endian format. */ -/* ARGSUSED */ int zio_crypt_do_objset_hmacs(zio_crypt_key_t *key, void *data, uint_t datalen, boolean_t should_bswap, uint8_t *portable_mac, uint8_t *local_mac) @@ -1242,13 +1243,13 @@ zio_crypt_do_indirect_mac_checksum_abd(boolean_t generate, abd_t *abd, * It also means we'll only return one zfs_uio_t. */ -/* ARGSUSED */ static int zio_crypt_init_uios_zil(boolean_t encrypt, uint8_t *plainbuf, uint8_t *cipherbuf, uint_t datalen, boolean_t byteswap, zfs_uio_t *puio, zfs_uio_t *out_uio, uint_t *enc_len, uint8_t **authbuf, uint_t *auth_len, boolean_t *no_crypt) { + (void) puio; uint8_t *aadbuf = zio_buf_alloc(datalen); uint8_t *src, *dst, *slrp, *dlrp, *blkend, *aadp; iovec_t *dst_iovecs; @@ -1405,6 +1406,7 @@ zio_crypt_init_uios_dnode(boolean_t encrypt, uint64_t version, zfs_uio_t *puio, zfs_uio_t *out_uio, uint_t *enc_len, uint8_t **authbuf, uint_t *auth_len, boolean_t *no_crypt) { + (void) puio; uint8_t *aadbuf = zio_buf_alloc(datalen); uint8_t *src, *dst, *aadp; dnode_phys_t *dnp, *adnp, *sdnp, *ddnp; @@ -1545,12 +1547,12 @@ zio_crypt_init_uios_dnode(boolean_t encrypt, uint64_t version, return (0); } -/* ARGSUSED */ static int zio_crypt_init_uios_normal(boolean_t encrypt, uint8_t *plainbuf, uint8_t *cipherbuf, uint_t datalen, zfs_uio_t *puio, zfs_uio_t *out_uio, uint_t *enc_len) { + (void) puio; int ret; uint_t nr_plain = 1, nr_cipher = 2; iovec_t *plain_iovecs = NULL, *cipher_iovecs = NULL; diff --git a/module/os/freebsd/zfs/zvol_os.c b/module/os/freebsd/zfs/zvol_os.c index 34aad72fbbfd..8661fbaefde2 100644 --- a/module/os/freebsd/zfs/zvol_os.c +++ b/module/os/freebsd/zfs/zvol_os.c @@ -99,6 +99,8 @@ #include "zfs_namecheck.h" +#pragma GCC diagnostic error "-Wunused-parameter" + #define ZVOL_DUMPSIZE "dumpsize" #ifdef ZVOL_LOCK_DEBUG @@ -203,7 +205,6 @@ static int zvol_geom_bio_getattr(struct bio *bp); * GEOM mode implementation */ -/*ARGSUSED*/ static int zvol_geom_open(struct g_provider *pp, int flag, int count) { @@ -324,10 +325,10 @@ zvol_geom_open(struct g_provider *pp, int flag, int count) return (err); } -/*ARGSUSED*/ static int zvol_geom_close(struct g_provider *pp, int flag, int count) { + (void) flag; zvol_state_t *zv; boolean_t drop_suspend = B_TRUE; int new_open_count; @@ -748,6 +749,7 @@ zvol_geom_bio_strategy(struct bio *bp) static int zvol_cdev_read(struct cdev *dev, struct uio *uio_s, int ioflag) { + (void) ioflag; zvol_state_t *zv; uint64_t volsize; zfs_locked_range_t *lr; @@ -855,6 +857,8 @@ zvol_cdev_write(struct cdev *dev, struct uio *uio_s, int ioflag) static int zvol_cdev_open(struct cdev *dev, int flags, int fmt, struct thread *td) { + (void) fmt; + (void) td; zvol_state_t *zv; struct zvol_state_dev *zsd; int err = 0; @@ -959,6 +963,8 @@ zvol_cdev_open(struct cdev *dev, int flags, int fmt, struct thread *td) static int zvol_cdev_close(struct cdev *dev, int flags, int fmt, struct thread *td) { + (void) fmt; + (void) td; zvol_state_t *zv; struct zvol_state_dev *zsd; boolean_t drop_suspend = B_TRUE; @@ -1032,6 +1038,8 @@ static int zvol_cdev_ioctl(struct cdev *dev, ulong_t cmd, caddr_t data, int fflag, struct thread *td) { + (void) fflag; + (void) td; zvol_state_t *zv; zfs_locked_range_t *lr; off_t offset, length; @@ -1493,12 +1501,16 @@ zvol_update_volsize(zvol_state_t *zv, uint64_t volsize) static void zvol_set_disk_ro_impl(zvol_state_t *zv, int flags) { + (void) zv; + (void) flags; // XXX? set_disk_ro(zv->zv_zso->zvo_disk, flags); } static void zvol_set_capacity_impl(zvol_state_t *zv, uint64_t capacity) { + (void) zv; + (void) capacity; // XXX? set_capacity(zv->zv_zso->zvo_disk, capacity); } diff --git a/module/os/linux/zfs/abd_os.c b/module/os/linux/zfs/abd_os.c index 551a3cc8d1db..869dae192ad7 100644 --- a/module/os/linux/zfs/abd_os.c +++ b/module/os/linux/zfs/abd_os.c @@ -191,6 +191,8 @@ abd_alloc_struct_impl(size_t size) * In Linux we do not use the size passed in during ABD * allocation, so we just ignore it. */ + (void) size; + abd_t *abd = kmem_cache_alloc(abd_cache, KM_PUSHPAGE); ASSERT3P(abd, !=, NULL); ABDSTAT_INCR(abdstat_struct_size, sizeof (abd_t)); diff --git a/module/os/linux/zfs/arc_os.c b/module/os/linux/zfs/arc_os.c index 465775a6748e..45b96ec70bfa 100644 --- a/module/os/linux/zfs/arc_os.c +++ b/module/os/linux/zfs/arc_os.c @@ -58,6 +58,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * This is a limit on how many pages the ARC shrinker makes available for * eviction in response to one page allocation attempt. Note that in @@ -163,6 +165,8 @@ arc_evictable_memory(void) static unsigned long arc_shrinker_count(struct shrinker *shrink, struct shrink_control *sc) { + (void) shrink; + /* * __GFP_FS won't be set if we are called from ZFS code (see * kmem_flags_convert(), which removes it). To avoid a deadlock, we @@ -206,6 +210,8 @@ arc_shrinker_count(struct shrinker *shrink, struct shrink_control *sc) static unsigned long arc_shrinker_scan(struct shrinker *shrink, struct shrink_control *sc) { + (void) shrink; + ASSERT((sc->gfp_mask & __GFP_FS) != 0); /* The arc is considered warm once reclaim has occurred */ @@ -386,11 +392,13 @@ param_set_arc_int(const char *buf, zfs_kernel_param_t *kp) } #ifdef CONFIG_MEMORY_HOTPLUG -/* ARGSUSED */ static int arc_hotplug_callback(struct notifier_block *self, unsigned long action, void *arg) { + (void) self; + (void) arg; + uint64_t allmem = arc_all_memory(); if (action != MEM_ONLINE) return (NOTIFY_OK); @@ -446,6 +454,9 @@ arc_available_memory(void) int arc_memory_throttle(spa_t *spa, uint64_t reserve, uint64_t txg) { + (void) spa; + (void) reserve; + (void) txg; return (0); } diff --git a/module/os/linux/zfs/vdev_file.c b/module/os/linux/zfs/vdev_file.c index bf8a13ae6154..98338e604fa8 100644 --- a/module/os/linux/zfs/vdev_file.c +++ b/module/os/linux/zfs/vdev_file.c @@ -298,10 +298,10 @@ vdev_file_io_start(zio_t *zio) TQ_SLEEP), !=, TASKQID_INVALID); } -/* ARGSUSED */ static void vdev_file_io_done(zio_t *zio) { + (void) zio; } vdev_ops_t vdev_file_ops = { diff --git a/module/os/linux/zfs/zfs_acl.c b/module/os/linux/zfs/zfs_acl.c index 1233c32deac1..ed77fb058037 100644 --- a/module/os/linux/zfs/zfs_acl.c +++ b/module/os/linux/zfs/zfs_acl.c @@ -52,6 +52,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + #define ALLOW ACE_ACCESS_ALLOWED_ACE_TYPE #define DENY ACE_ACCESS_DENIED_ACE_TYPE #define MAX_ACE_TYPE ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE @@ -144,10 +146,10 @@ zfs_ace_v0_set_who(void *acep, uint64_t who) ((zfs_oldace_t *)acep)->z_fuid = who; } -/*ARGSUSED*/ static size_t zfs_ace_v0_size(void *acep) { + (void) acep; return (sizeof (zfs_oldace_t)); } @@ -163,10 +165,10 @@ zfs_ace_v0_mask_off(void) return (offsetof(zfs_oldace_t, z_access_mask)); } -/*ARGSUSED*/ static int zfs_ace_v0_data(void *acep, void **datap) { + (void) acep; *datap = NULL; return (0); } @@ -629,11 +631,12 @@ zfs_acl_next_ace(zfs_acl_t *aclp, void *start, uint64_t *who, return (NULL); } -/*ARGSUSED*/ static uint64_t zfs_ace_walk(void *datap, uint64_t cookie, int aclcnt, uint16_t *flags, uint16_t *type, uint32_t *mask) { + (void) aclcnt; + zfs_acl_t *aclp = datap; zfs_ace_hdr_t *acep = (zfs_ace_hdr_t *)(uintptr_t)cookie; uint64_t who; @@ -1130,11 +1133,11 @@ zfs_acl_node_read(struct znode *zp, boolean_t have_lock, zfs_acl_t **aclpp, return (error); } -/*ARGSUSED*/ void zfs_acl_data_locator(void **dataptr, uint32_t *length, uint32_t buflen, boolean_t start, void *userdata) { + (void) buflen; zfs_acl_locator_cb_t *cb = (zfs_acl_locator_cb_t *)userdata; if (start) { diff --git a/module/os/linux/zfs/zfs_debug.c b/module/os/linux/zfs/zfs_debug.c index 8d7f04097da8..2c99defd4e35 100644 --- a/module/os/linux/zfs/zfs_debug.c +++ b/module/os/linux/zfs/zfs_debug.c @@ -84,6 +84,8 @@ zfs_dbgmsg_purge(int max_size) static int zfs_dbgmsg_clear(procfs_list_t *procfs_list) { + (void) procfs_list; + mutex_enter(&zfs_dbgmsgs.pl_lock); zfs_dbgmsg_purge(0); mutex_exit(&zfs_dbgmsgs.pl_lock); @@ -127,7 +129,7 @@ __set_error(const char *file, const char *func, int line, int err) * $ echo 512 >/sys/module/zfs/parameters/zfs_flags */ if (zfs_flags & ZFS_DEBUG_SET_ERROR) - __dprintf(B_FALSE, file, func, line, "error %lu", err); + __dprintf(B_FALSE, file, func, line, "error %u", err); } void diff --git a/module/os/linux/zfs/zfs_racct.c b/module/os/linux/zfs/zfs_racct.c index 7897e0f9edc1..24fdfe7f1600 100644 --- a/module/os/linux/zfs/zfs_racct.c +++ b/module/os/linux/zfs/zfs_racct.c @@ -28,9 +28,13 @@ void zfs_racct_read(uint64_t size, uint64_t iops) { + (void) size; + (void) iops; } void zfs_racct_write(uint64_t size, uint64_t iops) { + (void) size; + (void) iops; } diff --git a/module/os/linux/zfs/zfs_vfsops.c b/module/os/linux/zfs/zfs_vfsops.c index ff0b0d9df8f0..5532282dd5f9 100644 --- a/module/os/linux/zfs/zfs_vfsops.c +++ b/module/os/linux/zfs/zfs_vfsops.c @@ -62,6 +62,8 @@ #include #include "zfs_comutil.h" +#pragma GCC diagnostic error "-Wunused-parameter" + enum { TOKEN_RO, TOKEN_RW, @@ -122,6 +124,8 @@ zfsvfs_vfs_free(vfs_t *vfsp) static int zfsvfs_parse_option(char *option, int token, substring_t *args, vfs_t *vfsp) { + (void) option; + switch (token) { case TOKEN_RO: vfsp->vfs_readonly = B_TRUE; @@ -256,10 +260,10 @@ zfs_is_readonly(zfsvfs_t *zfsvfs) return (!!(zfsvfs->z_sb->s_flags & SB_RDONLY)); } -/*ARGSUSED*/ int zfs_sync(struct super_block *sb, int wait, cred_t *cr) { + (void) cr; zfsvfs_t *zfsvfs = sb->s_fs_info; /* @@ -400,16 +404,22 @@ readonly_changed_cb(void *arg, uint64_t newval) static void devices_changed_cb(void *arg, uint64_t newval) { + (void) arg; + (void) newval; } static void setuid_changed_cb(void *arg, uint64_t newval) { + (void) arg; + (void) newval; } static void exec_changed_cb(void *arg, uint64_t newval) { + (void) arg; + (void) newval; } static void @@ -1442,6 +1452,7 @@ atomic_long_t zfs_bdi_seq = ATOMIC_LONG_INIT(0); int zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent) { + (void) silent; const char *osname = zm->mnt_osname; struct inode *root_inode = NULL; uint64_t recordsize; @@ -1595,7 +1606,6 @@ zfs_preumount(struct super_block *sb) * Called once all other unmount released tear down has occurred. * It is our responsibility to release any remaining infrastructure. */ -/*ARGSUSED*/ int zfs_umount(struct super_block *sb) { @@ -2123,7 +2133,6 @@ zfs_get_vfs_flag_unmounted(objset_t *os) return (unmounted); } -/*ARGSUSED*/ void zfsvfs_update_fromname(const char *oldname, const char *newname) { @@ -2131,6 +2140,8 @@ zfsvfs_update_fromname(const char *oldname, const char *newname) * We don't need to do anything here, the devname is always current by * virtue of zfsvfs->z_sb->s_op->show_devname. */ + (void) oldname; + (void) newname; } void diff --git a/module/os/linux/zfs/zfs_vnops_os.c b/module/os/linux/zfs/zfs_vnops_os.c index 24c016c5fcf1..11f668b571c8 100644 --- a/module/os/linux/zfs/zfs_vnops_os.c +++ b/module/os/linux/zfs/zfs_vnops_os.c @@ -70,6 +70,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * Programming rules. * @@ -175,10 +177,10 @@ * return (error); // done, report error */ -/* ARGSUSED */ int zfs_open(struct inode *ip, int mode, int flag, cred_t *cr) { + (void) cr; znode_t *zp = ITOZ(ip); zfsvfs_t *zfsvfs = ITOZSB(ip); @@ -200,10 +202,10 @@ zfs_open(struct inode *ip, int mode, int flag, cred_t *cr) return (0); } -/* ARGSUSED */ int zfs_close(struct inode *ip, int flag, cred_t *cr) { + (void) cr; znode_t *zp = ITOZ(ip); zfsvfs_t *zfsvfs = ITOZSB(ip); @@ -409,7 +411,6 @@ zfs_zrele_async(znode_t *zp) * Timestamps: * NA */ -/* ARGSUSED */ int zfs_lookup(znode_t *zdp, char *nm, znode_t **zpp, int flags, cred_t *cr, int *direntflags, pathname_t *realpnp) @@ -530,7 +531,6 @@ zfs_lookup(znode_t *zdp, char *nm, znode_t **zpp, int flags, cred_t *cr, * zp - ctime|mtime always, atime if new */ -/* ARGSUSED */ int zfs_create(znode_t *dzp, char *name, vattr_t *vap, int excl, int mode, znode_t **zpp, cred_t *cr, int flag, vsecattr_t *vsecp) @@ -776,11 +776,13 @@ zfs_create(znode_t *dzp, char *name, vattr_t *vap, int excl, return (error); } -/* ARGSUSED */ int zfs_tmpfile(struct inode *dip, vattr_t *vap, int excl, int mode, struct inode **ipp, cred_t *cr, int flag, vsecattr_t *vsecp) { + (void) excl; + (void) mode; + (void) flag; znode_t *zp = NULL, *dzp = ITOZ(dip); zfsvfs_t *zfsvfs = ITOZSB(dip); objset_t *os; @@ -914,7 +916,6 @@ zfs_tmpfile(struct inode *dip, vattr_t *vap, int excl, uint64_t null_xattr = 0; -/*ARGSUSED*/ int zfs_remove(znode_t *dzp, char *name, cred_t *cr, int flags) { @@ -1154,7 +1155,6 @@ zfs_remove(znode_t *dzp, char *name, cred_t *cr, int flags) * dzp - ctime|mtime updated * zpp - ctime|mtime|atime updated */ -/*ARGSUSED*/ int zfs_mkdir(znode_t *dzp, char *dirname, vattr_t *vap, znode_t **zpp, cred_t *cr, int flags, vsecattr_t *vsecp) @@ -1343,7 +1343,6 @@ zfs_mkdir(znode_t *dzp, char *dirname, vattr_t *vap, znode_t **zpp, * Timestamps: * dzp - ctime|mtime updated */ -/*ARGSUSED*/ int zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd, cred_t *cr, int flags) @@ -1476,10 +1475,10 @@ zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd, cred_t *cr, * We use 0 for '.', and 1 for '..'. If this is the root of the filesystem, * we use the offset 2 for the '.zfs' directory. */ -/* ARGSUSED */ int zfs_readdir(struct inode *ip, zpl_dir_context_t *ctx, cred_t *cr) { + (void) cr; znode_t *zp = ITOZ(ip); zfsvfs_t *zfsvfs = ITOZSB(ip); objset_t *os; @@ -1629,7 +1628,6 @@ zfs_readdir(struct inode *ip, zpl_dir_context_t *ctx, cred_t *cr) * * RETURN: 0 (always succeeds) */ -/* ARGSUSED */ int zfs_getattr_fast(struct user_namespace *user_ns, struct inode *ip, struct kstat *sp) @@ -1817,7 +1815,6 @@ zfs_setattr_dir(znode_t *dzp) * Timestamps: * ip - ctime updated, mtime updated if size changed. */ -/* ARGSUSED */ int zfs_setattr(znode_t *zp, vattr_t *vap, int flags, cred_t *cr) { @@ -2646,7 +2643,6 @@ zfs_rename_lock(znode_t *szp, znode_t *tdzp, znode_t *sdzp, zfs_zlock_t **zlpp) * Timestamps: * sdzp,tdzp - ctime|mtime updated */ -/*ARGSUSED*/ int zfs_rename(znode_t *sdzp, char *snm, znode_t *tdzp, char *tnm, cred_t *cr, int flags) @@ -3014,7 +3010,6 @@ zfs_rename(znode_t *sdzp, char *snm, znode_t *tdzp, char *tnm, * Timestamps: * dip - ctime|mtime updated */ -/*ARGSUSED*/ int zfs_symlink(znode_t *dzp, char *name, vattr_t *vap, char *link, znode_t **zpp, cred_t *cr, int flags) @@ -3182,10 +3177,10 @@ zfs_symlink(znode_t *dzp, char *name, vattr_t *vap, char *link, * Timestamps: * ip - atime updated */ -/* ARGSUSED */ int zfs_readlink(struct inode *ip, zfs_uio_t *uio, cred_t *cr) { + (void) cr; znode_t *zp = ITOZ(ip); zfsvfs_t *zfsvfs = ITOZSB(ip); int error; @@ -3221,7 +3216,6 @@ zfs_readlink(struct inode *ip, zfs_uio_t *uio, cred_t *cr) * tdzp - ctime|mtime updated * szp - ctime updated */ -/* ARGSUSED */ int zfs_link(znode_t *tdzp, znode_t *szp, char *name, cred_t *cr, int flags) @@ -3424,7 +3418,6 @@ zfs_putpage_commit_cb(void *arg) * Timestamps: * ip - ctime|mtime updated */ -/* ARGSUSED */ int zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc) { @@ -3675,7 +3668,6 @@ zfs_dirty_inode(struct inode *ip, int flags) return (error); } -/*ARGSUSED*/ void zfs_inactive(struct inode *ip) { @@ -3779,7 +3771,6 @@ zfs_fillpage(struct inode *ip, struct page *pl[], int nr_pages) * Timestamps: * vp - atime updated */ -/* ARGSUSED */ int zfs_getpage(struct inode *ip, struct page *pl[], int nr_pages) { @@ -3811,11 +3802,11 @@ zfs_getpage(struct inode *ip, struct page *pl[], int nr_pages) * RETURN: 0 if success * error code if failure */ -/*ARGSUSED*/ int zfs_map(struct inode *ip, offset_t off, caddr_t *addrp, size_t len, unsigned long vm_flags) { + (void) addrp; znode_t *zp = ITOZ(ip); zfsvfs_t *zfsvfs = ITOZSB(ip); @@ -3861,11 +3852,11 @@ zfs_map(struct inode *ip, offset_t off, caddr_t *addrp, size_t len, * Timestamps: * zp - ctime|mtime updated */ -/* ARGSUSED */ int zfs_space(znode_t *zp, int cmd, flock64_t *bfp, int flag, offset_t offset, cred_t *cr) { + (void) offset; zfsvfs_t *zfsvfs = ZTOZSB(zp); uint64_t off, len; int error; @@ -3912,7 +3903,6 @@ zfs_space(znode_t *zp, int cmd, flock64_t *bfp, int flag, return (error); } -/*ARGSUSED*/ int zfs_fid(struct inode *ip, fid_t *fidp) { diff --git a/module/os/linux/zfs/zfs_znode.c b/module/os/linux/zfs/zfs_znode.c index ce8ae06d641f..459fd0348557 100644 --- a/module/os/linux/zfs/zfs_znode.c +++ b/module/os/linux/zfs/zfs_znode.c @@ -65,6 +65,8 @@ #include "zfs_prop.h" #include "zfs_comutil.h" +#pragma GCC diagnostic error "-Wunused-parameter" + /* * Functions needed for userland (ie: libzpool) are not put under * #ifdef_KERNEL; the rest of the functions have dependencies @@ -113,10 +115,11 @@ zfs_rangelock_cb(zfs_locked_range_t *new, void *arg) } } -/*ARGSUSED*/ static int zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) { + (void) arg; + (void) kmflags; znode_t *zp = buf; inode_init_once(ZTOI(zp)); @@ -137,10 +140,10 @@ zfs_znode_cache_constructor(void *buf, void *arg, int kmflags) return (0); } -/*ARGSUSED*/ static void zfs_znode_cache_destructor(void *buf, void *arg) { + (void) arg; znode_t *zp = buf; ASSERT(!list_link_active(&zp->z_link_node)); @@ -159,6 +162,8 @@ zfs_znode_cache_destructor(void *buf, void *arg) static int zfs_znode_hold_cache_constructor(void *buf, void *arg, int kmflags) { + (void) arg; + (void) kmflags; znode_hold_t *zh = buf; mutex_init(&zh->zh_lock, NULL, MUTEX_DEFAULT, NULL); @@ -171,6 +176,7 @@ zfs_znode_hold_cache_constructor(void *buf, void *arg, int kmflags) static void zfs_znode_hold_cache_destructor(void *buf, void *arg) { + (void) arg; znode_hold_t *zh = buf; mutex_destroy(&zh->zh_lock); @@ -364,6 +370,7 @@ zfs_znode_dmu_fini(znode_t *zp) int zfs_inode_alloc(struct super_block *sb, struct inode **ip) { + (void) sb; znode_t *zp; zp = kmem_cache_alloc(znode_cache, KM_SLEEP); @@ -1741,6 +1748,7 @@ zfs_trunc(znode_t *zp, uint64_t end) int zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log) { + (void) flag; dmu_tx_t *tx; zfsvfs_t *zfsvfs = ZTOZSB(zp); zilog_t *zilog = zfsvfs->z_log; diff --git a/module/os/linux/zfs/zio_crypt.c b/module/os/linux/zfs/zio_crypt.c index 94406999cb89..ef7bb22a7a12 100644 --- a/module/os/linux/zfs/zio_crypt.c +++ b/module/os/linux/zfs/zio_crypt.c @@ -190,7 +190,7 @@ unsigned long zfs_key_max_salt_uses = ZFS_KEY_MAX_SALT_USES_DEFAULT; typedef struct blkptr_auth_buf { uint64_t bab_prop; /* blk_prop - portable mask */ - uint8_t bab_mac[ZIO_DATA_MAC_LEN]; /* MAC from blk_cksum */ + uint8_t bab_mac[ZIO_DATA_MAC_LEN]; /* MAC from blk_cksum */ uint64_t bab_pad; /* reserved for future use */ } blkptr_auth_buf_t; @@ -1755,6 +1755,8 @@ zio_crypt_init_uios_normal(boolean_t encrypt, uint8_t *plainbuf, uint8_t *cipherbuf, uint_t datalen, zfs_uio_t *puio, zfs_uio_t *cuio, uint_t *enc_len) { + (void) encrypt; + int ret; uint_t nr_plain = 1, nr_cipher = 2; iovec_t *plain_iovecs = NULL, *cipher_iovecs = NULL; diff --git a/module/os/linux/zfs/zpl_ctldir.c b/module/os/linux/zfs/zpl_ctldir.c index 9b526afd0002..19372e82590a 100644 --- a/module/os/linux/zfs/zpl_ctldir.c +++ b/module/os/linux/zfs/zpl_ctldir.c @@ -33,10 +33,11 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * Common open routine. Disallow any write access. */ -/* ARGSUSED */ static int zpl_common_open(struct inode *ip, struct file *filp) { @@ -99,7 +100,6 @@ zpl_root_readdir(struct file *filp, void *dirent, filldir_t filldir) /* * Get root directory attributes. */ -/* ARGSUSED */ static int #ifdef HAVE_USERNS_IOPS_GETATTR zpl_root_getattr_impl(struct user_namespace *user_ns, @@ -110,6 +110,8 @@ zpl_root_getattr_impl(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int query_flags) #endif { + (void) request_mask; + (void) query_flags; struct inode *ip = path->dentry->d_inode; #if defined(HAVE_GENERIC_FILLATTR_USERNS) && defined(HAVE_USERNS_IOPS_GETATTR) @@ -126,6 +128,7 @@ ZPL_GETATTR_WRAPPER(zpl_root_getattr); static struct dentry * zpl_root_lookup(struct inode *dip, struct dentry *dentry, unsigned int flags) { + (void) flags; cred_t *cr = CRED(); struct inode *ip; int error; @@ -193,11 +196,12 @@ zpl_snapdir_automount(struct path *path) */ static int #ifdef HAVE_D_REVALIDATE_NAMEIDATA -zpl_snapdir_revalidate(struct dentry *dentry, struct nameidata *i) +zpl_snapdir_revalidate(struct dentry *dentry, struct nameidata *i_fl) #else -zpl_snapdir_revalidate(struct dentry *dentry, unsigned int flags) +zpl_snapdir_revalidate(struct dentry *dentry, unsigned int i_fl) #endif { + (void) i_fl; return (!!dentry->d_inode); } @@ -218,6 +222,7 @@ static struct dentry * zpl_snapdir_lookup(struct inode *dip, struct dentry *dentry, unsigned int flags) { + (void) flags; fstrans_cookie_t cookie; cred_t *cr = CRED(); struct inode *ip = NULL; @@ -382,7 +387,6 @@ zpl_snapdir_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode) /* * Get snapshot directory attributes. */ -/* ARGSUSED */ static int #ifdef HAVE_USERNS_IOPS_GETATTR zpl_snapdir_getattr_impl(struct user_namespace *user_ns, @@ -393,6 +397,8 @@ zpl_snapdir_getattr_impl(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int query_flags) #endif { + (void) request_mask; + (void) query_flags; struct inode *ip = path->dentry->d_inode; zfsvfs_t *zfsvfs = ITOZSB(ip); @@ -452,6 +458,7 @@ static struct dentry * zpl_shares_lookup(struct inode *dip, struct dentry *dentry, unsigned int flags) { + (void) flags; fstrans_cookie_t cookie; cred_t *cr = CRED(); struct inode *ip = NULL; @@ -524,7 +531,6 @@ zpl_shares_readdir(struct file *filp, void *dirent, filldir_t filldir) } #endif /* !HAVE_VFS_ITERATE && !HAVE_VFS_ITERATE_SHARED */ -/* ARGSUSED */ static int #ifdef HAVE_USERNS_IOPS_GETATTR zpl_shares_getattr_impl(struct user_namespace *user_ns, @@ -535,6 +541,8 @@ zpl_shares_getattr_impl(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int query_flags) #endif { + (void) request_mask; + (void) query_flags; struct inode *ip = path->dentry->d_inode; zfsvfs_t *zfsvfs = ITOZSB(ip); znode_t *dzp; diff --git a/module/zcommon/zfeature_common.c b/module/zcommon/zfeature_common.c index fc0e09605eef..14b971438f9d 100644 --- a/module/zcommon/zfeature_common.c +++ b/module/zcommon/zfeature_common.c @@ -233,6 +233,7 @@ zfs_mod_supported_feature(const char *name) else return (B_TRUE); #elif defined(_KERNEL) || defined(LIB_ZPOOL_BUILD) + (void) name; return (B_TRUE); #else return (zfs_mod_supported(ZFS_SYSFS_POOL_FEATURES, name)); diff --git a/module/zcommon/zfs_fletcher.c b/module/zcommon/zfs_fletcher.c index 7a9de4a4309d..99f3c6b8aff0 100644 --- a/module/zcommon/zfs_fletcher.c +++ b/module/zcommon/zfs_fletcher.c @@ -226,7 +226,6 @@ static struct fletcher_4_kstat { /* Indicate that benchmark has been completed */ static boolean_t fletcher_4_initialized = B_FALSE; -/*ARGSUSED*/ void fletcher_init(zio_cksum_t *zcp) { @@ -258,11 +257,11 @@ fletcher_2_incremental_native(void *buf, size_t size, void *data) return (0); } -/*ARGSUSED*/ void fletcher_2_native(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; fletcher_init(zcp); (void) fletcher_2_incremental_native((void *) buf, size, zcp); } @@ -292,11 +291,11 @@ fletcher_2_incremental_byteswap(void *buf, size_t size, void *data) return (0); } -/*ARGSUSED*/ void fletcher_2_byteswap(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; fletcher_init(zcp); (void) fletcher_2_incremental_byteswap((void *) buf, size, zcp); } @@ -460,11 +459,12 @@ fletcher_4_native_impl(const void *buf, uint64_t size, zio_cksum_t *zcp) ops->fini_native(&ctx, zcp); } -/*ARGSUSED*/ void fletcher_4_native(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; + const uint64_t p2size = P2ALIGN(size, FLETCHER_MIN_SIMD_SIZE); ASSERT(IS_P2ALIGNED(size, sizeof (uint32_t))); @@ -502,11 +502,12 @@ fletcher_4_byteswap_impl(const void *buf, uint64_t size, zio_cksum_t *zcp) ops->fini_byteswap(&ctx, zcp); } -/*ARGSUSED*/ void fletcher_4_byteswap(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; + const uint64_t p2size = P2ALIGN(size, FLETCHER_MIN_SIMD_SIZE); ASSERT(IS_P2ALIGNED(size, sizeof (uint32_t))); @@ -894,6 +895,7 @@ zio_abd_checksum_func_t fletcher_4_abd_ops = { static int fletcher_4_param_get(char *buffer, zfs_kernel_param_t *unused) { + (void) unused; const uint32_t impl = IMPL_READ(fletcher_4_impl_chosen); char *fmt; int cnt = 0; @@ -915,6 +917,7 @@ fletcher_4_param_get(char *buffer, zfs_kernel_param_t *unused) static int fletcher_4_param_set(const char *val, zfs_kernel_param_t *unused) { + (void) unused; return (fletcher_4_impl_set(val)); } diff --git a/module/zcommon/zprop_common.c b/module/zcommon/zprop_common.c index faab9d9a74fd..213efe56631b 100644 --- a/module/zcommon/zprop_common.c +++ b/module/zcommon/zprop_common.c @@ -78,6 +78,8 @@ zfs_mod_supported_prop(const char *name, zfs_type_t type) * tree, but this has not been done yet. */ #if defined(_KERNEL) || defined(LIB_ZPOOL_BUILD) || defined(__FreeBSD__) + (void) name; + (void) type; return (B_TRUE); #else return (zfs_mod_supported(type == ZFS_TYPE_POOL ? diff --git a/module/zfs/abd.c b/module/zfs/abd.c index 2d1be9752d4f..ec59858b4942 100644 --- a/module/zfs/abd.c +++ b/module/zfs/abd.c @@ -110,10 +110,10 @@ abd_verify(abd_t *abd) { ASSERT3U(abd->abd_size, >, 0); ASSERT3U(abd->abd_size, <=, SPA_MAXBLOCKSIZE); - ASSERT3U(abd->abd_flags, ==, abd->abd_flags & (ABD_FLAG_LINEAR | + ASSERT3U(abd->abd_flags, ==, (abd->abd_flags & (ABD_FLAG_LINEAR | ABD_FLAG_OWNER | ABD_FLAG_META | ABD_FLAG_MULTI_ZONE | ABD_FLAG_MULTI_CHUNK | ABD_FLAG_LINEAR_PAGE | ABD_FLAG_GANG | - ABD_FLAG_GANG_FREE | ABD_FLAG_ZEROS | ABD_FLAG_ALLOCD)); + ABD_FLAG_GANG_FREE | ABD_FLAG_ZEROS | ABD_FLAG_ALLOCD))); #ifdef ZFS_DEBUG IMPLY(abd->abd_parent != NULL, !(abd->abd_flags & ABD_FLAG_OWNER)); #endif @@ -889,10 +889,10 @@ abd_copy_from_buf_off(abd_t *abd, const void *buf, size_t off, size_t size) &ba_ptr); } -/*ARGSUSED*/ static int abd_zero_off_cb(void *buf, size_t size, void *private) { + (void) private; (void) memset(buf, 0, size); return (0); } @@ -967,10 +967,10 @@ abd_iterate_func2(abd_t *dabd, abd_t *sabd, size_t doff, size_t soff, return (ret); } -/*ARGSUSED*/ static int abd_copy_off_cb(void *dbuf, void *sbuf, size_t size, void *private) { + (void) private; (void) memcpy(dbuf, sbuf, size); return (0); } @@ -985,10 +985,10 @@ abd_copy_off(abd_t *dabd, abd_t *sabd, size_t doff, size_t soff, size_t size) abd_copy_off_cb, NULL); } -/*ARGSUSED*/ static int abd_cmp_cb(void *bufa, void *bufb, size_t size, void *private) { + (void) private; return (memcmp(bufa, bufb, size)); } @@ -1021,7 +1021,7 @@ abd_raidz_gen_iterate(abd_t **cabds, abd_t *dabd, struct abd_iter caiters[3]; struct abd_iter daiter = {0}; void *caddrs[3]; - unsigned long flags __maybe_unused = 0; + unsigned long flags = 0; abd_t *c_cabds[3]; abd_t *c_dabd = NULL; boolean_t cabds_is_gang_abd[3]; @@ -1139,7 +1139,7 @@ abd_raidz_rec_iterate(abd_t **cabds, abd_t **tabds, struct abd_iter citers[3]; struct abd_iter xiters[3]; void *caddrs[3], *xaddrs[3]; - unsigned long flags __maybe_unused = 0; + unsigned long flags = 0; boolean_t cabds_is_gang_abd[3]; boolean_t tabds_is_gang_abd[3]; abd_t *c_cabds[3]; diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 75217e4e182e..bee4d05607ee 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -311,6 +311,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + #ifndef _KERNEL /* set with ZFS_DEBUG=watch, to enable watchpoints on frozen buffers */ boolean_t arc_watch = B_FALSE; @@ -1134,7 +1136,7 @@ buf_fini(void) #if defined(_KERNEL) /* * Large allocations which do not require contiguous pages - * should be using vmem_free() in the linux kernel\ + * should be using vmem_free() in the linux kernel */ vmem_free(buf_hash_table.ht_table, (buf_hash_table.ht_mask + 1) * sizeof (void *)); @@ -1154,10 +1156,12 @@ buf_fini(void) * Constructor callback - called when the cache is empty * and a new buf is requested. */ -/* ARGSUSED */ static int hdr_full_cons(void *vbuf, void *unused, int kmflag) { + (void) unused; + (void) kmflag; + arc_buf_hdr_t *hdr = vbuf; bzero(hdr, HDR_FULL_SIZE); @@ -1173,10 +1177,11 @@ hdr_full_cons(void *vbuf, void *unused, int kmflag) return (0); } -/* ARGSUSED */ static int hdr_full_crypt_cons(void *vbuf, void *unused, int kmflag) { + (void) unused; + arc_buf_hdr_t *hdr = vbuf; hdr_full_cons(vbuf, unused, kmflag); @@ -1186,10 +1191,11 @@ hdr_full_crypt_cons(void *vbuf, void *unused, int kmflag) return (0); } -/* ARGSUSED */ static int hdr_l2only_cons(void *vbuf, void *unused, int kmflag) { + (void) unused; + (void) kmflag; arc_buf_hdr_t *hdr = vbuf; bzero(hdr, HDR_L2ONLY_SIZE); @@ -1198,10 +1204,11 @@ hdr_l2only_cons(void *vbuf, void *unused, int kmflag) return (0); } -/* ARGSUSED */ static int buf_cons(void *vbuf, void *unused, int kmflag) { + (void) unused; + (void) kmflag; arc_buf_t *buf = vbuf; bzero(buf, sizeof (arc_buf_t)); @@ -1215,10 +1222,10 @@ buf_cons(void *vbuf, void *unused, int kmflag) * Destructor callback - called when a cached buf is * no longer required. */ -/* ARGSUSED */ static void hdr_full_dest(void *vbuf, void *unused) { + (void) unused; arc_buf_hdr_t *hdr = vbuf; ASSERT(HDR_EMPTY(hdr)); @@ -1229,30 +1236,30 @@ hdr_full_dest(void *vbuf, void *unused) arc_space_return(HDR_FULL_SIZE, ARC_SPACE_HDRS); } -/* ARGSUSED */ static void hdr_full_crypt_dest(void *vbuf, void *unused) { + (void) unused; arc_buf_hdr_t *hdr = vbuf; hdr_full_dest(vbuf, unused); arc_space_return(sizeof (hdr->b_crypt_hdr), ARC_SPACE_HDRS); } -/* ARGSUSED */ static void hdr_l2only_dest(void *vbuf, void *unused) { - arc_buf_hdr_t *hdr __maybe_unused = vbuf; + (void) unused; + arc_buf_hdr_t *hdr = vbuf; ASSERT(HDR_EMPTY(hdr)); arc_space_return(HDR_L2ONLY_SIZE, ARC_SPACE_L2HDRS); } -/* ARGSUSED */ static void buf_dest(void *vbuf, void *unused) { + (void) unused; arc_buf_t *buf = vbuf; mutex_destroy(&buf->b_evict_lock); @@ -1550,11 +1557,13 @@ arc_cksum_compute(arc_buf_t *buf) void arc_buf_sigsegv(int sig, siginfo_t *si, void *unused) { - panic("Got SIGSEGV at address: 0x%lx\n", (long)si->si_addr); + (void) sig; + (void) unused; + panic("Got SIGSEGV at address: 0x%llx\n", + (u_longlong_t)(uintptr_t)si->si_addr); } #endif -/* ARGSUSED */ static void arc_buf_unwatch(arc_buf_t *buf) { @@ -1563,10 +1572,11 @@ arc_buf_unwatch(arc_buf_t *buf) ASSERT0(mprotect(buf->b_data, arc_buf_size(buf), PROT_READ | PROT_WRITE)); } +#else + (void) buf; #endif } -/* ARGSUSED */ static void arc_buf_watch(arc_buf_t *buf) { @@ -1574,6 +1584,8 @@ arc_buf_watch(arc_buf_t *buf) if (arc_watch) ASSERT0(mprotect(buf->b_data, arc_buf_size(buf), PROT_READ)); +#else + (void) buf; #endif } @@ -1986,6 +1998,8 @@ arc_fill_hdr_crypt(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, spa_t *spa, static void arc_buf_untransform_in_place(arc_buf_t *buf, kmutex_t *hash_lock) { + (void) hash_lock; + arc_buf_hdr_t *hdr = buf->b_hdr; ASSERT(HDR_ENCRYPTED(hdr)); @@ -2368,14 +2382,10 @@ remove_reference(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, void *tag) } /* - * Returns detailed information about a specific arc buffer. When the - * state_index argument is set the function will calculate the arc header - * list position for its arc state. Since this requires a linear traversal - * callers are strongly encourage not to do this. However, it can be helpful - * for targeted analysis so the functionality is provided. + * Returns detailed information about a specific arc buffer. */ void -arc_buf_info(arc_buf_t *ab, arc_buf_info_t *abi, int state_index) +arc_buf_info(arc_buf_t *ab, arc_buf_info_t *abi) { arc_buf_hdr_t *hdr = ab->b_hdr; l1arc_buf_hdr_t *l1hdr = NULL; @@ -4873,10 +4883,12 @@ arc_kmem_reap_soon(void) abd_cache_reap_now(); } -/* ARGSUSED */ static boolean_t arc_evict_cb_check(void *arg, zthr_t *zthr) { + (void) arg; + (void) zthr; + #ifdef ZFS_DEBUG /* * This is necessary in order to keep the kstat information @@ -4916,10 +4928,12 @@ arc_evict_cb_check(void *arg, zthr_t *zthr) * Keep arc_size under arc_c by running arc_evict which evicts data * from the ARC. */ -/* ARGSUSED */ static void arc_evict_cb(void *arg, zthr_t *zthr) { + (void) arg; + (void) zthr; + uint64_t evicted = 0; fstrans_cookie_t cookie = spl_fstrans_mark(); @@ -4956,10 +4970,12 @@ arc_evict_cb(void *arg, zthr_t *zthr) spl_fstrans_unmark(cookie); } -/* ARGSUSED */ static boolean_t arc_reap_cb_check(void *arg, zthr_t *zthr) { + (void) arg; + (void) zthr; + int64_t free_memory = arc_available_memory(); static int reap_cb_check_counter = 0; @@ -5003,10 +5019,12 @@ arc_reap_cb_check(void *arg, zthr_t *zthr) * target size of the cache (arc_c), causing the arc_evict_cb() * to free more buffers. */ -/* ARGSUSED */ static void arc_reap_cb(void *arg, zthr_t *zthr) { + (void) arg; + (void) zthr; + int64_t free_memory; fstrans_cookie_t cookie = spl_fstrans_mark(); @@ -5090,7 +5108,6 @@ arc_reap_cb(void *arg, zthr_t *zthr) * already below arc_c_min, evicting any more would only * increase this negative difference. */ - #endif /* _KERNEL */ /* @@ -5608,11 +5625,14 @@ arc_buf_access(arc_buf_t *buf) } /* a generic arc_read_done_func_t which you can use */ -/* ARGSUSED */ void arc_bcopy_func(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, arc_buf_t *buf, void *arg) { + (void) zio; + (void) zb; + (void) bp; + if (buf == NULL) return; @@ -5621,11 +5641,13 @@ arc_bcopy_func(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, } /* a generic arc_read_done_func_t */ -/* ARGSUSED */ void arc_getbuf_func(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, arc_buf_t *buf, void *arg) { + (void) zb; + (void) bp; + arc_buf_t **bufp = arg; if (buf == NULL) { @@ -7218,8 +7240,11 @@ arc_tempreserve_space(spa_t *spa, uint64_t reserve, uint64_t txg) zfs_refcount_count(&arc_anon->arcs_esize[ARC_BUFC_DATA]); dprintf("failing, arc_tempreserve=%lluK anon_meta=%lluK " "anon_data=%lluK tempreserve=%lluK rarc_c=%lluK\n", - arc_tempreserve >> 10, meta_esize >> 10, - data_esize >> 10, reserve >> 10, rarc_c >> 10); + (u_longlong_t)arc_tempreserve >> 10, + (u_longlong_t)meta_esize >> 10, + (u_longlong_t)data_esize >> 10, + (u_longlong_t)reserve >> 10, + (u_longlong_t)rarc_c >> 10); #endif DMU_TX_STAT_BUMP(dmu_tx_dirty_throttle); return (SET_ERROR(ERESTART)); @@ -8064,8 +8089,8 @@ l2arc_write_size(l2arc_dev_t *dev) "plus the overhead of log blocks (persistent L2ARC, " "%llu bytes) exceeds the size of the cache device " "(guid %llu), resetting them to the default (%d)", - l2arc_log_blk_overhead(size, dev), - dev->l2ad_vdev->vdev_guid, L2ARC_WRITE_SIZE); + (u_longlong_t)l2arc_log_blk_overhead(size, dev), + (u_longlong_t)dev->l2ad_vdev->vdev_guid, L2ARC_WRITE_SIZE); size = l2arc_write_max = l2arc_write_boost = L2ARC_WRITE_SIZE; if (arc_warm == B_FALSE) @@ -9336,10 +9361,11 @@ l2arc_hdr_limit_reached(void) * This thread feeds the L2ARC at regular intervals. This is the beating * heart of the L2ARC. */ -/* ARGSUSED */ static void l2arc_feed_thread(void *unused) { + (void) unused; + callb_cpr_t cpr; l2arc_dev_t *dev; spa_t *spa; @@ -9975,7 +10001,7 @@ l2arc_rebuild(l2arc_dev_t *dev) * log as the pool may be in the process of being removed. */ zfs_dbgmsg("L2ARC rebuild aborted, restored %llu blocks", - zfs_refcount_count(&dev->l2ad_lb_count)); + (u_longlong_t)zfs_refcount_count(&dev->l2ad_lb_count)); } else if (err != 0) { spa_history_log_internal(spa, "L2ARC rebuild", NULL, "aborted, restored %llu blocks", @@ -10018,7 +10044,8 @@ l2arc_dev_hdr_read(l2arc_dev_t *dev) if (err != 0) { ARCSTAT_BUMP(arcstat_l2_rebuild_abort_dh_errors); zfs_dbgmsg("L2ARC IO error (%d) while reading device header, " - "vdev guid: %llu", err, dev->l2ad_vdev->vdev_guid); + "vdev guid: %llu", + err, (u_longlong_t)dev->l2ad_vdev->vdev_guid); return (err); } @@ -10115,8 +10142,10 @@ l2arc_log_blk_read(l2arc_dev_t *dev, if ((err = zio_wait(this_io)) != 0) { ARCSTAT_BUMP(arcstat_l2_rebuild_abort_io_errors); zfs_dbgmsg("L2ARC IO error (%d) while reading log block, " - "offset: %llu, vdev guid: %llu", err, this_lbp->lbp_daddr, - dev->l2ad_vdev->vdev_guid); + "offset: %llu, vdev guid: %llu", + err, + (u_longlong_t)this_lbp->lbp_daddr, + (u_longlong_t)dev->l2ad_vdev->vdev_guid); goto cleanup; } @@ -10130,8 +10159,10 @@ l2arc_log_blk_read(l2arc_dev_t *dev, ARCSTAT_BUMP(arcstat_l2_rebuild_abort_cksum_lb_errors); zfs_dbgmsg("L2ARC log block cksum failed, offset: %llu, " "vdev guid: %llu, l2ad_hand: %llu, l2ad_evict: %llu", - this_lbp->lbp_daddr, dev->l2ad_vdev->vdev_guid, - dev->l2ad_hand, dev->l2ad_evict); + (u_longlong_t)this_lbp->lbp_daddr, + (u_longlong_t)dev->l2ad_vdev->vdev_guid, + (u_longlong_t)dev->l2ad_hand, + (u_longlong_t)dev->l2ad_evict); err = SET_ERROR(ECKSUM); goto cleanup; } @@ -10385,7 +10416,8 @@ l2arc_dev_hdr_update(l2arc_dev_t *dev) if (err != 0) { zfs_dbgmsg("L2ARC IO error (%d) while writing device header, " - "vdev guid: %llu", err, dev->l2ad_vdev->vdev_guid); + "vdev guid: %llu", + err, (u_longlong_t)dev->l2ad_vdev->vdev_guid); } } diff --git a/module/zfs/blkptr.c b/module/zfs/blkptr.c index aa09ded8dba3..bd058d017516 100644 --- a/module/zfs/blkptr.c +++ b/module/zfs/blkptr.c @@ -73,7 +73,7 @@ encode_embedded_bp_compressed(blkptr_t *bp, void *data, BF64_SET(w, (i % sizeof (w)) * NBBY, NBBY, data8[i]); if (i % sizeof (w) == sizeof (w) - 1) { /* we've reached the end of a word */ - ASSERT3P(bp64, <, bp + 1); + ASSERT3P(bp64, <, (uint64_t *)(bp + 1)); *bp64 = w; bp64++; if (!BPE_IS_PAYLOADWORD(bp, bp64)) @@ -109,7 +109,7 @@ decode_embedded_bp_compressed(const blkptr_t *bp, void *buf) for (int i = 0; i < psize; i++) { if (i % sizeof (w) == 0) { /* beginning of a word */ - ASSERT3P(bp64, <, bp + 1); + ASSERT3P(bp64, <, (const uint64_t *)(bp + 1)); w = *bp64; bp64++; if (!BPE_IS_PAYLOADWORD(bp, bp64)) diff --git a/module/zfs/bpobj.c b/module/zfs/bpobj.c index e75ba5cccde6..ebf649cc20c3 100644 --- a/module/zfs/bpobj.c +++ b/module/zfs/bpobj.c @@ -860,10 +860,12 @@ struct space_range_arg { uint64_t uncomp; }; -/* ARGSUSED */ static int space_range_cb(void *arg, const blkptr_t *bp, boolean_t bp_freed, dmu_tx_t *tx) { + (void) bp_freed; + (void) tx; + struct space_range_arg *sra = arg; if (bp->blk_birth > sra->mintxg && bp->blk_birth <= sra->maxtxg) { @@ -932,11 +934,13 @@ bpobj_space_range(bpobj_t *bpo, uint64_t mintxg, uint64_t maxtxg, * bpobj are designated as free or allocated that information is not preserved * in bplists. */ -/* ARGSUSED */ int bplist_append_cb(void *arg, const blkptr_t *bp, boolean_t bp_freed, dmu_tx_t *tx) { + (void) bp_freed; + (void) tx; + bplist_t *bpl = arg; bplist_append(bpl, bp); return (0); diff --git a/module/zfs/bptree.c b/module/zfs/bptree.c index 1827a3c4e326..1ab9d21a0fa7 100644 --- a/module/zfs/bptree.c +++ b/module/zfs/bptree.c @@ -147,11 +147,13 @@ bptree_add(objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg, dmu_buf_rele(db, FTAG); } -/* ARGSUSED */ static int bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { + (void) zilog; + (void) dnp; + int err; struct bptree_args *ba = arg; diff --git a/module/zfs/btree.c b/module/zfs/btree.c index 57b9dbbb2b50..84e6e71d98d9 100644 --- a/module/zfs/btree.c +++ b/module/zfs/btree.c @@ -507,7 +507,7 @@ zfs_btree_insert_core_impl(zfs_btree_t *tree, zfs_btree_core_t *parent, { uint64_t size = tree->bt_elem_size; zfs_btree_hdr_t *par_hdr = &parent->btc_hdr; - ASSERT3P(par_hdr, ==, new_node->bth_parent); + ASSERT3P(par_hdr, ==, (zfs_btree_hdr_t *)new_node->bth_parent); ASSERT3U(par_hdr->bth_count, <, BTREE_CORE_ELEMS); if (zfs_btree_verify_intensity >= 5) { @@ -1328,7 +1328,7 @@ zfs_btree_remove_from_node(zfs_btree_t *tree, zfs_btree_core_t *node, */ if (hdr->bth_parent == NULL && hdr->bth_count <= 1) { ASSERT3U(hdr->bth_count, ==, 1); - ASSERT3P(tree->bt_root, ==, node); + ASSERT3P(tree->bt_root, ==, (zfs_btree_hdr_t *)node); ASSERT3P(node->btc_children[1], ==, rm_hdr); tree->bt_root = node->btc_children[0]; node->btc_children[0]->bth_parent = NULL; diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index 764383b2d039..a684d73660b3 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -264,10 +264,12 @@ static unsigned long dbuf_metadata_cache_target_bytes(void); uint_t dbuf_cache_hiwater_pct = 10; uint_t dbuf_cache_lowater_pct = 10; -/* ARGSUSED */ static int dbuf_cons(void *vdb, void *unused, int kmflag) { + (void) unused; + (void) kmflag; + dmu_buf_impl_t *db = vdb; bzero(db, sizeof (dmu_buf_impl_t)); @@ -280,10 +282,11 @@ dbuf_cons(void *vdb, void *unused, int kmflag) return (0); } -/* ARGSUSED */ static void dbuf_dest(void *vdb, void *unused) { + (void) unused; + dmu_buf_impl_t *db = vdb; mutex_destroy(&db->db_mtx); rw_destroy(&db->db_rwlock); @@ -706,10 +709,10 @@ 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) { + (void) unused; callb_cpr_t cpr; CALLB_CPR_INIT(&cpr, &dbuf_evict_lock, callb_generic_cpr, FTAG); @@ -1249,6 +1252,9 @@ static void dbuf_read_done(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, arc_buf_t *buf, void *vdb) { + (void) zb; + (void) bp; + dmu_buf_impl_t *db = vdb; mutex_enter(&db->db_mtx); @@ -1344,6 +1350,8 @@ dbuf_handle_indirect_hole(dmu_buf_impl_t *db, dnode_t *dn) static int dbuf_read_hole(dmu_buf_impl_t *db, dnode_t *dn, uint32_t flags) { + (void) flags; + ASSERT(MUTEX_HELD(&db->db_mtx)); int is_hole = db->db_blkptr == NULL || BP_IS_HOLE(db->db_blkptr); @@ -1796,7 +1804,8 @@ dbuf_free_range(dnode_t *dn, uint64_t start_blkid, uint64_t end_blkid, if (end_blkid > dn->dn_maxblkid && !(start_blkid == DMU_SPILL_BLKID || end_blkid == DMU_SPILL_BLKID)) end_blkid = dn->dn_maxblkid; - dprintf_dnode(dn, "start=%llu end=%llu\n", start_blkid, end_blkid); + dprintf_dnode(dn, "start=%llu end=%llu\n", + (u_longlong_t)start_blkid, (u_longlong_t)end_blkid); db_search = kmem_alloc(sizeof (dmu_buf_impl_t), KM_SLEEP); db_search->db_level = 0; @@ -2561,10 +2570,11 @@ dbuf_override_impl(dmu_buf_impl_t *db, const blkptr_t *bp, dmu_tx_t *tx) dl->dr_overridden_by.blk_birth = dr->dr_txg; } -/* ARGSUSED */ void dmu_buf_fill_done(dmu_buf_t *dbuf, dmu_tx_t *tx) { + (void) tx; + dmu_buf_impl_t *db = (dmu_buf_impl_t *)dbuf; dbuf_states_t old_state; mutex_enter(&db->db_mtx); @@ -3081,8 +3091,11 @@ static void dbuf_issue_final_prefetch_done(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *iobp, arc_buf_t *abuf, void *private) { - dbuf_prefetch_arg_t *dpa = private; + (void) zio; + (void) zb; + (void) iobp; + dbuf_prefetch_arg_t *dpa = private; dbuf_prefetch_fini(dpa, B_TRUE); if (abuf != NULL) arc_buf_destroy(abuf, private); @@ -3129,6 +3142,9 @@ static void dbuf_prefetch_indirect_done(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *iobp, arc_buf_t *abuf, void *private) { + (void) zb; + (void) iobp; + dbuf_prefetch_arg_t *dpa = private; ASSERT3S(dpa->dpa_zb.zb_level, <, dpa->dpa_curlevel); @@ -3375,6 +3391,8 @@ dbuf_prefetch(dnode_t *dn, int64_t level, uint64_t blkid, zio_priority_t prio, noinline static void dbuf_hold_copy(dnode_t *dn, dmu_buf_impl_t *db) { + (void) dn; + dbuf_dirty_record_t *dr = db->db_data_pending; arc_buf_t *newdata, *data = dr->dt.dl.dr_data; @@ -4352,10 +4370,11 @@ dbuf_sync_list(list_t *list, int level, dmu_tx_t *tx) } } -/* ARGSUSED */ static void dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb) { + (void) buf; + dmu_buf_impl_t *db = vdb; dnode_t *dn; blkptr_t *bp = zio->io_bp; @@ -4443,7 +4462,6 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb) dmu_buf_unlock_parent(db, dblt, FTAG); } -/* ARGSUSED */ /* * This function gets called just prior to running through the compression * stage of the zio pipeline. If we're an indirect block comprised of only @@ -4454,6 +4472,9 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb) static void dbuf_write_children_ready(zio_t *zio, arc_buf_t *buf, void *vdb) { + (void) zio; + (void) buf; + dmu_buf_impl_t *db = vdb; dnode_t *dn; blkptr_t *bp; @@ -4497,10 +4518,11 @@ dbuf_write_children_ready(zio_t *zio, arc_buf_t *buf, void *vdb) * so this callback allows us to retire dirty space gradually, as the physical * i/os complete. */ -/* ARGSUSED */ static void dbuf_write_physdone(zio_t *zio, arc_buf_t *buf, void *arg) { + (void) buf; + dmu_buf_impl_t *db = arg; objset_t *os = db->db_objset; dsl_pool_t *dp = dmu_objset_pool(os); @@ -4519,10 +4541,11 @@ dbuf_write_physdone(zio_t *zio, arc_buf_t *buf, void *arg) dsl_pool_undirty_space(dp, delta, zio->io_txg); } -/* ARGSUSED */ static void dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb) { + (void) buf; + dmu_buf_impl_t *db = vdb; blkptr_t *bp_orig = &zio->io_bp_orig; blkptr_t *bp = db->db_blkptr; diff --git a/module/zfs/dbuf_stats.c b/module/zfs/dbuf_stats.c index 12bb568a08cc..f936ed09ccee 100644 --- a/module/zfs/dbuf_stats.c +++ b/module/zfs/dbuf_stats.c @@ -23,11 +23,6 @@ #include #include -/* - * Calculate the index of the arc header for the state, disabled by default. - */ -int zfs_dbuf_state_index = 0; - /* * ========================================================================== * Dbuf Hash Read Routines @@ -70,7 +65,7 @@ __dbuf_stats_hash_table_data(char *buf, size_t size, dmu_buf_impl_t *db) size_t nwritten; if (db->db_buf) - arc_buf_info(db->db_buf, &abi, zfs_dbuf_state_index); + arc_buf_info(db->db_buf, &abi); __dmu_object_info_from_dnode(dn, &doi); @@ -225,8 +220,3 @@ dbuf_stats_destroy(void) { dbuf_stats_hash_table_destroy(); } - -/* BEGIN CSTYLED */ -ZFS_MODULE_PARAM(zfs, zfs_, dbuf_state_index, INT, ZMOD_RW, - "Calculate arc header index"); -/* END CSTYLED */ diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 1c47430953b1..98e1d81aef1d 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -812,13 +812,14 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum, uint64_t *l1blks) * otherwise return false. * Used below in dmu_free_long_range_impl() to enable abort when unmounting */ -/*ARGSUSED*/ static boolean_t dmu_objset_zfs_unmounting(objset_t *os) { #ifdef _KERNEL if (dmu_objset_type(os) == DMU_OST_ZFS) return (zfs_get_vfs_flag_unmounted(os)); +#else + (void) os; #endif return (B_FALSE); } @@ -1502,10 +1503,11 @@ typedef struct { dmu_tx_t *dsa_tx; } dmu_sync_arg_t; -/* ARGSUSED */ static void dmu_sync_ready(zio_t *zio, arc_buf_t *buf, void *varg) { + (void) buf; + dmu_sync_arg_t *dsa = varg; dmu_buf_t *db = dsa->dsa_zgd->zgd_db; blkptr_t *bp = zio->io_bp; @@ -1530,10 +1532,11 @@ dmu_sync_late_arrival_ready(zio_t *zio) dmu_sync_ready(zio, NULL, zio->io_private); } -/* ARGSUSED */ static void dmu_sync_done(zio_t *zio, arc_buf_t *buf, void *varg) { + (void) buf; + dmu_sync_arg_t *dsa = varg; dbuf_dirty_record_t *dr = dsa->dsa_dr; dmu_buf_impl_t *db = dr->dr_dbuf; @@ -2275,10 +2278,11 @@ byteswap_uint16_array(void *vbuf, size_t size) buf[i] = BSWAP_16(buf[i]); } -/* ARGSUSED */ void byteswap_uint8_array(void *vbuf, size_t size) { + (void) vbuf; + (void) size; } void diff --git a/module/zfs/dmu_diff.c b/module/zfs/dmu_diff.c index a573a2e1bd41..1bbbe5e03cda 100644 --- a/module/zfs/dmu_diff.c +++ b/module/zfs/dmu_diff.c @@ -108,11 +108,12 @@ report_dnode(dmu_diffarg_t *da, uint64_t object, dnode_phys_t *dnp) (((uint64_t)dnp->dn_datablkszsec) << (SPA_MINBLOCKSHIFT + \ (level) * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT))) -/* ARGSUSED */ static int diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { + (void) zilog; + dmu_diffarg_t *da = arg; int err = 0; diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c index bfb4adf262d5..fb54fc4411c3 100644 --- a/module/zfs/dmu_objset.c +++ b/module/zfs/dmu_objset.c @@ -64,6 +64,8 @@ #include #include "zfs_namecheck.h" +#pragma GCC diagnostic error "-Wunused-parameter" + /* * Needed to close a window in dnode_move() that allows the objset to be freed * before it can be safely accessed. @@ -713,6 +715,8 @@ static int dmu_objset_own_impl(dsl_dataset_t *ds, dmu_objset_type_t type, boolean_t readonly, boolean_t decrypt, void *tag, objset_t **osp) { + (void) tag; + int err; err = dmu_objset_from_ds(ds, osp); @@ -1120,7 +1124,6 @@ typedef struct dmu_objset_create_arg { dsl_crypto_params_t *doca_dcp; } dmu_objset_create_arg_t; -/*ARGSUSED*/ static int dmu_objset_create_check(void *arg, dmu_tx_t *tx) { @@ -1316,7 +1319,6 @@ typedef struct dmu_objset_clone_arg { proc_t *doca_proc; } dmu_objset_clone_arg_t; -/*ARGSUSED*/ static int dmu_objset_clone_check(void *arg, dmu_tx_t *tx) { @@ -1528,10 +1530,11 @@ dmu_objset_sync_dnodes(multilist_sublist_t *list, dmu_tx_t *tx) } } -/* ARGSUSED */ static void dmu_objset_write_ready(zio_t *zio, arc_buf_t *abuf, void *arg) { + (void) abuf; + blkptr_t *bp = zio->io_bp; objset_t *os = arg; dnode_phys_t *dnp = &os->os_phys->os_meta_dnode; @@ -1559,10 +1562,11 @@ dmu_objset_write_ready(zio_t *zio, arc_buf_t *abuf, void *arg) rrw_exit(&os->os_dsl_dataset->ds_bp_rwlock, FTAG); } -/* ARGSUSED */ static void dmu_objset_write_done(zio_t *zio, arc_buf_t *abuf, void *arg) { + (void) abuf; + blkptr_t *bp = zio->io_bp; blkptr_t *bp_orig = &zio->io_bp_orig; objset_t *os = arg; @@ -1617,7 +1621,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx) blkptr_t *blkptr_copy = kmem_alloc(sizeof (*os->os_rootbp), KM_SLEEP); *blkptr_copy = *os->os_rootbp; - dprintf_ds(os->os_dsl_dataset, "txg=%llu\n", tx->tx_txg); + dprintf_ds(os->os_dsl_dataset, "txg=%llu\n", (u_longlong_t)tx->tx_txg); ASSERT(dmu_tx_is_syncing(tx)); /* XXX the write_done callback should really give us the tx... */ diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c index a713e1329027..d6d9cc51af33 100644 --- a/module/zfs/dmu_recv.c +++ b/module/zfs/dmu_recv.c @@ -64,6 +64,8 @@ #endif #include +#pragma GCC diagnostic error "-Wunused-parameter" + int zfs_recv_queue_length = SPA_MAXBLOCKSIZE; int zfs_recv_queue_ff = 20; int zfs_recv_write_batch_size = 1024 * 1024; @@ -1820,7 +1822,6 @@ receive_object(struct receive_writer_arg *rwa, struct drr_object *drro, return (0); } -/* ARGSUSED */ noinline static int receive_freeobjects(struct receive_writer_arg *rwa, struct drr_freeobjects *drrfo) @@ -2222,7 +2223,6 @@ receive_spill(struct receive_writer_arg *rwa, struct drr_spill *drrs, return (0); } -/* ARGSUSED */ noinline static int receive_free(struct receive_writer_arg *rwa, struct drr_free *drrf) { @@ -2297,7 +2297,6 @@ receive_object_range(struct receive_writer_arg *rwa, * Until we have the ability to redact large ranges of data efficiently, we * process these records as frees. */ -/* ARGSUSED */ noinline static int receive_redact(struct receive_writer_arg *rwa, struct drr_redact *drrr) { @@ -2446,7 +2445,6 @@ receive_read_payload_and_next_header(dmu_recv_cookie_t *drc, int len, void *buf) * numbers in the ignore list. In practice, we receive up to 32 object records * before receiving write records, so the list can have up to 32 nodes in it. */ -/* ARGSUSED */ static void receive_read_prefetch(dmu_recv_cookie_t *drc, uint64_t object, uint64_t offset, uint64_t length) @@ -2588,7 +2586,8 @@ dprintf_drr(struct receive_record_arg *rrd, int err) dprintf("drr_type = OBJECT obj = %llu type = %u " "bonustype = %u blksz = %u bonuslen = %u cksumtype = %u " "compress = %u dn_slots = %u err = %d\n", - drro->drr_object, drro->drr_type, drro->drr_bonustype, + (u_longlong_t)drro->drr_object, + drro->drr_type, drro->drr_bonustype, drro->drr_blksz, drro->drr_bonuslen, drro->drr_checksumtype, drro->drr_compress, drro->drr_dn_slots, err); @@ -2600,7 +2599,9 @@ dprintf_drr(struct receive_record_arg *rrd, int err) &rrd->header.drr_u.drr_freeobjects; dprintf("drr_type = FREEOBJECTS firstobj = %llu " "numobjs = %llu err = %d\n", - drrfo->drr_firstobj, drrfo->drr_numobjs, err); + (u_longlong_t)drrfo->drr_firstobj, + (u_longlong_t)drrfo->drr_numobjs, + err); break; } case DRR_WRITE: @@ -2609,10 +2610,13 @@ dprintf_drr(struct receive_record_arg *rrd, int err) dprintf("drr_type = WRITE obj = %llu type = %u offset = %llu " "lsize = %llu cksumtype = %u flags = %u " "compress = %u psize = %llu err = %d\n", - drrw->drr_object, drrw->drr_type, drrw->drr_offset, - drrw->drr_logical_size, drrw->drr_checksumtype, - drrw->drr_flags, drrw->drr_compressiontype, - drrw->drr_compressed_size, err); + (u_longlong_t)drrw->drr_object, drrw->drr_type, + (u_longlong_t)drrw->drr_offset, + (u_longlong_t)drrw->drr_logical_size, + drrw->drr_checksumtype, drrw->drr_flags, + drrw->drr_compressiontype, + (u_longlong_t)drrw->drr_compressed_size, + err); break; } case DRR_WRITE_BYREF: @@ -2623,11 +2627,14 @@ dprintf_drr(struct receive_record_arg *rrd, int err) "length = %llu toguid = %llx refguid = %llx " "refobject = %llu refoffset = %llu cksumtype = %u " "flags = %u err = %d\n", - drrwbr->drr_object, drrwbr->drr_offset, - drrwbr->drr_length, drrwbr->drr_toguid, - drrwbr->drr_refguid, drrwbr->drr_refobject, - drrwbr->drr_refoffset, drrwbr->drr_checksumtype, - drrwbr->drr_flags, err); + (u_longlong_t)drrwbr->drr_object, + (u_longlong_t)drrwbr->drr_offset, + (u_longlong_t)drrwbr->drr_length, + (u_longlong_t)drrwbr->drr_toguid, + (u_longlong_t)drrwbr->drr_refguid, + (u_longlong_t)drrwbr->drr_refobject, + (u_longlong_t)drrwbr->drr_refoffset, + drrwbr->drr_checksumtype, drrwbr->drr_flags, err); break; } case DRR_WRITE_EMBEDDED: @@ -2637,7 +2644,9 @@ dprintf_drr(struct receive_record_arg *rrd, int err) dprintf("drr_type = WRITE_EMBEDDED obj = %llu offset = %llu " "length = %llu compress = %u etype = %u lsize = %u " "psize = %u err = %d\n", - drrwe->drr_object, drrwe->drr_offset, drrwe->drr_length, + (u_longlong_t)drrwe->drr_object, + (u_longlong_t)drrwe->drr_offset, + (u_longlong_t)drrwe->drr_length, drrwe->drr_compression, drrwe->drr_etype, drrwe->drr_lsize, drrwe->drr_psize, err); break; @@ -2647,7 +2656,9 @@ dprintf_drr(struct receive_record_arg *rrd, int err) struct drr_free *drrf = &rrd->header.drr_u.drr_free; dprintf("drr_type = FREE obj = %llu offset = %llu " "length = %lld err = %d\n", - drrf->drr_object, drrf->drr_offset, drrf->drr_length, + (u_longlong_t)drrf->drr_object, + (u_longlong_t)drrf->drr_offset, + (longlong_t)drrf->drr_length, err); break; } @@ -2655,7 +2666,10 @@ dprintf_drr(struct receive_record_arg *rrd, int err) { struct drr_spill *drrs = &rrd->header.drr_u.drr_spill; dprintf("drr_type = SPILL obj = %llu length = %llu " - "err = %d\n", drrs->drr_object, drrs->drr_length, err); + "err = %d\n", + (u_longlong_t)drrs->drr_object, + (u_longlong_t)drrs->drr_length, + err); break; } case DRR_OBJECT_RANGE: @@ -2664,13 +2678,17 @@ dprintf_drr(struct receive_record_arg *rrd, int err) &rrd->header.drr_u.drr_object_range; dprintf("drr_type = OBJECT_RANGE firstobj = %llu " "numslots = %llu flags = %u err = %d\n", - drror->drr_firstobj, drror->drr_numslots, + (u_longlong_t)drror->drr_firstobj, + (u_longlong_t)drror->drr_numslots, drror->drr_flags, err); break; } default: return; } +#else + (void) rrd; + (void) err; #endif } diff --git a/module/zfs/dmu_redact.c b/module/zfs/dmu_redact.c index 62c7d01d4bd2..4c7e786635e2 100644 --- a/module/zfs/dmu_redact.c +++ b/module/zfs/dmu_redact.c @@ -249,11 +249,13 @@ zfs_get_deleteq(objset_t *os) * Third, if there is a deleted object, we need to create a redaction record for * all of the blocks in that object. */ -/*ARGSUSED*/ static int redact_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const struct dnode_phys *dnp, void *arg) { + (void) spa; + (void) zilog; + struct redact_thread_arg *rta = arg; struct redact_record *record; diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index d654382237c0..d8ac80288138 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -1089,11 +1089,12 @@ range_alloc(enum type type, uint64_t object, uint64_t start_blkid, * This is the callback function to traverse_dataset that acts as a worker * thread for dmu_send_impl. */ -/*ARGSUSED*/ static int send_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const struct dnode_phys *dnp, void *arg) { + (void) zilog; + struct send_thread_arg *sta = arg; struct send_range *record; @@ -2142,6 +2143,8 @@ setup_resume_points(struct dmu_send_params *dspp, struct send_merge_thread_arg *smt_arg, boolean_t resuming, objset_t *os, redaction_list_t *redact_rl, nvlist_t *nvl) { + (void) smt_arg; + dsl_dataset_t *to_ds = dspp->to_ds; int err = 0; diff --git a/module/zfs/dmu_traverse.c b/module/zfs/dmu_traverse.c index 862c0bf404ad..37eac76929d7 100644 --- a/module/zfs/dmu_traverse.c +++ b/module/zfs/dmu_traverse.c @@ -560,11 +560,13 @@ traverse_dnode(traverse_data_t *td, const blkptr_t *bp, const dnode_phys_t *dnp, return (err); } -/* ARGSUSED */ static int traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { + (void) zilog; + (void) dnp; + prefetch_data_t *pfd = arg; int zio_flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE; arc_flags_t aflags = ARC_FLAG_NOWAIT | ARC_FLAG_PREFETCH | diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c index 73667915df0f..24ade6ff9eef 100644 --- a/module/zfs/dmu_tx.c +++ b/module/zfs/dmu_tx.c @@ -39,6 +39,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + typedef void (*dmu_tx_hold_func_t)(dmu_tx_t *tx, struct dnode *dn, uint64_t arg1, uint64_t arg2); @@ -218,7 +220,6 @@ dmu_tx_check_ioerr(zio_t *zio, dnode_t *dn, int level, uint64_t blkid) return (err); } -/* ARGSUSED */ static void dmu_tx_count_write(dmu_tx_hold_t *txh, uint64_t off, uint64_t len) { @@ -613,7 +614,9 @@ dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_impl_t *db) /* XXX txh_arg2 better not be zero... */ dprintf("found txh type %x beginblk=%llx endblk=%llx\n", - txh->txh_type, beginblk, endblk); + txh->txh_type, + (u_longlong_t)beginblk, + (u_longlong_t)endblk); switch (txh->txh_type) { case THT_WRITE: diff --git a/module/zfs/dmu_zfetch.c b/module/zfs/dmu_zfetch.c index 3d7407016d2c..64f0e5453d0c 100644 --- a/module/zfs/dmu_zfetch.c +++ b/module/zfs/dmu_zfetch.c @@ -225,6 +225,8 @@ dmu_zfetch_stream_create(zfetch_t *zf, uint64_t blkid) static void dmu_zfetch_stream_done(void *arg, boolean_t io_issued) { + (void) io_issued; + zstream_t *zs = arg; if (zfs_refcount_remove(&zs->zs_refs, NULL) == 0) diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c index 0fc788e28fe4..c79ba14f3a6c 100644 --- a/module/zfs/dnode.c +++ b/module/zfs/dnode.c @@ -40,6 +40,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + dnode_stats_t dnode_stats = { { "dnode_hold_dbuf_hold", KSTAT_DATA_UINT64 }, { "dnode_hold_dbuf_read", KSTAT_DATA_UINT64 }, @@ -108,10 +110,12 @@ dbuf_compare(const void *x1, const void *x2) return (TREE_PCMP(d1, d2)); } -/* ARGSUSED */ static int dnode_cons(void *arg, void *unused, int kmflag) { + (void) unused; + (void) kmflag; + dnode_t *dn = arg; int i; @@ -173,10 +177,11 @@ dnode_cons(void *arg, void *unused, int kmflag) return (0); } -/* ARGSUSED */ static void dnode_dest(void *arg, void *unused) { + (void) unused; + int i; dnode_t *dn = arg; @@ -592,7 +597,9 @@ dnode_allocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, int ibs, ibs = MIN(MAX(ibs, DN_MIN_INDBLKSHIFT), DN_MAX_INDBLKSHIFT); dprintf("os=%p obj=%llu txg=%llu blocksize=%d ibs=%d dn_slots=%d\n", - dn->dn_objset, dn->dn_object, tx->tx_txg, blocksize, ibs, dn_slots); + dn->dn_objset, + (u_longlong_t)dn->dn_object, (u_longlong_t)tx->tx_txg, + blocksize, ibs, dn_slots); DNODE_STAT_BUMP(dnode_allocate); ASSERT(dn->dn_type == DMU_OT_NONE); @@ -887,10 +894,11 @@ dnode_move_impl(dnode_t *odn, dnode_t *ndn) odn->dn_moved = (uint8_t)-1; } -/*ARGSUSED*/ static kmem_cbrc_t dnode_move(void *buf, void *newbuf, size_t size, void *arg) { + (void) size; + (void) arg; dnode_t *odn = buf, *ndn = newbuf; objset_t *os; int64_t refcount; @@ -1579,6 +1587,8 @@ dnode_hold(objset_t *os, uint64_t object, void *tag, dnode_t **dnp) boolean_t dnode_add_ref(dnode_t *dn, void *tag) { + (void) tag; + mutex_enter(&dn->dn_mtx); if (zfs_refcount_is_zero(&dn->dn_holds)) { mutex_exit(&dn->dn_mtx); @@ -1599,7 +1609,9 @@ dnode_rele(dnode_t *dn, void *tag) void dnode_rele_and_unlock(dnode_t *dn, void *tag, boolean_t evicting) { + (void) tag; uint64_t refs; + /* Get while the hold prevents the dnode from moving. */ dmu_buf_impl_t *db = dn->dn_dbuf; dnode_handle_t *dnh = dn->dn_handle; @@ -1619,7 +1631,9 @@ dnode_rele_and_unlock(dnode_t *dn, void *tag, boolean_t evicting) * other direct or indirect hold on the dnode must first drop the dnode * handle. */ +#ifdef ZFS_DEBUG ASSERT(refs > 0 || dnh->dnh_zrlock.zr_owner != curthread); +#endif /* NOTE: the DNODE_DNODE does not have a dn_dbuf */ if (refs == 0 && db != NULL) { @@ -1690,7 +1704,7 @@ dnode_setdirty(dnode_t *dn, dmu_tx_t *tx) ASSERT0(dn->dn_next_bonustype[txg & TXG_MASK]); dprintf_ds(os->os_dsl_dataset, "obj=%llu txg=%llu\n", - dn->dn_object, txg); + (u_longlong_t)dn->dn_object, (u_longlong_t)txg); multilist_sublist_insert_head(mls, dn); @@ -2253,7 +2267,7 @@ dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx) range_tree_add(dn->dn_free_ranges[txgoff], blkid, nblks); } dprintf_dnode(dn, "blkid=%llu nblks=%llu txg=%llu\n", - blkid, nblks, tx->tx_txg); + (u_longlong_t)blkid, (u_longlong_t)nblks, (u_longlong_t)tx->tx_txg); mutex_exit(&dn->dn_mtx); dbuf_free_range(dn, blkid, blkid + nblks - 1, tx); diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c index 66e48a1e17d4..8c64d95ef100 100644 --- a/module/zfs/dnode_sync.c +++ b/module/zfs/dnode_sync.c @@ -59,7 +59,7 @@ dnode_increase_indirection(dnode_t *dn, dmu_tx_t *tx) dn->dn_phys->dn_nlevels = new_level; dprintf("os=%p obj=%llu, increase to %d\n", dn->dn_objset, - dn->dn_object, dn->dn_phys->dn_nlevels); + (u_longlong_t)dn->dn_object, dn->dn_phys->dn_nlevels); /* * Lock ordering requires that we hold the children's db_mutexes (by @@ -136,7 +136,8 @@ free_blocks(dnode_t *dn, blkptr_t *bp, int num, dmu_tx_t *tx) dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset; uint64_t bytesfreed = 0; - dprintf("ds=%p obj=%llx num=%d\n", ds, dn->dn_object, num); + dprintf("ds=%p obj=%llx num=%d\n", + ds, (u_longlong_t)dn->dn_object, num); for (int i = 0; i < num; i++, bp++) { if (BP_IS_HOLE(bp)) diff --git a/module/zfs/dsl_bookmark.c b/module/zfs/dsl_bookmark.c index bead7da2237f..3a614ebf21c5 100644 --- a/module/zfs/dsl_bookmark.c +++ b/module/zfs/dsl_bookmark.c @@ -35,6 +35,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + static int dsl_bookmark_hold_ds(dsl_pool_t *dp, const char *fullname, dsl_dataset_t **dsp, void *tag, char **shortnamep) @@ -1203,7 +1205,6 @@ dsl_redaction_list_long_rele(redaction_list_t *rl, void *tag) (void) zfs_refcount_remove(&rl->rl_longholds, tag); } -/* ARGSUSED */ static void redaction_list_evict_sync(void *rlu) { @@ -1470,10 +1471,11 @@ dsl_bookmark_next_changed(dsl_dataset_t *head, dsl_dataset_t *origin, * Adjust the FBN of any bookmarks that reference this block, whose "next" * is the head dataset. */ -/* ARGSUSED */ void dsl_bookmark_block_killed(dsl_dataset_t *ds, const blkptr_t *bp, dmu_tx_t *tx) { + (void) tx; + /* * Iterate over bookmarks whose "next" is the head dataset. */ diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index 6da5faf01edf..063b16309010 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -69,9 +69,11 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * The SPA supports block sizes up to 16MB. However, very large blocks - * can have an impact on i/o latency (e.g. tying up a spinning disk for + * can have an impact on I/O latency (e.g. tying up a spinning disk for * ~300ms), and also potentially on the memory allocator. Therefore, * we do not allow the recordsize to be set larger than zfs_max_recordsize * (default 1MB). Larger blocks can be created by changing this tunable, @@ -282,7 +284,7 @@ dsl_dataset_block_kill(dsl_dataset_t *ds, const blkptr_t *bp, dmu_tx_t *tx, if (bp->blk_birth > dsl_dataset_phys(ds)->ds_prev_snap_txg) { int64_t delta; - dprintf_bp(bp, "freeing ds=%llu", ds->ds_object); + dprintf_bp(bp, "freeing ds=%llu", (u_longlong_t)ds->ds_object); dsl_free(tx->tx_pool, tx->tx_txg, bp); mutex_enter(&ds->ds_lock); @@ -717,11 +719,11 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uint64_t dsobj, void *tag, dsl_dataset_phys(ds)->ds_fsid_guid) { zfs_dbgmsg("ds_fsid_guid changed from " "%llx to %llx for pool %s dataset id %llu", - (long long) + (u_longlong_t) dsl_dataset_phys(ds)->ds_fsid_guid, - (long long)ds->ds_fsid_guid, + (u_longlong_t)ds->ds_fsid_guid, spa_name(dp->dp_spa), - dsobj); + (u_longlong_t)dsobj); } } } @@ -2394,8 +2396,8 @@ get_receive_resume_stats_impl(dsl_dataset_t *ds) } if (dsl_dataset_feature_is_active(ds, SPA_FEATURE_REDACTED_DATASETS)) { - uint64_t num_redact_snaps; - uint64_t *redact_snaps; + uint64_t num_redact_snaps = 0; + uint64_t *redact_snaps = 0; VERIFY(dsl_dataset_get_uint64_array_feature(ds, SPA_FEATURE_REDACTED_DATASETS, &num_redact_snaps, &redact_snaps)); @@ -2946,11 +2948,12 @@ typedef struct dsl_dataset_rename_snapshot_arg { dmu_tx_t *ddrsa_tx; } dsl_dataset_rename_snapshot_arg_t; -/* ARGSUSED */ static int dsl_dataset_rename_snapshot_check_impl(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) { + (void) dp; + dsl_dataset_rename_snapshot_arg_t *ddrsa = arg; int error; uint64_t val; @@ -4308,7 +4311,6 @@ typedef struct dsl_dataset_set_qr_arg { } dsl_dataset_set_qr_arg_t; -/* ARGSUSED */ static int dsl_dataset_set_refquota_check(void *arg, dmu_tx_t *tx) { @@ -4515,7 +4517,6 @@ typedef struct dsl_dataset_set_compression_arg { uint64_t ddsca_value; } dsl_dataset_set_compression_arg_t; -/* ARGSUSED */ static int dsl_dataset_set_compression_check(void *arg, dmu_tx_t *tx) { diff --git a/module/zfs/dsl_destroy.c b/module/zfs/dsl_destroy.c index 837d78987e75..8fed1334e931 100644 --- a/module/zfs/dsl_destroy.c +++ b/module/zfs/dsl_destroy.c @@ -654,7 +654,7 @@ dsl_destroy_snapshots_nvl(nvlist_t *snaps, boolean_t defer, char *errorstr = NULL; (void) nvlist_lookup_string(result, ZCP_RET_ERROR, &errorstr); if (errorstr != NULL) { - zfs_dbgmsg(errorstr); + zfs_dbgmsg("%s", errorstr); } fnvlist_free(wrapper); fnvlist_free(result); @@ -699,11 +699,13 @@ struct killarg { dmu_tx_t *tx; }; -/* ARGSUSED */ static int kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { + (void) spa; + (void) dnp; + struct killarg *ka = arg; dmu_tx_t *tx = ka->tx; @@ -1246,10 +1248,10 @@ dsl_destroy_head(const char *name) * inconsistent datasets, even if we encounter an error trying to * process one of them. */ -/* ARGSUSED */ int dsl_destroy_inconsistent(const char *dsname, void *arg) { + (void) arg; objset_t *os; if (dmu_objset_hold(dsname, FTAG, &os) == 0) { diff --git a/module/zfs/dsl_dir.c b/module/zfs/dsl_dir.c index 90dd787023be..008707b0ffd4 100644 --- a/module/zfs/dsl_dir.c +++ b/module/zfs/dsl_dir.c @@ -488,7 +488,7 @@ dsl_dir_hold(dsl_pool_t *dp, const char *name, void *tag, if (next[0] == '@') break; dprintf("looking up %s in obj%lld\n", - buf, dsl_dir_phys(dd)->dd_child_dir_zapobj); + buf, (longlong_t)dsl_dir_phys(dd)->dd_child_dir_zapobj); err = zap_lookup(dp->dp_meta_objset, dsl_dir_phys(dd)->dd_child_dir_zapobj, @@ -764,6 +764,8 @@ dsl_enforce_ds_ss_limits(dsl_dir_t *dd, zfs_prop_t prop, */ if (secpolicy_zfs_proc(cr, proc) == 0) return (ENFORCE_NEVER); +#else + (void) proc; #endif if ((obj = dsl_dir_phys(dd)->dd_head_dataset_obj) == 0) @@ -1156,8 +1158,9 @@ dsl_dir_sync(dsl_dir_t *dd, dmu_tx_t *tx) mutex_enter(&dd->dd_lock); ASSERT0(dd->dd_tempreserved[tx->tx_txg & TXG_MASK]); - dprintf_dd(dd, "txg=%llu towrite=%lluK\n", tx->tx_txg, - dd->dd_space_towrite[tx->tx_txg & TXG_MASK] / 1024); + dprintf_dd(dd, "txg=%llu towrite=%lluK\n", + (u_longlong_t)tx->tx_txg, + (u_longlong_t)(dd->dd_space_towrite[tx->tx_txg & TXG_MASK] / 1024)); dd->dd_space_towrite[tx->tx_txg & TXG_MASK] = 0; mutex_exit(&dd->dd_lock); @@ -1344,8 +1347,11 @@ dsl_dir_tempreserve_impl(dsl_dir_t *dd, uint64_t asize, boolean_t netfree, retval = ERESTART; dprintf_dd(dd, "failing: used=%lluK inflight = %lluK " "quota=%lluK tr=%lluK err=%d\n", - used_on_disk>>10, est_inflight>>10, - quota>>10, asize>>10, retval); + (u_longlong_t)used_on_disk>>10, + (u_longlong_t)est_inflight>>10, + (u_longlong_t)quota>>10, + (u_longlong_t)asize>>10, + retval); mutex_exit(&dd->dd_lock); DMU_TX_STAT_BUMP(dmu_tx_quota); return (SET_ERROR(retval)); @@ -1849,10 +1855,11 @@ typedef struct dsl_valid_rename_arg { int nest_delta; } dsl_valid_rename_arg_t; -/* ARGSUSED */ static int dsl_valid_rename(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg) { + (void) dp; + dsl_valid_rename_arg_t *dvra = arg; char namebuf[ZFS_MAX_DATASET_NAME_LEN]; @@ -2346,9 +2353,11 @@ dsl_dir_activity_in_progress(dsl_dir_t *dd, dsl_dataset_t *ds, break; #else /* - * The delete queue is ZPL specific, and libzpool doesn't have - * it. It doesn't make sense to wait for it. + * The delete queue is ZPL-specific, + * and libzpool doesn't have it. + * It doesn't make sense to wait for it. */ + (void) ds; *in_progress = B_FALSE; break; #endif diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c index c770eafa75d8..6d5253fbdcc8 100644 --- a/module/zfs/dsl_pool.c +++ b/module/zfs/dsl_pool.c @@ -51,6 +51,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * ZFS Write Throttle * ------------------ @@ -458,14 +460,12 @@ dsl_pool_t * dsl_pool_create(spa_t *spa, nvlist_t *zplprops, dsl_crypto_params_t *dcp, uint64_t txg) { + (void) zplprops; + int err; dsl_pool_t *dp = dsl_pool_open_impl(spa, txg); dmu_tx_t *tx = dmu_tx_create_assigned(dp, txg); -#ifdef _KERNEL objset_t *os; -#else - objset_t *os __attribute__((unused)); -#endif dsl_dataset_t *ds; uint64_t obj; @@ -535,6 +535,8 @@ dsl_pool_create(spa_t *spa, nvlist_t *zplprops, dsl_crypto_params_t *dcp, rrw_exit(&ds->ds_bp_rwlock, FTAG); #ifdef _KERNEL zfs_create_fs(os, kcred, zplprops, tx); +#else + (void) os; #endif dsl_dataset_rele_flags(ds, DS_HOLD_FLAG_DECRYPT, FTAG); @@ -593,10 +595,10 @@ dsl_pool_dirty_delta(dsl_pool_t *dp, int64_t delta) cv_signal(&dp->dp_spaceavail_cv); } -#ifdef ZFS_DEBUG static boolean_t dsl_early_sync_task_verify(dsl_pool_t *dp, uint64_t txg) { +#ifdef ZFS_DEBUG spa_t *spa = dp->dp_spa; vdev_t *rvd = spa->spa_root_vdev; @@ -613,8 +615,12 @@ dsl_early_sync_task_verify(dsl_pool_t *dp, uint64_t txg) } return (B_TRUE); -} +#else + (void) dp; + (void) txg; + return (B_FALSE); #endif +} void dsl_pool_sync(dsl_pool_t *dp, uint64_t txg) @@ -941,7 +947,6 @@ dsl_pool_undirty_space(dsl_pool_t *dp, int64_t space, uint64_t txg) mutex_exit(&dp->dp_lock); } -/* ARGSUSED */ static int upgrade_clones_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) { @@ -1032,7 +1037,6 @@ dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx) tx, DS_FIND_CHILDREN | DS_FIND_SERIALIZE)); } -/* ARGSUSED */ static int upgrade_dir_clones_cb(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg) { diff --git a/module/zfs/dsl_prop.c b/module/zfs/dsl_prop.c index 0787fcdad9b4..845158f231f5 100644 --- a/module/zfs/dsl_prop.c +++ b/module/zfs/dsl_prop.c @@ -504,10 +504,11 @@ dsl_prop_hascb(dsl_dataset_t *ds) return (!list_is_empty(&ds->ds_prop_cbs)); } -/* ARGSUSED */ static int dsl_prop_notify_all_cb(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg) { + (void) arg; + dsl_dir_t *dd = ds->ds_dir; dsl_prop_record_t *pr; dsl_prop_cb_record_t *cbr; diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 62ee9bb9ab6c..477abc247229 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -56,6 +56,8 @@ #include #endif +#pragma GCC diagnostic error "-Wunused-parameter" + /* * Grand theory statement on scan queue sorting * @@ -700,10 +702,11 @@ dsl_scan_sync_state(dsl_scan_t *scn, dmu_tx_t *tx, state_sync_type_t sync_type) } } -/* ARGSUSED */ int dsl_scan_setup_check(void *arg, dmu_tx_t *tx) { + (void) arg; + dsl_scan_t *scn = dmu_tx_pool(tx)->dp_scan; vdev_t *rvd = scn->scn_dp->dp_spa->spa_root_vdev; @@ -854,7 +857,6 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_t func) dsl_scan_setup_sync, &func, 0, ZFS_SPACE_CHECK_EXTRA_RESERVED)); } -/* ARGSUSED */ static void dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu_tx_t *tx) { @@ -1001,10 +1003,10 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu_tx_t *tx) ASSERT(!dsl_scan_is_running(scn)); } -/* ARGSUSED */ static int dsl_scan_cancel_check(void *arg, dmu_tx_t *tx) { + (void) arg; dsl_scan_t *scn = dmu_tx_pool(tx)->dp_scan; if (!dsl_scan_is_running(scn)) @@ -1012,10 +1014,10 @@ dsl_scan_cancel_check(void *arg, dmu_tx_t *tx) return (0); } -/* ARGSUSED */ static void dsl_scan_cancel_sync(void *arg, dmu_tx_t *tx) { + (void) arg; dsl_scan_t *scn = dmu_tx_pool(tx)->dp_scan; dsl_scan_done(scn, B_FALSE, tx); @@ -1377,11 +1379,12 @@ typedef struct zil_scan_arg { zil_header_t *zsa_zh; } zil_scan_arg_t; -/* ARGSUSED */ static int dsl_scan_zil_block(zilog_t *zilog, const blkptr_t *bp, void *arg, uint64_t claim_txg) { + (void) zilog; + zil_scan_arg_t *zsa = arg; dsl_pool_t *dp = zsa->zsa_dp; dsl_scan_t *scn = dp->dp_scan; @@ -1408,11 +1411,12 @@ dsl_scan_zil_block(zilog_t *zilog, const blkptr_t *bp, void *arg, return (0); } -/* ARGSUSED */ static int dsl_scan_zil_record(zilog_t *zilog, const lr_t *lrc, void *arg, uint64_t claim_txg) { + (void) zilog; + if (lrc->lrc_txtype == TX_WRITE) { zil_scan_arg_t *zsa = arg; dsl_pool_t *dp = zsa->zsa_dp; @@ -1637,6 +1641,8 @@ static void dsl_scan_prefetch_cb(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, arc_buf_t *buf, void *private) { + (void) zio; + scan_prefetch_ctx_t *spc = private; dsl_scan_t *scn = spc->spc_scn; spa_t *spa = scn->scn_dp->dp_spa; @@ -1696,7 +1702,6 @@ dsl_scan_prefetch_cb(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, scan_prefetch_ctx_rele(spc, scn); } -/* ARGSUSED */ static void dsl_scan_prefetch_thread(void *arg) { @@ -2323,7 +2328,6 @@ dsl_scan_ds_clone_swapped(dsl_dataset_t *ds1, dsl_dataset_t *ds2, dmu_tx_t *tx) dsl_scan_sync_state(scn, tx, SYNC_CACHED); } -/* ARGSUSED */ static int enqueue_clones_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) { @@ -2507,10 +2511,11 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64_t dsobj, dmu_tx_t *tx) dsl_dataset_rele(ds, FTAG); } -/* ARGSUSED */ static int enqueue_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) { + (void) arg; + dsl_dataset_t *ds; int err; dsl_scan_t *scn = dp->dp_scan; @@ -2546,11 +2551,12 @@ enqueue_cb(dsl_pool_t *dp, dsl_dataset_t *hds, void *arg) return (0); } -/* ARGSUSED */ void dsl_scan_ddt_entry(dsl_scan_t *scn, enum zio_checksum checksum, ddt_entry_t *dde, dmu_tx_t *tx) { + (void) tx; + const ddt_key_t *ddk = &dde->dde_key; ddt_phys_t *ddp = dde->dde_phys; blkptr_t bp; diff --git a/module/zfs/dsl_synctask.c b/module/zfs/dsl_synctask.c index 148e8fff2437..c428bcb4324e 100644 --- a/module/zfs/dsl_synctask.c +++ b/module/zfs/dsl_synctask.c @@ -32,10 +32,11 @@ #define DST_AVG_BLKSHIFT 14 -/* ARGSUSED */ static int dsl_null_checkfunc(void *arg, dmu_tx_t *tx) { + (void) arg; + (void) tx; return (0); } diff --git a/module/zfs/edonr_zfs.c b/module/zfs/edonr_zfs.c index aa00e1c9417e..935afb139f79 100644 --- a/module/zfs/edonr_zfs.c +++ b/module/zfs/edonr_zfs.c @@ -31,6 +31,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + #define EDONR_MODE 512 #define EDONR_BLOCK_SIZE EdonR512_BLOCK_SIZE @@ -45,7 +47,6 @@ edonr_incremental(void *buf, size_t size, void *arg) /* * Native zio_checksum interface for the Edon-R hash function. */ -/*ARGSUSED*/ void abd_checksum_edonr_native(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) diff --git a/module/zfs/fm.c b/module/zfs/fm.c index dff7d8ece4be..8cab2353fc3d 100644 --- a/module/zfs/fm.c +++ b/module/zfs/fm.c @@ -479,17 +479,17 @@ zfs_zevent_destroy(zfs_zevent_t *ze) /* * Wrappers for FM nvlist allocators */ -/* ARGSUSED */ static void * i_fm_alloc(nv_alloc_t *nva, size_t size) { + (void) nva; return (kmem_zalloc(size, KM_SLEEP)); } -/* ARGSUSED */ static void i_fm_free(nv_alloc_t *nva, void *buf, size_t size) { + (void) nva; kmem_free(buf, size); } diff --git a/module/zfs/gzip.c b/module/zfs/gzip.c index e2c6e59969d6..9bed3291ed5e 100644 --- a/module/zfs/gzip.c +++ b/module/zfs/gzip.c @@ -83,10 +83,11 @@ gzip_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) return ((size_t)dstlen); } -/*ARGSUSED*/ int gzip_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) { + (void) n; + zlen_t dstlen = d_len; ASSERT(d_len >= s_len); @@ -96,7 +97,7 @@ gzip_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) if (qat_compress(QAT_DECOMPRESS, s_start, s_len, d_start, d_len, &dstlen) == CPA_STATUS_SUCCESS) return (0); - /* if hardware de-compress fail, do it again with software */ + /* if hardware de-compress fails, try it again with software */ } if (uncompress_func(d_start, &dstlen, s_start, s_len) != Z_OK) diff --git a/module/zfs/lz4.c b/module/zfs/lz4.c index 4b46e694891a..c5fedd6ff329 100644 --- a/module/zfs/lz4.c +++ b/module/zfs/lz4.c @@ -35,6 +35,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + static int real_LZ4_compress(const char *source, char *dest, int isize, int osize); static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, @@ -46,11 +48,12 @@ static int LZ4_compress64kCtx(void *ctx, const char *source, char *dest, static kmem_cache_t *lz4_cache; -/*ARGSUSED*/ size_t lz4_compress_zfs(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) { + (void) n; + uint32_t bufsiz; char *dest = d_start; @@ -74,11 +77,12 @@ lz4_compress_zfs(void *s_start, void *d_start, size_t s_len, return (bufsiz + sizeof (bufsiz)); } -/*ARGSUSED*/ int lz4_decompress_zfs(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) { + (void) n; + const char *src = s_start; uint32_t bufsiz = BE_IN32(src); @@ -463,7 +467,6 @@ LZ4_NbCommonBytes(register U32 val) /* Compression functions */ -/*ARGSUSED*/ static int LZ4_compressCtx(void *ctx, const char *source, char *dest, int isize, int osize) @@ -654,7 +657,6 @@ LZ4_compressCtx(void *ctx, const char *source, char *dest, int isize, HASHLOG64K)) #define LZ4_HASH64K_VALUE(p) LZ4_HASH64K_FUNCTION(A32(p)) -/*ARGSUSED*/ static int LZ4_compress64kCtx(void *ctx, const char *source, char *dest, int isize, int osize) diff --git a/module/zfs/lzjb.c b/module/zfs/lzjb.c index a478e64c5141..39caf8f391cb 100644 --- a/module/zfs/lzjb.c +++ b/module/zfs/lzjb.c @@ -45,10 +45,11 @@ #define OFFSET_MASK ((1 << (16 - MATCH_BITS)) - 1) #define LEMPEL_SIZE 1024 -/*ARGSUSED*/ size_t lzjb_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) { + (void) n; + uchar_t *src = s_start; uchar_t *dst = d_start; uchar_t *cpy; @@ -100,10 +101,12 @@ lzjb_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) return (dst - (uchar_t *)d_start); } -/*ARGSUSED*/ int lzjb_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) { + (void) s_len; + (void) n; + uchar_t *src = s_start; uchar_t *dst = d_start; uchar_t *d_end = (uchar_t *)d_start + d_len; diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c index 3b2b79b2f42f..270568811e94 100644 --- a/module/zfs/metaslab.c +++ b/module/zfs/metaslab.c @@ -40,6 +40,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + #define WITH_DF_BLOCK_ALLOCATOR #define GANG_ALLOCATION(flags) \ @@ -1406,7 +1408,6 @@ metaslab_size_tree_full_load(range_tree_t *rt) * Create any block allocator specific components. The current allocators * rely on using both a size-ordered range_tree_t and an array of uint64_t's. */ -/* ARGSUSED */ static void metaslab_rt_create(range_tree_t *rt, void *arg) { @@ -1431,10 +1432,11 @@ metaslab_rt_create(range_tree_t *rt, void *arg) mrap->mra_floor_shift = metaslab_by_size_min_shift; } -/* ARGSUSED */ static void metaslab_rt_destroy(range_tree_t *rt, void *arg) { + (void) rt; + metaslab_rt_arg_t *mrap = arg; zfs_btree_t *size_tree = mrap->mra_bt; @@ -1442,7 +1444,6 @@ metaslab_rt_destroy(range_tree_t *rt, void *arg) kmem_free(mrap, sizeof (*mrap)); } -/* ARGSUSED */ static void metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) { @@ -1456,7 +1457,6 @@ metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) zfs_btree_add(size_tree, rs); } -/* ARGSUSED */ static void metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { @@ -1470,7 +1470,6 @@ metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) zfs_btree_remove(size_tree, rs); } -/* ARGSUSED */ static void metaslab_rt_vacate(range_tree_t *rt, void *arg) { @@ -2235,6 +2234,8 @@ metaslab_potentially_evict(metaslab_class_t *mc) inuse = spl_kmem_cache_inuse(zfs_btree_leaf_cache); } } +#else + (void) mc; #endif } @@ -2437,18 +2438,21 @@ metaslab_load_impl(metaslab_t *msp) "loading_time %lld ms, ms_max_size %llu, " "max size error %lld, " "old_weight %llx, new_weight %llx", - spa_syncing_txg(spa), spa_name(spa), - msp->ms_group->mg_vd->vdev_id, msp->ms_id, - space_map_length(msp->ms_sm), - range_tree_space(msp->ms_unflushed_allocs), - range_tree_space(msp->ms_unflushed_frees), - range_tree_space(msp->ms_freed), - range_tree_space(msp->ms_defer[0]), - range_tree_space(msp->ms_defer[1]), - (longlong_t)((load_start - msp->ms_unload_time) / 1000000), - (longlong_t)((load_end - load_start) / 1000000), - msp->ms_max_size, msp->ms_max_size - max_size, - weight, msp->ms_weight); + (u_longlong_t)spa_syncing_txg(spa), spa_name(spa), + (u_longlong_t)msp->ms_group->mg_vd->vdev_id, + (u_longlong_t)msp->ms_id, + (u_longlong_t)space_map_length(msp->ms_sm), + (u_longlong_t)range_tree_space(msp->ms_unflushed_allocs), + (u_longlong_t)range_tree_space(msp->ms_unflushed_frees), + (u_longlong_t)range_tree_space(msp->ms_freed), + (u_longlong_t)range_tree_space(msp->ms_defer[0]), + (u_longlong_t)range_tree_space(msp->ms_defer[1]), + (u_longlong_t)((load_start - msp->ms_unload_time) / 1000000), + (u_longlong_t)((load_end - load_start) / 1000000), + (u_longlong_t)msp->ms_max_size, + (longlong_t)(msp->ms_max_size - max_size), + (u_longlong_t)weight, + (u_longlong_t)msp->ms_weight); metaslab_verify_space(msp, spa_syncing_txg(spa)); mutex_exit(&msp->ms_sync_lock); @@ -2545,14 +2549,17 @@ metaslab_unload(metaslab_t *msp) "ms_id %llu, weight %llx, " "selected txg %llu (%llu ms ago), alloc_txg %llu, " "loaded %llu ms ago, max_size %llu", - spa_syncing_txg(spa), spa_name(spa), - msp->ms_group->mg_vd->vdev_id, msp->ms_id, - msp->ms_weight, - msp->ms_selected_txg, + (u_longlong_t)spa_syncing_txg(spa), spa_name(spa), + (u_longlong_t)msp->ms_group->mg_vd->vdev_id, + (u_longlong_t)msp->ms_id, + (u_longlong_t)msp->ms_weight, + (u_longlong_t)msp->ms_selected_txg, + (u_longlong_t) (msp->ms_unload_time - msp->ms_selected_time) / 1000 / 1000, - msp->ms_alloc_txg, + (u_longlong_t)msp->ms_alloc_txg, + (u_longlong_t) (msp->ms_unload_time - msp->ms_load_time) / 1000 / 1000, - msp->ms_max_size); + (u_longlong_t)msp->ms_max_size); } /* @@ -2914,8 +2921,10 @@ metaslab_set_fragmentation(metaslab_t *msp, boolean_t nodirty) msp->ms_condense_wanted = B_TRUE; vdev_dirty(vd, VDD_METASLAB, msp, txg + 1); zfs_dbgmsg("txg %llu, requesting force condense: " - "ms_id %llu, vdev_id %llu", txg, msp->ms_id, - vd->vdev_id); + "ms_id %llu, vdev_id %llu", + (u_longlong_t)txg, + (u_longlong_t)msp->ms_id, + (u_longlong_t)vd->vdev_id); } msp->ms_fragmentation = ZFS_FRAG_INVALID; return; @@ -3635,10 +3644,11 @@ metaslab_condense(metaslab_t *msp, dmu_tx_t *tx) ASSERT(range_tree_is_empty(msp->ms_freed)); /* since it is pass 1 */ zfs_dbgmsg("condensing: txg %llu, msp[%llu] %px, vdev id %llu, " - "spa %s, smp size %llu, segments %lu, forcing condense=%s", txg, - msp->ms_id, msp, msp->ms_group->mg_vd->vdev_id, - spa->spa_name, space_map_length(msp->ms_sm), - range_tree_numsegs(msp->ms_allocatable), + "spa %s, smp size %llu, segments %llu, forcing condense=%s", + (u_longlong_t)txg, (u_longlong_t)msp->ms_id, msp, + (u_longlong_t)msp->ms_group->mg_vd->vdev_id, spa->spa_name, + (u_longlong_t)space_map_length(msp->ms_sm), + (u_longlong_t)range_tree_numsegs(msp->ms_allocatable), msp->ms_condense_wanted ? "TRUE" : "FALSE"); msp->ms_condense_wanted = B_FALSE; @@ -3883,11 +3893,13 @@ metaslab_flush(metaslab_t *msp, dmu_tx_t *tx) if (zfs_flags & ZFS_DEBUG_LOG_SPACEMAP) { zfs_dbgmsg("flushing: txg %llu, spa %s, vdev_id %llu, " "ms_id %llu, unflushed_allocs %llu, unflushed_frees %llu, " - "appended %llu bytes", dmu_tx_get_txg(tx), spa_name(spa), - msp->ms_group->mg_vd->vdev_id, msp->ms_id, - range_tree_space(msp->ms_unflushed_allocs), - range_tree_space(msp->ms_unflushed_frees), - (sm_len_after - sm_len_before)); + "appended %llu bytes", + (u_longlong_t)dmu_tx_get_txg(tx), spa_name(spa), + (u_longlong_t)msp->ms_group->mg_vd->vdev_id, + (u_longlong_t)msp->ms_id, + (u_longlong_t)range_tree_space(msp->ms_unflushed_allocs), + (u_longlong_t)range_tree_space(msp->ms_unflushed_frees), + (u_longlong_t)(sm_len_after - sm_len_before)); } ASSERT3U(spa->spa_unflushed_stats.sus_memused, >=, @@ -4551,6 +4563,11 @@ metaslab_group_alloc_verify(spa_t *spa, const blkptr_t *bp, void *tag, metaslab_group_allocator_t *mga = &mg->mg_allocator[allocator]; VERIFY(zfs_refcount_not_held(&mga->mga_alloc_queue_depth, tag)); } +#else + (void) spa; + (void) bp; + (void) tag; + (void) allocator; #endif } @@ -4705,7 +4722,6 @@ metaslab_active_mask_verify(metaslab_t *msp) } } -/* ARGSUSED */ static uint64_t metaslab_group_alloc_normal(metaslab_group_t *mg, zio_alloc_list_t *zal, uint64_t asize, uint64_t txg, boolean_t want_unique, dva_t *dva, int d, @@ -5331,11 +5347,12 @@ metaslab_free_concrete(vdev_t *vd, uint64_t offset, uint64_t asize, mutex_exit(&msp->ms_lock); } -/* ARGSUSED */ void metaslab_free_impl_cb(uint64_t inner_offset, vdev_t *vd, uint64_t offset, uint64_t size, void *arg) { + (void) inner_offset; + boolean_t *checkpoint = arg; ASSERT3P(checkpoint, !=, NULL); @@ -5706,11 +5723,12 @@ typedef struct metaslab_claim_cb_arg_t { int mcca_error; } metaslab_claim_cb_arg_t; -/* ARGSUSED */ static void metaslab_claim_impl_cb(uint64_t inner_offset, vdev_t *vd, uint64_t offset, uint64_t size, void *arg) { + (void) inner_offset; + metaslab_claim_cb_arg_t *mcca_arg = arg; if (mcca_arg->mcca_error == 0) { @@ -5962,11 +5980,13 @@ metaslab_fastwrite_unmark(spa_t *spa, const blkptr_t *bp) spa_config_exit(spa, SCL_VDEV, FTAG); } -/* ARGSUSED */ static void metaslab_check_free_impl_cb(uint64_t inner, vdev_t *vd, uint64_t offset, uint64_t size, void *arg) { + (void) inner; + (void) arg; + if (vd->vdev_ops == &vdev_indirect_ops) return; diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c index d05c9db24c20..8954b5fba387 100644 --- a/module/zfs/mmp.c +++ b/module/zfs/mmp.c @@ -485,8 +485,8 @@ mmp_write_uberblock(spa_t *spa) if (mmp->mmp_skip_error != 0) { mmp->mmp_skip_error = 0; zfs_dbgmsg("MMP write after skipping due to unavailable " - "leaves, pool '%s' gethrtime %llu leaf %#llu", - spa_name(spa), gethrtime(), vd->vdev_guid); + "leaves, pool '%s' gethrtime %llu leaf %llu", + spa_name(spa), gethrtime(), (u_longlong_t)vd->vdev_guid); } if (mmp->mmp_zio_root == NULL) @@ -617,10 +617,13 @@ mmp_thread(void *arg) "mmp_interval %llu last_mmp_fail_intervals %u " "mmp_fail_intervals %u mmp_fail_ns %llu " "skip_wait %d leaves %d next_time %llu", - spa_name(spa), gethrtime(), last_mmp_interval, - mmp_interval, last_mmp_fail_intervals, - mmp_fail_intervals, mmp_fail_ns, skip_wait, leaves, - next_time); + spa_name(spa), + (u_longlong_t)gethrtime(), + (u_longlong_t)last_mmp_interval, + (u_longlong_t)mmp_interval, last_mmp_fail_intervals, + mmp_fail_intervals, + (u_longlong_t)mmp_fail_ns, skip_wait, leaves, + (u_longlong_t)next_time); } /* @@ -633,8 +636,8 @@ mmp_thread(void *arg) zfs_dbgmsg("MMP state change pool '%s': gethrtime %llu " "last_spa_multihost %u multihost %u " "last_spa_suspended %u suspended %u", - spa_name(spa), last_spa_multihost, multihost, - last_spa_suspended, suspended); + spa_name(spa), gethrtime(), last_spa_multihost, + multihost, last_spa_suspended, suspended); mutex_enter(&mmp->mmp_io_lock); mmp->mmp_last_write = gethrtime(); mmp->mmp_delay = mmp_interval; diff --git a/module/zfs/multilist.c b/module/zfs/multilist.c index 36c0d33bf1f6..600ec06068f7 100644 --- a/module/zfs/multilist.c +++ b/module/zfs/multilist.c @@ -33,13 +33,11 @@ int zfs_multilist_num_sublists = 0; * Given the object contained on the list, return a pointer to the * object's multilist_node_t structure it contains. */ -#ifdef ZFS_DEBUG static multilist_node_t * multilist_d2l(multilist_t *ml, void *obj) { return ((multilist_node_t *)((char *)obj + ml->ml_offset)); } -#endif /* * Initialize a new mutlilist using the parameters specified. diff --git a/module/zfs/range_tree.c b/module/zfs/range_tree.c index 5219fd079b73..9e1bc0645a64 100644 --- a/module/zfs/range_tree.c +++ b/module/zfs/range_tree.c @@ -34,6 +34,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * Range trees are tree-based data structures that can be used to * track free space or generally any space allocation information. @@ -116,7 +118,8 @@ range_tree_stat_verify(range_tree_t *rt) for (i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) { if (hist[i] != rt->rt_histogram[i]) { zfs_dbgmsg("i=%d, hist=%px, hist=%llu, rt_hist=%llu", - i, hist, hist[i], rt->rt_histogram[i]); + i, hist, (u_longlong_t)hist[i], + (u_longlong_t)rt->rt_histogram[i]); } VERIFY3U(hist[i], ==, rt->rt_histogram[i]); } @@ -740,7 +743,6 @@ range_tree_is_empty(range_tree_t *rt) return (range_tree_space(rt) == 0); } -/* ARGSUSED */ void rt_btree_create(range_tree_t *rt, void *arg) { @@ -763,35 +765,33 @@ rt_btree_create(range_tree_t *rt, void *arg) zfs_btree_create(size_tree, rt->rt_btree_compare, size); } -/* ARGSUSED */ void rt_btree_destroy(range_tree_t *rt, void *arg) { + (void) rt; + zfs_btree_t *size_tree = arg; ASSERT0(zfs_btree_numnodes(size_tree)); zfs_btree_destroy(size_tree); } -/* ARGSUSED */ void rt_btree_add(range_tree_t *rt, range_seg_t *rs, void *arg) { + (void) rt; zfs_btree_t *size_tree = arg; - zfs_btree_add(size_tree, rs); } -/* ARGSUSED */ void rt_btree_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { + (void) rt; zfs_btree_t *size_tree = arg; - zfs_btree_remove(size_tree, rs); } -/* ARGSUSED */ void rt_btree_vacate(range_tree_t *rt, void *arg) { diff --git a/module/zfs/sa.c b/module/zfs/sa.c index 5af0aaa7d0aa..bdb3a5b0b084 100644 --- a/module/zfs/sa.c +++ b/module/zfs/sa.c @@ -212,20 +212,21 @@ sa_attr_type_t sa_dummy_zpl_layout[] = { 0 }; static int sa_legacy_attr_count = ARRAY_SIZE(sa_legacy_attrs); static kmem_cache_t *sa_cache = NULL; -/*ARGSUSED*/ static int sa_cache_constructor(void *buf, void *unused, int kmflag) { - sa_handle_t *hdl = buf; + (void) unused; + (void) kmflag; + sa_handle_t *hdl = buf; mutex_init(&hdl->sa_lock, NULL, MUTEX_DEFAULT, NULL); return (0); } -/*ARGSUSED*/ static void sa_cache_destructor(void *buf, void *unused) { + (void) unused; sa_handle_t *hdl = buf; mutex_destroy(&hdl->sa_lock); } @@ -1218,11 +1219,14 @@ sa_attr_iter(objset_t *os, sa_hdr_phys_t *hdr, dmu_object_type_t type, } } -/*ARGSUSED*/ static void sa_byteswap_cb(void *hdr, void *attr_addr, sa_attr_type_t attr, uint16_t length, int length_idx, boolean_t variable_length, void *userp) { + (void) hdr; + (void) length_idx; + (void) variable_length; + sa_handle_t *hdl = userp; sa_os_t *sa = hdl->sa_os->os_sa; @@ -1292,7 +1296,7 @@ sa_build_index(sa_handle_t *hdl, sa_buf_type_t buftype) mutex_exit(&sa->sa_lock); zfs_dbgmsg("Buffer Header: %x != SA_MAGIC:%x " "object=%#llx\n", sa_hdr_phys->sa_magic, SA_MAGIC, - db->db.db_object); + (u_longlong_t)db->db.db_object); return (SET_ERROR(EIO)); } sa_byteswap(hdl, buftype); @@ -1309,10 +1313,10 @@ sa_build_index(sa_handle_t *hdl, sa_buf_type_t buftype) return (0); } -/*ARGSUSED*/ static void sa_evict_sync(void *dbu) { + (void) dbu; panic("evicting sa dbuf\n"); } diff --git a/module/zfs/sha256.c b/module/zfs/sha256.c index d297768eada5..d4701e1647da 100644 --- a/module/zfs/sha256.c +++ b/module/zfs/sha256.c @@ -41,11 +41,12 @@ sha_incremental(void *buf, size_t size, void *arg) return (0); } -/*ARGSUSED*/ void abd_checksum_SHA256(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; + int ret; SHA2_CTX ctx; zio_cksum_t tmp; @@ -78,11 +79,11 @@ abd_checksum_SHA256(abd_t *abd, uint64_t size, zcp->zc_word[3] = BE_64(tmp.zc_word[3]); } -/*ARGSUSED*/ void abd_checksum_SHA512_native(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; SHA2_CTX ctx; SHA2Init(SHA512_256, &ctx); @@ -90,7 +91,6 @@ abd_checksum_SHA512_native(abd_t *abd, uint64_t size, SHA2Final(zcp, &ctx); } -/*ARGSUSED*/ void abd_checksum_SHA512_byteswap(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) diff --git a/module/zfs/skein_zfs.c b/module/zfs/skein_zfs.c index 11b9940e027e..45912045a06f 100644 --- a/module/zfs/skein_zfs.c +++ b/module/zfs/skein_zfs.c @@ -29,6 +29,8 @@ #include +#pragma GCC diagnostic error "-Wunused-parameter" + static int skein_incremental(void *buf, size_t size, void *arg) { @@ -41,7 +43,6 @@ skein_incremental(void *buf, size_t size, void *arg) * function requires the presence of a ctx_template that should be allocated * using abd_checksum_skein_tmpl_init. */ -/*ARGSUSED*/ void abd_checksum_skein_native(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 26995575adaa..4f1e6f50639d 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -834,11 +834,10 @@ spa_prop_clear_bootfs(spa_t *spa, uint64_t dsobj, dmu_tx_t *tx) } } -/*ARGSUSED*/ static int spa_change_guid_check(void *arg, dmu_tx_t *tx) { - uint64_t *newguid __maybe_unused = arg; + uint64_t *newguid = arg; spa_t *spa = dmu_tx_pool(tx)->dp_spa; vdev_t *rvd = spa->spa_root_vdev; uint64_t vdev_state; @@ -2281,11 +2280,13 @@ int spa_load_verify_shift = 4; int spa_load_verify_metadata = B_TRUE; int spa_load_verify_data = B_TRUE; -/*ARGSUSED*/ static int spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg) { + (void) zilog; + (void) dnp; + if (zb->zb_level == ZB_DNODE_LEVEL || BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp) || BP_IS_REDACTED(bp)) return (0); @@ -2317,10 +2318,12 @@ spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, return (0); } -/* ARGSUSED */ static int verify_dataset_name_len(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg) { + (void) dp; + (void) arg; + if (dsl_dataset_namelen(ds) >= ZFS_MAX_DATASET_NAME_LEN) return (SET_ERROR(ENAMETOOLONG)); @@ -2450,10 +2453,11 @@ spa_livelist_delete_check(spa_t *spa) return (spa->spa_livelists_to_delete != 0); } -/* ARGSUSED */ static boolean_t spa_livelist_delete_cb_check(void *arg, zthr_t *z) { + (void) z; + spa_t *spa = arg; return (spa_livelist_delete_check(spa)); } @@ -2545,7 +2549,6 @@ livelist_delete_sync(void *arg, dmu_tx_t *tx) * be freed. Then, call a synctask which performs the actual frees and updates * the pool-wide livelist data. */ -/* ARGSUSED */ static void spa_livelist_delete_cb(void *arg, zthr_t *z) { @@ -2578,8 +2581,10 @@ spa_livelist_delete_cb(void *arg, zthr_t *z) .to_free = &to_free }; zfs_dbgmsg("deleting sublist (id %llu) from" - " livelist %llu, %d remaining", - dle->dle_bpobj.bpo_object, ll_obj, count - 1); + " livelist %llu, %llu remaining", + (u_longlong_t)dle->dle_bpobj.bpo_object, + (u_longlong_t)ll_obj, + (u_longlong_t)(count - 1)); VERIFY0(dsl_sync_task(spa_name(spa), NULL, sublist_delete_sync, &sync_arg, 0, ZFS_SPACE_CHECK_DESTROY)); @@ -2596,7 +2601,8 @@ spa_livelist_delete_cb(void *arg, zthr_t *z) .ll_obj = ll_obj, .zap_obj = zap_obj }; - zfs_dbgmsg("deletion of livelist %llu completed", ll_obj); + zfs_dbgmsg("deletion of livelist %llu completed", + (u_longlong_t)ll_obj); VERIFY0(dsl_sync_task(spa_name(spa), NULL, livelist_delete_sync, &sync_arg, 0, ZFS_SPACE_CHECK_DESTROY)); } @@ -2696,10 +2702,12 @@ spa_livelist_condense_sync(void *arg, dmu_tx_t *tx) dsl_dataset_name(ds, dsname); zfs_dbgmsg("txg %llu condensing livelist of %s (id %llu), bpobj %llu " "(%llu blkptrs) and bpobj %llu (%llu blkptrs) -> bpobj %llu " - "(%llu blkptrs)", tx->tx_txg, dsname, ds->ds_object, first_obj, - cur_first_size, next_obj, cur_next_size, - first->dle_bpobj.bpo_object, - first->dle_bpobj.bpo_phys->bpo_num_blkptrs); + "(%llu blkptrs)", + (u_longlong_t)tx->tx_txg, dsname, (u_longlong_t)ds->ds_object, + (u_longlong_t)first_obj, (u_longlong_t)cur_first_size, + (u_longlong_t)next_obj, (u_longlong_t)cur_next_size, + (u_longlong_t)first->dle_bpobj.bpo_object, + (u_longlong_t)first->dle_bpobj.bpo_phys->bpo_num_blkptrs); out: dmu_buf_rele(ds->ds_dbuf, spa); spa->spa_to_condense.ds = NULL; @@ -2786,7 +2794,6 @@ spa_livelist_condense_cb(void *arg, zthr_t *t) zfs_livelist_condense_zthr_cancel++; } -/* ARGSUSED */ /* * Check that there is something to condense but that a condense is not * already in progress and that condensing has not been cancelled. @@ -2794,6 +2801,8 @@ spa_livelist_condense_cb(void *arg, zthr_t *t) static boolean_t spa_livelist_condense_cb_check(void *arg, zthr_t *z) { + (void) z; + spa_t *spa = arg; if ((spa->spa_to_condense.ds != NULL) && (spa->spa_to_condense.syncing == B_FALSE) && @@ -2957,7 +2966,6 @@ spa_load(spa_t *spa, spa_load_state_t state, spa_import_type_t type) return (error); } -#ifdef ZFS_DEBUG /* * Count the number of per-vdev ZAPs associated with all of the vdevs in the * vdev tree rooted in the given vd, and ensure that each ZAP is present in the @@ -2986,7 +2994,6 @@ vdev_count_verify_zaps(vdev_t *vd) return (total); } -#endif /* * Determine whether the activity check is required. @@ -3091,8 +3098,11 @@ spa_activity_check_duration(spa_t *spa, uberblock_t *ub) zfs_dbgmsg("fail_intvals>0 import_delay=%llu ub_mmp " "mmp_fails=%llu ub_mmp mmp_interval=%llu " - "import_intervals=%u", import_delay, MMP_FAIL_INT(ub), - MMP_INTERVAL(ub), import_intervals); + "import_intervals=%llu", + (u_longlong_t)import_delay, + (u_longlong_t)MMP_FAIL_INT(ub), + (u_longlong_t)MMP_INTERVAL(ub), + (u_longlong_t)import_intervals); } else if (MMP_INTERVAL_VALID(ub) && MMP_FAIL_INT_VALID(ub) && MMP_FAIL_INT(ub) == 0) { @@ -3103,8 +3113,11 @@ spa_activity_check_duration(spa_t *spa, uberblock_t *ub) zfs_dbgmsg("fail_intvals=0 import_delay=%llu ub_mmp " "mmp_interval=%llu ub_mmp_delay=%llu " - "import_intervals=%u", import_delay, MMP_INTERVAL(ub), - ub->ub_mmp_delay, import_intervals); + "import_intervals=%llu", + (u_longlong_t)import_delay, + (u_longlong_t)MMP_INTERVAL(ub), + (u_longlong_t)ub->ub_mmp_delay, + (u_longlong_t)import_intervals); } else if (MMP_VALID(ub)) { /* @@ -3115,15 +3128,19 @@ spa_activity_check_duration(spa_t *spa, uberblock_t *ub) ub->ub_mmp_delay) * import_intervals); zfs_dbgmsg("import_delay=%llu ub_mmp_delay=%llu " - "import_intervals=%u leaves=%u", import_delay, - ub->ub_mmp_delay, import_intervals, + "import_intervals=%llu leaves=%u", + (u_longlong_t)import_delay, + (u_longlong_t)ub->ub_mmp_delay, + (u_longlong_t)import_intervals, vdev_count_leaves(spa)); } else { /* Using local tunings is the only reasonable option */ zfs_dbgmsg("pool last imported on non-MMP aware " "host using import_delay=%llu multihost_interval=%llu " - "import_intervals=%u", import_delay, multihost_interval, - import_intervals); + "import_intervals=%llu", + (u_longlong_t)import_delay, + (u_longlong_t)multihost_interval, + (u_longlong_t)import_intervals); } return (import_delay); @@ -3191,8 +3208,12 @@ spa_activity_check(spa_t *spa, uberblock_t *ub, nvlist_t *config) "txg %llu ub_txg %llu " "timestamp %llu ub_timestamp %llu " "mmp_config %#llx ub_mmp_config %#llx", - txg, ub->ub_txg, timestamp, ub->ub_timestamp, - mmp_config, ub->ub_mmp_config); + (u_longlong_t)txg, + (u_longlong_t)ub->ub_txg, + (u_longlong_t)timestamp, + (u_longlong_t)ub->ub_timestamp, + (u_longlong_t)mmp_config, + (u_longlong_t)ub->ub_mmp_config); error = SET_ERROR(EREMOTEIO); break; @@ -9788,7 +9809,6 @@ spa_wait_tag(const char *pool, zpool_wait_activity_t activity, uint64_t tag, int spa_wait(const char *pool, zpool_wait_activity_t activity, boolean_t *waited) { - return (spa_wait_common(pool, activity, B_FALSE, 0, waited)); } @@ -9804,6 +9824,11 @@ spa_event_create(spa_t *spa, vdev_t *vd, nvlist_t *hist_nvl, const char *name) ev = kmem_alloc(sizeof (sysevent_t), KM_SLEEP); ev->resource = resource; } +#else + (void) spa; + (void) vd; + (void) hist_nvl; + (void) name; #endif return (ev); } @@ -9816,6 +9841,8 @@ spa_event_post(sysevent_t *ev) zfs_zevent_post(ev->resource, NULL, zfs_zevent_post_cb); kmem_free(ev, sizeof (*ev)); } +#else + (void) ev; #endif } diff --git a/module/zfs/spa_checkpoint.c b/module/zfs/spa_checkpoint.c index 5fb614467273..6a1f8407b633 100644 --- a/module/zfs/spa_checkpoint.c +++ b/module/zfs/spa_checkpoint.c @@ -337,17 +337,19 @@ spa_checkpoint_discard_thread_sync(void *arg, dmu_tx_t *tx) spa_checkpoint_accounting_verify(vd->vdev_spa); #endif - zfs_dbgmsg("discarding checkpoint: txg %llu, vdev id %d, " + zfs_dbgmsg("discarding checkpoint: txg %llu, vdev id %llu, " "deleted %llu words - %llu words are left", - tx->tx_txg, vd->vdev_id, (words_before - words_after), - words_after); + (u_longlong_t)tx->tx_txg, + (u_longlong_t)vd->vdev_id, + (u_longlong_t)(words_before - words_after), + (u_longlong_t)words_after); if (error != EINTR) { if (error != 0) { zfs_panic_recover("zfs: error %d was returned " "while incrementally destroying the checkpoint " "space map of vdev %llu\n", - error, vd->vdev_id); + error, (u_longlong_t)vd->vdev_id); } ASSERT0(words_after); ASSERT0(space_map_allocated(vd->vdev_checkpoint_sm)); @@ -379,10 +381,11 @@ spa_checkpoint_discard_is_done(spa_t *spa) return (B_TRUE); } -/* ARGSUSED */ boolean_t spa_checkpoint_discard_thread_check(void *arg, zthr_t *zthr) { + (void) zthr; + spa_t *spa = arg; if (!spa_feature_is_active(spa, SPA_FEATURE_POOL_CHECKPOINT)) @@ -449,10 +452,11 @@ spa_checkpoint_discard_thread(void *arg, zthr_t *zthr) } -/* ARGSUSED */ static int spa_checkpoint_check(void *arg, dmu_tx_t *tx) { + (void) arg; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; if (!spa_feature_is_enabled(spa, SPA_FEATURE_POOL_CHECKPOINT)) @@ -473,10 +477,11 @@ spa_checkpoint_check(void *arg, dmu_tx_t *tx) return (0); } -/* ARGSUSED */ static void spa_checkpoint_sync(void *arg, dmu_tx_t *tx) { + (void) arg; + dsl_pool_t *dp = dmu_tx_pool(tx); spa_t *spa = dp->dp_spa; uberblock_t checkpoint = spa->spa_ubsync; @@ -570,10 +575,11 @@ spa_checkpoint(const char *pool) return (error); } -/* ARGSUSED */ static int spa_checkpoint_discard_check(void *arg, dmu_tx_t *tx) { + (void) arg; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; if (!spa_feature_is_active(spa, SPA_FEATURE_POOL_CHECKPOINT)) @@ -588,10 +594,11 @@ spa_checkpoint_discard_check(void *arg, dmu_tx_t *tx) return (0); } -/* ARGSUSED */ static void spa_checkpoint_discard_sync(void *arg, dmu_tx_t *tx) { + (void) arg; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; VERIFY0(zap_remove(spa_meta_objset(spa), DMU_POOL_DIRECTORY_OBJECT, diff --git a/module/zfs/spa_errlog.c b/module/zfs/spa_errlog.c index fa5120eb61b3..e150ac5df7ea 100644 --- a/module/zfs/spa_errlog.c +++ b/module/zfs/spa_errlog.c @@ -252,6 +252,10 @@ spa_get_errlog(spa_t *spa, void *uaddr, size_t *count) mutex_exit(&spa->spa_errlist_lock); mutex_exit(&spa->spa_errlog_lock); +#else + (void) spa; + (void) uaddr; + (void) count; #endif return (ret); diff --git a/module/zfs/spa_history.c b/module/zfs/spa_history.c index 0482e0f6c39d..43d86d06d182 100644 --- a/module/zfs/spa_history.c +++ b/module/zfs/spa_history.c @@ -43,6 +43,8 @@ #include #endif +#pragma GCC diagnostic error "-Wunused-parameter" + /* * Routines to manage the on-disk history log. * @@ -248,7 +250,6 @@ spa_history_log_notify(spa_t *spa, nvlist_t *nvl) /* * Write out a history event. */ -/*ARGSUSED*/ static void spa_history_log_sync(void *arg, dmu_tx_t *tx) { @@ -296,13 +297,16 @@ spa_history_log_sync(void *arg, dmu_tx_t *tx) } else if (nvlist_exists(nvl, ZPOOL_HIST_INT_NAME)) { if (nvlist_exists(nvl, ZPOOL_HIST_DSNAME)) { zfs_dbgmsg("txg %lld %s %s (id %llu) %s", + (u_longlong_t) fnvlist_lookup_uint64(nvl, ZPOOL_HIST_TXG), fnvlist_lookup_string(nvl, ZPOOL_HIST_INT_NAME), fnvlist_lookup_string(nvl, ZPOOL_HIST_DSNAME), + (u_longlong_t) fnvlist_lookup_uint64(nvl, ZPOOL_HIST_DSID), fnvlist_lookup_string(nvl, ZPOOL_HIST_INT_STR)); } else { zfs_dbgmsg("txg %lld %s %s", + (u_longlong_t) fnvlist_lookup_uint64(nvl, ZPOOL_HIST_TXG), fnvlist_lookup_string(nvl, ZPOOL_HIST_INT_NAME), fnvlist_lookup_string(nvl, ZPOOL_HIST_INT_STR)); diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c index 0694ddaec4bf..dae7b71e3591 100644 --- a/module/zfs/spa_misc.c +++ b/module/zfs/spa_misc.c @@ -613,7 +613,7 @@ spa_deadman(void *arg) zfs_dbgmsg("slow spa_sync: started %llu seconds ago, calls %llu", (gethrtime() - spa->spa_sync_starttime) / NANOSEC, - ++spa->spa_deadman_calls); + (u_longlong_t)++spa->spa_deadman_calls); if (zfs_deadman_enabled) vdev_deadman(spa->spa_root_vdev, FTAG); diff --git a/module/zfs/space_map.c b/module/zfs/space_map.c index 3db7d199199c..71bbc9434841 100644 --- a/module/zfs/space_map.c +++ b/module/zfs/space_map.c @@ -877,9 +877,10 @@ space_map_truncate(space_map_t *sm, int blocksize, dmu_tx_t *tx) doi.doi_data_block_size != blocksize || doi.doi_metadata_block_size != 1 << space_map_ibs) { zfs_dbgmsg("txg %llu, spa %s, sm %px, reallocating " - "object[%llu]: old bonus %u, old blocksz %u", - dmu_tx_get_txg(tx), spa_name(spa), sm, sm->sm_object, - doi.doi_bonus_size, doi.doi_data_block_size); + "object[%llu]: old bonus %llu, old blocksz %u", + (u_longlong_t)dmu_tx_get_txg(tx), spa_name(spa), sm, + (u_longlong_t)sm->sm_object, + (u_longlong_t)doi.doi_bonus_size, doi.doi_data_block_size); space_map_free(sm, tx); dmu_buf_rele(sm->sm_dbuf, sm); diff --git a/module/zfs/txg.c b/module/zfs/txg.c index 497e19dd58eb..62fd45a0e358 100644 --- a/module/zfs/txg.c +++ b/module/zfs/txg.c @@ -554,7 +554,8 @@ txg_sync_thread(void *arg) !txg_has_quiesced_to_sync(dp) && dp->dp_dirty_total < dirty_min_bytes) { dprintf("waiting; tx_synced=%llu waiting=%llu dp=%p\n", - tx->tx_synced_txg, tx->tx_sync_txg_waiting, dp); + (u_longlong_t)tx->tx_synced_txg, + (u_longlong_t)tx->tx_sync_txg_waiting, dp); txg_thread_wait(tx, &cpr, &tx->tx_sync_more_cv, timer); delta = ddi_get_lbolt() - start; timer = (delta > timeout ? 0 : timeout - delta); @@ -587,7 +588,9 @@ txg_sync_thread(void *arg) cv_broadcast(&tx->tx_quiesce_more_cv); dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n", - txg, tx->tx_quiesce_txg_waiting, tx->tx_sync_txg_waiting); + (u_longlong_t)txg, + (u_longlong_t)tx->tx_quiesce_txg_waiting, + (u_longlong_t)tx->tx_sync_txg_waiting); mutex_exit(&tx->tx_sync_lock); txg_stat_t *ts = spa_txg_history_init_io(spa, txg, dp); @@ -638,8 +641,9 @@ txg_quiesce_thread(void *arg) txg = tx->tx_open_txg; dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n", - txg, tx->tx_quiesce_txg_waiting, - tx->tx_sync_txg_waiting); + (u_longlong_t)txg, + (u_longlong_t)tx->tx_quiesce_txg_waiting, + (u_longlong_t)tx->tx_sync_txg_waiting); tx->tx_quiescing_txg = txg; mutex_exit(&tx->tx_sync_lock); @@ -649,7 +653,8 @@ txg_quiesce_thread(void *arg) /* * Hand this txg off to the sync thread. */ - dprintf("quiesce done, handing off txg %llu\n", txg); + dprintf("quiesce done, handing off txg %llu\n", + (u_longlong_t)txg); tx->tx_quiescing_txg = 0; tx->tx_quiesced_txg = txg; DTRACE_PROBE2(txg__quiesced, dsl_pool_t *, dp, uint64_t, txg); @@ -705,11 +710,14 @@ txg_wait_synced_impl(dsl_pool_t *dp, uint64_t txg, boolean_t wait_sig) if (tx->tx_sync_txg_waiting < txg) tx->tx_sync_txg_waiting = txg; dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n", - txg, tx->tx_quiesce_txg_waiting, tx->tx_sync_txg_waiting); + (u_longlong_t)txg, + (u_longlong_t)tx->tx_quiesce_txg_waiting, + (u_longlong_t)tx->tx_sync_txg_waiting); while (tx->tx_synced_txg < txg) { dprintf("broadcasting sync more " "tx_synced=%llu waiting=%llu dp=%px\n", - tx->tx_synced_txg, tx->tx_sync_txg_waiting, dp); + (u_longlong_t)tx->tx_synced_txg, + (u_longlong_t)tx->tx_sync_txg_waiting, dp); cv_broadcast(&tx->tx_sync_more_cv); if (wait_sig) { /* @@ -764,7 +772,9 @@ txg_wait_open(dsl_pool_t *dp, uint64_t txg, boolean_t should_quiesce) if (tx->tx_quiesce_txg_waiting < txg && should_quiesce) tx->tx_quiesce_txg_waiting = txg; dprintf("txg=%llu quiesce_txg=%llu sync_txg=%llu\n", - txg, tx->tx_quiesce_txg_waiting, tx->tx_sync_txg_waiting); + (u_longlong_t)txg, + (u_longlong_t)tx->tx_quiesce_txg_waiting, + (u_longlong_t)tx->tx_sync_txg_waiting); while (tx->tx_open_txg < txg) { cv_broadcast(&tx->tx_quiesce_more_cv); /* diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index b5d441d1e2c8..390351b82dce 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -164,8 +164,8 @@ vdev_dbgmsg_print_tree(vdev_t *vd, int indent) char state[20]; if (vd->vdev_ishole || vd->vdev_ops == &vdev_missing_ops) { - zfs_dbgmsg("%*svdev %u: %s", indent, "", vd->vdev_id, - vd->vdev_ops->vdev_op_type); + zfs_dbgmsg("%*svdev %llu: %s", indent, "", + (u_longlong_t)vd->vdev_id, vd->vdev_ops->vdev_op_type); return; } @@ -260,11 +260,13 @@ vdev_get_mg(vdev_t *vd, metaslab_class_t *mc) return (vd->vdev_mg); } -/* ARGSUSED */ void vdev_default_xlate(vdev_t *vd, const range_seg64_t *logical_rs, range_seg64_t *physical_rs, range_seg64_t *remain_rs) { + (void) vd; + (void) remain_rs; + physical_rs->rs_start = logical_rs->rs_start; physical_rs->rs_end = logical_rs->rs_end; } @@ -1766,6 +1768,7 @@ vdev_uses_zvols(vdev_t *vd) static boolean_t vdev_default_open_children_func(vdev_t *vd) { + (void) vd; return (B_TRUE); } @@ -2823,6 +2826,9 @@ boolean_t vdev_default_need_resilver(vdev_t *vd, const dva_t *dva, size_t psize, uint64_t phys_birth) { + (void) dva; + (void) psize; + /* Set by sequential resilver. */ if (phys_birth == TXG_UNKNOWN) return (B_TRUE); @@ -4266,6 +4272,8 @@ vdev_get_child_stat(vdev_t *cvd, vdev_stat_t *vs, vdev_stat_t *cvs) static void vdev_get_child_stat_ex(vdev_t *cvd, vdev_stat_ex_t *vsx, vdev_stat_ex_t *cvsx) { + (void) cvd; + int t, b; for (t = 0; t < ZIO_TYPES; t++) { for (b = 0; b < ARRAY_SIZE(vsx->vsx_disk_histo[0]); b++) @@ -4702,6 +4710,8 @@ void vdev_space_update(vdev_t *vd, int64_t alloc_delta, int64_t defer_delta, int64_t space_delta) { + (void) defer_delta; + int64_t dspace_delta; spa_t *spa = vd->vdev_spa; vdev_t *rvd = spa->spa_root_vdev; @@ -5208,8 +5218,9 @@ vdev_deadman(vdev_t *vd, char *tag) zio_t *fio; uint64_t delta; - zfs_dbgmsg("slow vdev: %s has %d active IOs", - vd->vdev_path, avl_numnodes(&vq->vq_active_tree)); + zfs_dbgmsg("slow vdev: %s has %llu active IOs", + vd->vdev_path, + (u_longlong_t)avl_numnodes(&vq->vq_active_tree)); /* * Look at the head of all the pending queues, diff --git a/module/zfs/vdev_draid.c b/module/zfs/vdev_draid.c index 20b1457f0ce8..8f31d795eeaf 100644 --- a/module/zfs/vdev_draid.c +++ b/module/zfs/vdev_draid.c @@ -42,6 +42,8 @@ #include /* For vdev_xlate() in vdev_draid_io_verify() */ #endif +#pragma GCC diagnostic error "-Wunused-parameter" + /* * dRAID is a distributed spare implementation for ZFS. A dRAID vdev is * comprised of multiple raidz redundancy groups which are spread over the @@ -1794,6 +1796,10 @@ vdev_draid_io_verify(vdev_t *vd, raidz_row_t *rr, int col) ASSERT3U(rc->rc_offset, ==, physical_rs.rs_start); ASSERT3U(rc->rc_offset, <, physical_rs.rs_end); ASSERT3U(rc->rc_offset + rc->rc_size, ==, physical_rs.rs_end); +#else + (void) vd; + (void) rr; + (void) col; #endif } @@ -2153,6 +2159,8 @@ vdev_draid_config_generate(vdev_t *vd, nvlist_t *nv) static int vdev_draid_init(spa_t *spa, nvlist_t *nv, void **tsd) { + (void) spa; + uint64_t ndata, nparity, nspares, ngroups; int error; @@ -2381,7 +2389,6 @@ vdev_draid_spare_get_child(vdev_t *vd, uint64_t physical_offset) return (cvd); } -/* ARGSUSED */ static void vdev_draid_spare_close(vdev_t *vd) { @@ -2640,10 +2647,10 @@ vdev_draid_spare_io_start(zio_t *zio) zio_execute(zio); } -/* ARGSUSED */ static void vdev_draid_spare_io_done(zio_t *zio) { + (void) zio; } /* diff --git a/module/zfs/vdev_indirect.c b/module/zfs/vdev_indirect.c index e539e9aa2d70..6ee4bcb10a07 100644 --- a/module/zfs/vdev_indirect.c +++ b/module/zfs/vdev_indirect.c @@ -529,8 +529,11 @@ spa_condense_indirect_complete_sync(void *arg, dmu_tx_t *tx) zfs_dbgmsg("finished condense of vdev %llu in txg %llu: " "new mapping object %llu has %llu entries " "(was %llu entries)", - vd->vdev_id, dmu_tx_get_txg(tx), vic->vic_mapping_object, - new_count, old_count); + (u_longlong_t)vd->vdev_id, + (u_longlong_t)dmu_tx_get_txg(tx), + (u_longlong_t)vic->vic_mapping_object, + (u_longlong_t)new_count, + (u_longlong_t)old_count); vdev_config_dirty(spa->spa_root_vdev); } @@ -609,7 +612,8 @@ spa_condense_indirect_generate_new_mapping(vdev_t *vd, if (zthr_iscancelled(zthr)) { zfs_dbgmsg("pausing condense of vdev %llu " - "at index %llu", (u_longlong_t)vd->vdev_id, + "at index %llu", + (u_longlong_t)vd->vdev_id, (u_longlong_t)mapi); break; } @@ -636,16 +640,15 @@ spa_condense_indirect_generate_new_mapping(vdev_t *vd, } } -/* ARGSUSED */ static boolean_t spa_condense_indirect_thread_check(void *arg, zthr_t *zthr) { - spa_t *spa = arg; + (void) zthr; + spa_t *spa = arg; return (spa->spa_condensing_indirect != NULL); } -/* ARGSUSED */ static void spa_condense_indirect_thread(void *arg, zthr_t *zthr) { @@ -796,7 +799,7 @@ spa_condense_indirect_start_sync(vdev_t *vd, dmu_tx_t *tx) zfs_dbgmsg("starting condense of vdev %llu in txg %llu: " "posm=%llu nm=%llu", - vd->vdev_id, dmu_tx_get_txg(tx), + (u_longlong_t)vd->vdev_id, (u_longlong_t)dmu_tx_get_txg(tx), (u_longlong_t)scip->scip_prev_obsolete_sm_object, (u_longlong_t)scip->scip_next_mapping_object); @@ -940,13 +943,12 @@ vdev_obsolete_counts_are_precise(vdev_t *vd, boolean_t *are_precise) return (error); } -/* ARGSUSED */ static void vdev_indirect_close(vdev_t *vd) { + (void) vd; } -/* ARGSUSED */ static int vdev_indirect_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, uint64_t *logical_ashift, uint64_t *physical_ashift) diff --git a/module/zfs/vdev_indirect_births.c b/module/zfs/vdev_indirect_births.c index 99b83c392257..3d7f17180160 100644 --- a/module/zfs/vdev_indirect_births.c +++ b/module/zfs/vdev_indirect_births.c @@ -23,7 +23,6 @@ #include #include -#ifdef ZFS_DEBUG static boolean_t vdev_indirect_births_verify(vdev_indirect_births_t *vib) { @@ -38,7 +37,6 @@ vdev_indirect_births_verify(vdev_indirect_births_t *vib) return (B_TRUE); } -#endif uint64_t vdev_indirect_births_count(vdev_indirect_births_t *vib) diff --git a/module/zfs/vdev_indirect_mapping.c b/module/zfs/vdev_indirect_mapping.c index bb484a401b1b..9a72259f8d1f 100644 --- a/module/zfs/vdev_indirect_mapping.c +++ b/module/zfs/vdev_indirect_mapping.c @@ -25,7 +25,6 @@ #include #include -#ifdef ZFS_DEBUG static boolean_t vdev_indirect_mapping_verify(vdev_indirect_mapping_t *vim) { @@ -54,7 +53,6 @@ vdev_indirect_mapping_verify(vdev_indirect_mapping_t *vim) return (B_TRUE); } -#endif uint64_t vdev_indirect_mapping_num_entries(vdev_indirect_mapping_t *vim) diff --git a/module/zfs/vdev_initialize.c b/module/zfs/vdev_initialize.c index e9156c32f384..6ffd0d618fdd 100644 --- a/module/zfs/vdev_initialize.c +++ b/module/zfs/vdev_initialize.c @@ -255,10 +255,11 @@ vdev_initialize_write(vdev_t *vd, uint64_t start, uint64_t size, abd_t *data) * divisible by sizeof (uint64_t), and buf must be 8-byte aligned. The ABD * allocation will guarantee these for us. */ -/* ARGSUSED */ static int vdev_initialize_block_fill(void *buf, size_t len, void *unused) { + (void) unused; + ASSERT0(len % sizeof (uint64_t)); #ifdef _ILP32 for (uint64_t i = 0; i < len; i += sizeof (uint32_t)) { @@ -624,6 +625,7 @@ vdev_initialize_stop_wait_impl(vdev_t *vd) void vdev_initialize_stop_wait(spa_t *spa, list_t *vd_list) { + (void) spa; vdev_t *vd; ASSERT(MUTEX_HELD(&spa_namespace_lock)); diff --git a/module/zfs/vdev_mirror.c b/module/zfs/vdev_mirror.c index 106678a8708e..8ea866c59667 100644 --- a/module/zfs/vdev_mirror.c +++ b/module/zfs/vdev_mirror.c @@ -880,6 +880,8 @@ static uint64_t vdev_mirror_rebuild_asize(vdev_t *vd, uint64_t start, uint64_t asize, uint64_t max_segment) { + (void) start; + uint64_t psize = MIN(P2ROUNDUP(max_segment, 1 << vd->vdev_ashift), SPA_MAXBLOCKSIZE); diff --git a/module/zfs/vdev_missing.c b/module/zfs/vdev_missing.c index e9145fd012d7..ab256765c274 100644 --- a/module/zfs/vdev_missing.c +++ b/module/zfs/vdev_missing.c @@ -42,11 +42,12 @@ #include #include -/* ARGSUSED */ static int vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, uint64_t *ashift, uint64_t *pshift) { + (void) vd; + /* * Really this should just fail. But then the root vdev will be in the * faulted state with VDEV_AUX_NO_REPLICAS, when what we really want is @@ -60,13 +61,12 @@ vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, return (0); } -/* ARGSUSED */ static void vdev_missing_close(vdev_t *vd) { + (void) vd; } -/* ARGSUSED */ static void vdev_missing_io_start(zio_t *zio) { @@ -74,10 +74,10 @@ vdev_missing_io_start(zio_t *zio) zio_execute(zio); } -/* ARGSUSED */ static void vdev_missing_io_done(zio_t *zio) { + (void) zio; } vdev_ops_t vdev_missing_ops = { diff --git a/module/zfs/vdev_raidz.c b/module/zfs/vdev_raidz.c index 1feebf7089b4..077c2a6534fe 100644 --- a/module/zfs/vdev_raidz.c +++ b/module/zfs/vdev_raidz.c @@ -545,10 +545,11 @@ vdev_raidz_generate_parity(raidz_map_t *rm) } } -/* ARGSUSED */ static int vdev_raidz_reconst_p_func(void *dbuf, void *sbuf, size_t size, void *private) { + (void) private; + uint64_t *dst = dbuf; uint64_t *src = sbuf; int cnt = size / sizeof (src[0]); @@ -560,11 +561,12 @@ vdev_raidz_reconst_p_func(void *dbuf, void *sbuf, size_t size, void *private) return (0); } -/* ARGSUSED */ static int vdev_raidz_reconst_q_pre_func(void *dbuf, void *sbuf, size_t size, void *private) { + (void) private; + uint64_t *dst = dbuf; uint64_t *src = sbuf; uint64_t mask; @@ -578,10 +580,11 @@ vdev_raidz_reconst_q_pre_func(void *dbuf, void *sbuf, size_t size, return (0); } -/* ARGSUSED */ static int vdev_raidz_reconst_q_pre_tail_func(void *buf, size_t size, void *private) { + (void) private; + uint64_t *dst = buf; uint64_t mask; int cnt = size / sizeof (dst[0]); @@ -2398,6 +2401,8 @@ static void vdev_raidz_xlate(vdev_t *cvd, const range_seg64_t *logical_rs, range_seg64_t *physical_rs, range_seg64_t *remain_rs) { + (void) remain_rs; + vdev_t *raidvd = cvd->vdev_parent; ASSERT(raidvd->vdev_ops == &vdev_raidz_ops); diff --git a/module/zfs/vdev_removal.c b/module/zfs/vdev_removal.c index d7c0641c8c2c..f935ee5dd4d7 100644 --- a/module/zfs/vdev_removal.c +++ b/module/zfs/vdev_removal.c @@ -345,8 +345,10 @@ vdev_remove_initiate_sync(void *arg, dmu_tx_t *tx) vdev_config_dirty(vd); zfs_dbgmsg("starting removal thread for vdev %llu (%px) in txg %llu " - "im_obj=%llu", vd->vdev_id, vd, dmu_tx_get_txg(tx), - vic->vic_mapping_object); + "im_obj=%llu", + (u_longlong_t)vd->vdev_id, vd, + (u_longlong_t)dmu_tx_get_txg(tx), + (u_longlong_t)vic->vic_mapping_object); spa_history_log_internal(spa, "vdev remove started", tx, "%s vdev %llu %s", spa_name(spa), (u_longlong_t)vd->vdev_id, @@ -474,7 +476,8 @@ spa_restart_removal(spa_t *spa) if (!spa_writeable(spa)) return; - zfs_dbgmsg("restarting removal of %llu", svr->svr_vdev_id); + zfs_dbgmsg("restarting removal of %llu", + (u_longlong_t)svr->svr_vdev_id); svr->svr_thread = thread_create(NULL, 0, spa_vdev_remove_thread, spa, 0, &p0, TS_RUN, minclsyspri); } @@ -1196,7 +1199,7 @@ vdev_remove_complete(spa_t *spa) ESC_ZFS_VDEV_REMOVE_DEV); zfs_dbgmsg("finishing device removal for vdev %llu in txg %llu", - vd->vdev_id, txg); + (u_longlong_t)vd->vdev_id, (u_longlong_t)txg); /* * Discard allocation state. @@ -1490,8 +1493,9 @@ spa_vdev_remove_thread(void *arg) vca.vca_msp = msp; zfs_dbgmsg("copying %llu segments for metaslab %llu", + (u_longlong_t) zfs_btree_numnodes(&svr->svr_allocd_segs->rt_root), - msp->ms_id); + (u_longlong_t)msp->ms_id); while (!svr->svr_thread_exit && !range_tree_is_empty(svr->svr_allocd_segs)) { @@ -1588,8 +1592,8 @@ spa_vdev_remove_thread(void *arg) vca.vca_write_error_bytes > 0)) { zfs_dbgmsg("canceling removal due to IO errors: " "[read_error_bytes=%llu] [write_error_bytes=%llu]", - vca.vca_read_error_bytes, - vca.vca_write_error_bytes); + (u_longlong_t)vca.vca_read_error_bytes, + (u_longlong_t)vca.vca_write_error_bytes); spa_vdev_remove_cancel_impl(spa); } } else { @@ -1616,10 +1620,10 @@ spa_vdev_remove_suspend(spa_t *spa) mutex_exit(&svr->svr_lock); } -/* ARGSUSED */ static int spa_vdev_remove_cancel_check(void *arg, dmu_tx_t *tx) { + (void) arg; spa_t *spa = dmu_tx_pool(tx)->dp_spa; if (spa->spa_vdev_removal == NULL) @@ -1631,10 +1635,11 @@ spa_vdev_remove_cancel_check(void *arg, dmu_tx_t *tx) * Cancel a removal by freeing all entries from the partial mapping * and marking the vdev as no longer being removing. */ -/* ARGSUSED */ static void spa_vdev_remove_cancel_sync(void *arg, dmu_tx_t *tx) { + (void) arg; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; spa_vdev_removal_t *svr = spa->spa_vdev_removal; vdev_t *vd = vdev_lookup_top(spa, svr->svr_vdev_id); @@ -1761,7 +1766,7 @@ spa_vdev_remove_cancel_sync(void *arg, dmu_tx_t *tx) vdev_config_dirty(vd); zfs_dbgmsg("canceled device removal for vdev %llu in %llu", - vd->vdev_id, dmu_tx_get_txg(tx)); + (u_longlong_t)vd->vdev_id, (u_longlong_t)dmu_tx_get_txg(tx)); spa_history_log_internal(spa, "vdev remove canceled", tx, "%s vdev %llu %s", spa_name(spa), (u_longlong_t)vd->vdev_id, diff --git a/module/zfs/vdev_trim.c b/module/zfs/vdev_trim.c index deea7fedd770..2bae33b2b532 100644 --- a/module/zfs/vdev_trim.c +++ b/module/zfs/vdev_trim.c @@ -1003,6 +1003,7 @@ vdev_trim_stop_wait_impl(vdev_t *vd) void vdev_trim_stop_wait(spa_t *spa, list_t *vd_list) { + (void) spa; vdev_t *vd; ASSERT(MUTEX_HELD(&spa_namespace_lock)); diff --git a/module/zfs/zap.c b/module/zfs/zap.c index c0c280c52076..888fd66bc012 100644 --- a/module/zfs/zap.c +++ b/module/zfs/zap.c @@ -221,7 +221,8 @@ zap_table_grow(zap_t *zap, zap_table_phys_t *tbl, tbl->zt_blks_copied++; dprintf("copied block %llu of %llu\n", - tbl->zt_blks_copied, tbl->zt_numblks); + (u_longlong_t)tbl->zt_blks_copied, + (u_longlong_t)tbl->zt_numblks); if (tbl->zt_blks_copied == tbl->zt_numblks) { (void) dmu_free_range(zap->zap_objset, zap->zap_object, @@ -234,7 +235,8 @@ zap_table_grow(zap_t *zap, zap_table_phys_t *tbl, tbl->zt_blks_copied = 0; dprintf("finished; numblocks now %llu (%uk entries)\n", - tbl->zt_numblks, 1<<(tbl->zt_shift-10)); + (u_longlong_t)tbl->zt_numblks, + 1 << (tbl->zt_shift - 10)); } return (0); @@ -249,7 +251,8 @@ zap_table_store(zap_t *zap, zap_table_phys_t *tbl, uint64_t idx, uint64_t val, ASSERT(RW_LOCK_HELD(&zap->zap_rwlock)); ASSERT(tbl->zt_blk != 0); - dprintf("storing %llx at index %llx\n", val, idx); + dprintf("storing %llx at index %llx\n", + (u_longlong_t)val, (u_longlong_t)idx); uint64_t blk = idx >> (bs-3); uint64_t off = idx & ((1<<(bs-3))-1); diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c index 5d9bc2076068..b4611685b204 100644 --- a/module/zfs/zap_micro.c +++ b/module/zfs/zap_micro.c @@ -563,7 +563,7 @@ zap_lockdir_impl(dmu_buf_t *db, void *tag, dmu_tx_t *tx, uint64_t newsz = db->db_size + SPA_MINBLOCKSIZE; if (newsz > MZAP_MAX_BLKSZ) { dprintf("upgrading obj %llu: num_entries=%u\n", - obj, zap->zap_m.zap_num_entries); + (u_longlong_t)obj, zap->zap_m.zap_num_entries); *zapp = zap; int err = mzap_upgrade(zapp, tag, tx, 0); if (err != 0) @@ -656,7 +656,7 @@ mzap_upgrade(zap_t **zapp, void *tag, dmu_tx_t *tx, zap_flags_t flags) } dprintf("upgrading obj=%llu with %u chunks\n", - zap->zap_object, nchunks); + (u_longlong_t)zap->zap_object, nchunks); /* XXX destroy the avl later, so we can use the stored hash value */ mze_destroy(zap); @@ -667,7 +667,7 @@ mzap_upgrade(zap_t **zapp, void *tag, dmu_tx_t *tx, zap_flags_t flags) if (mze->mze_name[0] == 0) continue; dprintf("adding %s=%llu\n", - mze->mze_name, mze->mze_value); + mze->mze_name, (u_longlong_t)mze->mze_value); zap_name_t *zn = zap_name_alloc(zap, mze->mze_name, 0); /* If we fail here, we would end up losing entries */ VERIFY0(fzap_add_cd(zn, 8, 1, &mze->mze_value, mze->mze_cd, @@ -1339,7 +1339,8 @@ zap_update(objset_t *os, uint64_t zapobj, const char *name, } else if (integer_size != 8 || num_integers != 1 || strlen(name) >= MZAP_NAME_LEN) { dprintf("upgrading obj %llu: intsz=%u numint=%llu name=%s\n", - zapobj, integer_size, num_integers, name); + (u_longlong_t)zapobj, integer_size, + (u_longlong_t)num_integers, name); err = mzap_upgrade(&zn->zn_zap, FTAG, tx, 0); if (err == 0) { err = fzap_update(zn, integer_size, num_integers, diff --git a/module/zfs/zcp.c b/module/zfs/zcp.c index 1ad53eae1eef..756c26559225 100644 --- a/module/zfs/zcp.c +++ b/module/zfs/zcp.c @@ -654,7 +654,8 @@ zcp_debug(lua_State *state) dbgstring = lua_tostring(state, 1); - zfs_dbgmsg("txg %lld ZCP: %s", ri->zri_tx->tx_txg, dbgstring); + zfs_dbgmsg("txg %lld ZCP: %s", + (u_longlong_t)ri->zri_tx->tx_txg, dbgstring); return (0); } @@ -768,10 +769,11 @@ zcp_lua_alloc(void *ud, void *ptr, size_t osize, size_t nsize) } } -/* ARGSUSED */ static void zcp_lua_counthook(lua_State *state, lua_Debug *ar) { + (void) ar; + lua_getfield(state, LUA_REGISTRYINDEX, ZCP_RUN_INFO_KEY); zcp_run_info_t *ri = lua_touserdata(state, -1); @@ -973,10 +975,10 @@ zcp_pool_error(zcp_run_info_t *ri, const char *poolname) * The txg_wait_synced_sig will continue to wait for the txg to complete * after calling this callback. */ -/* ARGSUSED */ static void zcp_eval_sig(void *arg, dmu_tx_t *tx) { + (void) tx; zcp_run_info_t *ri = arg; ri->zri_canceled = B_TRUE; diff --git a/module/zfs/zcp_get.c b/module/zfs/zcp_get.c index 7256e4de1915..9a2119a660b9 100644 --- a/module/zfs/zcp_get.c +++ b/module/zfs/zcp_get.c @@ -230,7 +230,7 @@ get_special_prop(lua_State *state, dsl_dataset_t *ds, const char *dsname, char *strval = kmem_alloc(ZAP_MAXVALUELEN, KM_SLEEP); char setpoint[ZFS_MAX_DATASET_NAME_LEN] = "Internal error - setpoint not determined"; - zfs_type_t ds_type; + zfs_type_t ds_type = -1; zprop_type_t prop_type = zfs_prop_get_type(zfs_prop); (void) get_objset_type(ds, &ds_type); diff --git a/module/zfs/zcp_synctask.c b/module/zfs/zcp_synctask.c index 4e0fa0d85cbf..95f4b137740d 100644 --- a/module/zfs/zcp_synctask.c +++ b/module/zfs/zcp_synctask.c @@ -123,10 +123,10 @@ static zcp_synctask_info_t zcp_synctask_destroy_info = { .blocks_modified = 0 }; -/* ARGSUSED */ static int zcp_synctask_destroy(lua_State *state, boolean_t sync, nvlist_t *err_details) { + (void) err_details; int err; const char *dsname = lua_tostring(state, 1); @@ -245,10 +245,10 @@ static zcp_synctask_info_t zcp_synctask_snapshot_info = { .blocks_modified = 3 }; -/* ARGSUSED */ static int zcp_synctask_snapshot(lua_State *state, boolean_t sync, nvlist_t *err_details) { + (void) err_details; int err; dsl_dataset_snapshot_arg_t ddsa = { 0 }; const char *dsname = lua_tostring(state, 1); @@ -348,6 +348,8 @@ static int zcp_synctask_inherit_prop(lua_State *state, boolean_t sync, nvlist_t *err_details) { + (void) err_details; + int err; zcp_inherit_prop_arg_t zipa = { 0 }; dsl_props_set_arg_t *dpsa = &zipa.zipa_dpsa; @@ -390,10 +392,11 @@ static zcp_synctask_info_t zcp_synctask_bookmark_info = { .blocks_modified = 1, }; -/* ARGSUSED */ static int zcp_synctask_bookmark(lua_State *state, boolean_t sync, nvlist_t *err_details) { + (void) err_details; + int err; const char *source = lua_tostring(state, 1); const char *new = lua_tostring(state, 2); @@ -437,6 +440,8 @@ static zcp_synctask_info_t zcp_synctask_set_prop_info = { static int zcp_synctask_set_prop(lua_State *state, boolean_t sync, nvlist_t *err_details) { + (void) err_details; + int err; zcp_set_prop_arg_t args = { 0 }; diff --git a/module/zfs/zfs_byteswap.c b/module/zfs/zfs_byteswap.c index cd35849c3f37..dd4722d1e140 100644 --- a/module/zfs/zfs_byteswap.c +++ b/module/zfs/zfs_byteswap.c @@ -30,6 +30,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + #ifndef _KERNEL static #endif @@ -138,7 +140,6 @@ zfs_ace_byteswap(void *buf, size_t size, boolean_t zfs_layout) } } -/* ARGSUSED */ void zfs_oldacl_byteswap(void *buf, size_t size) { @@ -154,7 +155,6 @@ zfs_oldacl_byteswap(void *buf, size_t size) zfs_oldace_byteswap((ace_t *)buf, cnt); } -/* ARGSUSED */ void zfs_acl_byteswap(void *buf, size_t size) { diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c index 60e631567a89..9a454107dfd2 100644 --- a/module/zfs/zfs_fm.c +++ b/module/zfs/zfs_fm.c @@ -39,6 +39,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * This general routine is responsible for generating all the different ZFS * ereports. The payload is dependent on the class, and which arguments are @@ -205,10 +207,10 @@ static void zfs_ereport_schedule_cleaner(void); /* * background task to clean stale recent event nodes. */ -/*ARGSUSED*/ static void zfs_ereport_cleaner(void *arg) { + (void) arg; recent_events_node_t *entry; uint64_t now = gethrtime(); @@ -992,10 +994,11 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *info, return (eip); } #else -/*ARGSUSED*/ void zfs_ereport_clear(spa_t *spa, vdev_t *vd) { + (void) spa; + (void) vd; } #endif @@ -1072,6 +1075,11 @@ zfs_ereport_is_valid(const char *subclass, spa_t *spa, vdev_t *vd, zio_t *zio) (zio != NULL) && (!zio->io_timestamp)) { return (B_FALSE); } +#else + (void) subclass; + (void) spa; + (void) vd; + (void) zio; #endif return (B_TRUE); } @@ -1112,6 +1120,13 @@ zfs_ereport_post(const char *subclass, spa_t *spa, vdev_t *vd, /* Cleanup is handled by the callback function */ rc = zfs_zevent_post(ereport, detector, zfs_zevent_post_cb); +#else + (void) subclass; + (void) spa; + (void) vd; + (void) zb; + (void) zio; + (void) state; #endif return (rc); } @@ -1141,6 +1156,9 @@ zfs_ereport_start_checksum(spa_t *spa, vdev_t *vd, const zbookmark_phys_t *zb, if (zfs_is_ratelimiting_event(FM_EREPORT_ZFS_CHECKSUM, vd)) return (SET_ERROR(EBUSY)); +#else + (void) zb; + (void) offset; #endif report = kmem_zalloc(sizeof (*report), KM_SLEEP); @@ -1193,6 +1211,11 @@ zfs_ereport_finish_checksum(zio_cksum_report_t *report, const abd_t *good_data, report->zcr_ereport = report->zcr_detector = NULL; if (info != NULL) kmem_free(info, sizeof (*info)); +#else + (void) report; + (void) good_data; + (void) bad_data; + (void) drop_if_identical; #endif } @@ -1257,6 +1280,16 @@ zfs_ereport_post_checksum(spa_t *spa, vdev_t *vd, const zbookmark_phys_t *zb, rc = zfs_zevent_post(ereport, detector, zfs_zevent_post_cb); kmem_free(info, sizeof (*info)); } +#else + (void) spa; + (void) vd; + (void) zb; + (void) zio; + (void) offset; + (void) length; + (void) good_data; + (void) bad_data; + (void) zbc; #endif return (rc); } @@ -1321,7 +1354,12 @@ zfs_event_create(spa_t *spa, vdev_t *vd, const char *type, const char *name, while ((elem = nvlist_next_nvpair(aux, elem)) != NULL) (void) nvlist_add_nvpair(resource, elem); } - +#else + (void) spa; + (void) vd; + (void) type; + (void) name; + (void) aux; #endif return (resource); } @@ -1336,6 +1374,12 @@ zfs_post_common(spa_t *spa, vdev_t *vd, const char *type, const char *name, resource = zfs_event_create(spa, vd, type, name, aux); if (resource) zfs_zevent_post(resource, NULL, zfs_zevent_post_cb); +#else + (void) spa; + (void) vd; + (void) type; + (void) name; + (void) aux; #endif } @@ -1399,6 +1443,10 @@ zfs_post_state_change(spa_t *spa, vdev_t *vd, uint64_t laststate) if (aux) fm_nvlist_destroy(aux, FM_NVA_FREE); +#else + (void) spa; + (void) vd; + (void) laststate; #endif } diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index df96378e2c0a..1ea4c0c7b3ae 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -221,6 +221,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + kmutex_t zfsdev_state_lock; zfsdev_state_t *zfsdev_state_list; @@ -373,10 +375,12 @@ zfs_log_history(zfs_cmd_t *zc) * Policy for top-level read operations (list pools). Requires no privileges, * and can be used in the local zone, as there is no associated dataset. */ -/* ARGSUSED */ static int zfs_secpolicy_none(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; + (void) innvl; + (void) cr; return (0); } @@ -384,10 +388,12 @@ zfs_secpolicy_none(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) * Policy for dataset read operations (list children, get statistics). Requires * no privileges, but must be visible in the local zone. */ -/* ARGSUSED */ static int zfs_secpolicy_read(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; + (void) cr; + if (INGLOBALZONE(curproc) || zone_dataset_visible(zc->zc_name, NULL)) return (0); @@ -596,6 +602,9 @@ zfs_set_slabel_policy(const char *name, const char *strval, cred_t *cr) return (PRIV_POLICY(cr, needed_priv, B_FALSE, EPERM, NULL)); return (0); #else + (void) name; + (void) strval; + (void) cr; return (SET_ERROR(ENOTSUP)); #endif /* HAVE_MLSLABEL */ } @@ -656,10 +665,10 @@ zfs_secpolicy_setprop(const char *dsname, zfs_prop_t prop, nvpair_t *propval, return (zfs_secpolicy_write_perms(dsname, zfs_prop_to_name(prop), cr)); } -/* ARGSUSED */ static int zfs_secpolicy_set_fsacl(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; int error; error = zfs_dozonecheck(zc->zc_name, cr); @@ -673,18 +682,19 @@ zfs_secpolicy_set_fsacl(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) return (0); } -/* ARGSUSED */ static int zfs_secpolicy_rollback(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; return (zfs_secpolicy_write_perms(zc->zc_name, ZFS_DELEG_PERM_ROLLBACK, cr)); } -/* ARGSUSED */ static int zfs_secpolicy_send(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; + (void) cr; dsl_pool_t *dp; dsl_dataset_t *ds; const char *cp; @@ -717,10 +727,10 @@ zfs_secpolicy_send(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) return (error); } -/* ARGSUSED */ static int zfs_secpolicy_send_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; return (zfs_secpolicy_write_perms(zc->zc_name, ZFS_DELEG_PERM_SEND, cr)); } @@ -728,12 +738,18 @@ zfs_secpolicy_send_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) static int zfs_secpolicy_share(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; + (void) innvl; + (void) cr; return (SET_ERROR(ENOTSUP)); } static int zfs_secpolicy_smb_acl(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; + (void) innvl; + (void) cr; return (SET_ERROR(ENOTSUP)); } @@ -771,10 +787,12 @@ zfs_secpolicy_destroy_perms(const char *name, cred_t *cr) return (zfs_secpolicy_write_perms(name, ZFS_DELEG_PERM_DESTROY, cr)); } -/* ARGSUSED */ static int zfs_secpolicy_destroy(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; + (void) innvl; + (void) cr; return (zfs_secpolicy_destroy_perms(zc->zc_name, cr)); } @@ -782,10 +800,10 @@ zfs_secpolicy_destroy(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) * Destroying snapshots with delegated permissions requires * descendant mount and destroy permissions. */ -/* ARGSUSED */ static int zfs_secpolicy_destroy_snaps(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; nvlist_t *snaps; nvpair_t *pair, *nextpair; int error = 0; @@ -844,17 +862,17 @@ zfs_secpolicy_rename_perms(const char *from, const char *to, cred_t *cr) return (error); } -/* ARGSUSED */ static int zfs_secpolicy_rename(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; return (zfs_secpolicy_rename_perms(zc->zc_name, zc->zc_value, cr)); } -/* ARGSUSED */ static int zfs_secpolicy_promote(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; dsl_pool_t *dp; dsl_dataset_t *clone; int error; @@ -899,10 +917,10 @@ zfs_secpolicy_promote(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) return (error); } -/* ARGSUSED */ static int zfs_secpolicy_recv(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; int error; if ((error = zfs_secpolicy_write_perms(zc->zc_name, @@ -917,7 +935,6 @@ zfs_secpolicy_recv(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) ZFS_DELEG_PERM_CREATE, cr)); } -/* ARGSUSED */ static int zfs_secpolicy_recv_new(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { @@ -934,10 +951,10 @@ zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr) /* * Check for permission to create each snapshot in the nvlist. */ -/* ARGSUSED */ static int zfs_secpolicy_snapshot(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; nvlist_t *snaps; int error = 0; nvpair_t *pair; @@ -965,10 +982,10 @@ zfs_secpolicy_snapshot(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) /* * Check for permission to create each bookmark in the nvlist. */ -/* ARGSUSED */ static int zfs_secpolicy_bookmark(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; int error = 0; for (nvpair_t *pair = nvlist_next_nvpair(innvl, NULL); @@ -990,10 +1007,10 @@ zfs_secpolicy_bookmark(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) return (error); } -/* ARGSUSED */ static int zfs_secpolicy_destroy_bookmarks(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; nvpair_t *pair, *nextpair; int error = 0; @@ -1031,10 +1048,13 @@ zfs_secpolicy_destroy_bookmarks(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) return (error); } -/* ARGSUSED */ static int zfs_secpolicy_log_history(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; + (void) innvl; + (void) cr; + /* * Even root must have a proper TSD so that we know what pool * to log to. @@ -1072,10 +1092,12 @@ zfs_secpolicy_create_clone(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) * Policy for pool operations - create/destroy pools, add vdevs, etc. Requires * SYS_CONFIG privilege, which is not available in a local zone. */ -/* ARGSUSED */ int zfs_secpolicy_config(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; + (void) innvl; + if (secpolicy_sys_config(cr, B_FALSE) != 0) return (SET_ERROR(EPERM)); @@ -1085,10 +1107,10 @@ zfs_secpolicy_config(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) /* * Policy for object to name lookups. */ -/* ARGSUSED */ static int zfs_secpolicy_diff(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; int error; if ((error = secpolicy_sys_config(cr, B_FALSE)) == 0) @@ -1101,17 +1123,19 @@ zfs_secpolicy_diff(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) /* * Policy for fault injection. Requires all privileges. */ -/* ARGSUSED */ static int zfs_secpolicy_inject(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; + (void) innvl; + return (secpolicy_zinject(cr)); } -/* ARGSUSED */ static int zfs_secpolicy_inherit_prop(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; zfs_prop_t prop = zfs_name_to_prop(zc->zc_value); if (prop == ZPROP_INVAL) { @@ -1174,18 +1198,18 @@ zfs_secpolicy_userspace_many(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) userquota_perms[zc->zc_objset_type], cr)); } -/* ARGSUSED */ static int zfs_secpolicy_userspace_upgrade(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; return (zfs_secpolicy_setprop(zc->zc_name, ZFS_PROP_VERSION, NULL, cr)); } -/* ARGSUSED */ static int zfs_secpolicy_hold(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; nvpair_t *pair; nvlist_t *holds; int error; @@ -1206,10 +1230,10 @@ zfs_secpolicy_hold(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) return (0); } -/* ARGSUSED */ static int zfs_secpolicy_release(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) zc; nvpair_t *pair; int error; @@ -1260,6 +1284,7 @@ zfs_secpolicy_tmp_snapshot(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) static int zfs_secpolicy_load_key(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; return (zfs_secpolicy_write_perms(zc->zc_name, ZFS_DELEG_PERM_LOAD_KEY, cr)); } @@ -1267,6 +1292,7 @@ zfs_secpolicy_load_key(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) static int zfs_secpolicy_change_key(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { + (void) innvl; return (zfs_secpolicy_write_perms(zc->zc_name, ZFS_DELEG_PERM_CHANGE_KEY, cr)); } @@ -3025,7 +3051,6 @@ zfs_ioc_get_fsacl(zfs_cmd_t *zc) return (error); } -/* ARGSUSED */ static void zfs_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx) { @@ -3387,11 +3412,14 @@ static const zfs_ioc_key_t zfs_keys_remap[] = { /* no nvl keys */ }; -/* ARGSUSED */ static int zfs_ioc_remap(const char *fsname, nvlist_t *innvl, nvlist_t *outnvl) { - /* This IOCTL is no longer supported. */ + (void) fsname; + (void) innvl; + (void) outnvl; + + /* This ioctl is no longer supported. */ return (0); } @@ -3479,10 +3507,11 @@ static const zfs_ioc_key_t zfs_keys_log_history[] = { {"message", DATA_TYPE_STRING, 0}, }; -/* ARGSUSED */ static int zfs_ioc_log_history(const char *unused, nvlist_t *innvl, nvlist_t *outnvl) { + (void) unused; + (void) outnvl; const char *message; char *poolname; spa_t *spa; @@ -3535,6 +3564,7 @@ static const zfs_ioc_key_t zfs_keys_set_bootenv[] = { static int zfs_ioc_set_bootenv(const char *name, nvlist_t *innvl, nvlist_t *outnvl) { + (void) outnvl; int error; spa_t *spa; @@ -3554,6 +3584,7 @@ static const zfs_ioc_key_t zfs_keys_get_bootenv[] = { static int zfs_ioc_get_bootenv(const char *name, nvlist_t *innvl, nvlist_t *outnvl) { + (void) innvl; spa_t *spa; int error; @@ -3585,10 +3616,10 @@ zfs_unmount_snap(const char *snapname) (void) zfsctl_snapshot_unmount(snapname, MNT_FORCE); } -/* ARGSUSED */ static int zfs_unmount_snap_cb(const char *snapname, void *arg) { + (void) arg; zfs_unmount_snap(snapname); return (0); } @@ -3632,7 +3663,6 @@ static const zfs_ioc_key_t zfs_keys_destroy_snaps[] = { {"defer", DATA_TYPE_BOOLEAN, ZK_OPTIONAL}, }; -/* ARGSUSED */ static int zfs_ioc_destroy_snaps(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { @@ -3685,10 +3715,10 @@ static const zfs_ioc_key_t zfs_keys_bookmark[] = { {"...", DATA_TYPE_STRING, ZK_WILDCARDLIST}, }; -/* ARGSUSED */ static int zfs_ioc_bookmark(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) poolname; return (dsl_bookmark_create(innvl, outnvl)); } @@ -3725,11 +3755,11 @@ static const zfs_ioc_key_t zfs_keys_get_bookmark_props[] = { /* no nvl keys */ }; -/* ARGSUSED */ static int zfs_ioc_get_bookmark_props(const char *bookmark, nvlist_t *innvl, nvlist_t *outnvl) { + (void) innvl; char fsname[ZFS_MAX_DATASET_NAME_LEN]; char *bmname; @@ -3834,10 +3864,11 @@ static const zfs_ioc_key_t zfs_keys_pool_checkpoint[] = { /* no nvl keys */ }; -/* ARGSUSED */ static int zfs_ioc_pool_checkpoint(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) innvl; + (void) outnvl; return (spa_checkpoint(poolname)); } @@ -3849,11 +3880,12 @@ static const zfs_ioc_key_t zfs_keys_pool_discard_checkpoint[] = { /* no nvl keys */ }; -/* ARGSUSED */ static int zfs_ioc_pool_discard_checkpoint(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) innvl; + (void) outnvl; return (spa_checkpoint_discard(poolname)); } @@ -4215,7 +4247,6 @@ static const zfs_ioc_key_t zfs_keys_rollback[] = { {"target", DATA_TYPE_STRING, ZK_OPTIONAL}, }; -/* ARGSUSED */ static int zfs_ioc_rollback(const char *fsname, nvlist_t *innvl, nvlist_t *outnvl) { @@ -4287,7 +4318,6 @@ recursive_unmount(const char *fsname, void *arg) * outnvl is unused */ -/* ARGSUSED */ static const zfs_ioc_key_t zfs_keys_redact[] = { {"bookname", DATA_TYPE_STRING, 0}, {"snapnv", DATA_TYPE_NVLIST, 0}, @@ -4295,6 +4325,7 @@ static const zfs_ioc_key_t zfs_keys_redact[] = { static int zfs_ioc_redact(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) outnvl; nvlist_t *redactnvl = NULL; char *redactbook = NULL; @@ -5243,6 +5274,7 @@ static const zfs_ioc_key_t zfs_keys_recv_new[] = { static int zfs_ioc_recv_new(const char *fsname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) fsname; dmu_replay_record_t *begin_record; uint_t begin_record_size; nvlist_t *errors = NULL; @@ -5343,6 +5375,7 @@ dump_bytes(objset_t *os, void *buf, int len, void *arg) dbi.dbi_len = len; #if defined(HAVE_LARGE_STACKS) + (void) os; dump_bytes_cb(&dbi); #else /* @@ -5676,10 +5709,10 @@ static const zfs_ioc_key_t zfs_keys_pool_reopen[] = { {"scrub_restart", DATA_TYPE_BOOLEAN_VALUE, ZK_OPTIONAL}, }; -/* ARGSUSED */ static int zfs_ioc_pool_reopen(const char *pool, nvlist_t *innvl, nvlist_t *outnvl) { + (void) outnvl; spa_t *spa; int error; boolean_t rc, scrub_restart = B_TRUE; @@ -5975,6 +6008,7 @@ zfs_ioc_id_quota_upgrade(zfs_cmd_t *zc) static int zfs_ioc_share(zfs_cmd_t *zc) { + (void) zc; return (SET_ERROR(ENOSYS)); } @@ -6072,6 +6106,7 @@ zfs_ioc_diff(zfs_cmd_t *zc) static int zfs_ioc_smb_acl(zfs_cmd_t *zc) { + (void) zc; return (SET_ERROR(ENOTSUP)); } @@ -6091,10 +6126,10 @@ static const zfs_ioc_key_t zfs_keys_hold[] = { {"cleanup_fd", DATA_TYPE_INT32, ZK_OPTIONAL}, }; -/* ARGSUSED */ static int zfs_ioc_hold(const char *pool, nvlist_t *args, nvlist_t *errlist) { + (void) pool; nvpair_t *pair; nvlist_t *holds; int cleanup_fd = -1; @@ -6140,10 +6175,10 @@ static const zfs_ioc_key_t zfs_keys_get_holds[] = { /* no nvl keys */ }; -/* ARGSUSED */ static int zfs_ioc_get_holds(const char *snapname, nvlist_t *args, nvlist_t *outnvl) { + (void) args; return (dsl_dataset_get_holds(snapname, outnvl)); } @@ -6162,10 +6197,10 @@ static const zfs_ioc_key_t zfs_keys_release[] = { {"...", DATA_TYPE_NVLIST, ZK_WILDCARDLIST}, }; -/* ARGSUSED */ static int zfs_ioc_release(const char *pool, nvlist_t *holds, nvlist_t *errlist) { + (void) pool; return (dsl_dataset_user_release(holds, errlist)); } @@ -6399,10 +6434,10 @@ static const zfs_ioc_key_t zfs_keys_send_new[] = { {"redactbook", DATA_TYPE_STRING, ZK_OPTIONAL}, }; -/* ARGSUSED */ static int zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) outnvl; int error; offset_t off; char *fromname = NULL; @@ -6449,10 +6484,12 @@ zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) return (error); } -/* ARGSUSED */ static int send_space_sum(objset_t *os, void *buf, int len, void *arg) { + (void) os; + (void) buf; + uint64_t *size = arg; *size += len; return (0); @@ -6645,10 +6682,11 @@ static const zfs_ioc_key_t zfs_keys_pool_sync[] = { {"force", DATA_TYPE_BOOLEAN_VALUE, 0}, }; -/* ARGSUSED */ static int zfs_ioc_pool_sync(const char *pool, nvlist_t *innvl, nvlist_t *onvl) { + (void) innvl; + (void) onvl; int err; boolean_t rc, force = B_FALSE; spa_t *spa; @@ -6688,10 +6726,10 @@ static const zfs_ioc_key_t zfs_keys_load_key[] = { {"noop", DATA_TYPE_BOOLEAN, ZK_OPTIONAL}, }; -/* ARGSUSED */ static int zfs_ioc_load_key(const char *dsname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) outnvl; int ret; dsl_crypto_params_t *dcp = NULL; nvlist_t *hidden_args; @@ -6730,10 +6768,11 @@ static const zfs_ioc_key_t zfs_keys_unload_key[] = { /* no nvl keys */ }; -/* ARGSUSED */ static int zfs_ioc_unload_key(const char *dsname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) innvl; + (void) outnvl; int ret = 0; if (strchr(dsname, '@') != NULL || strchr(dsname, '%') != NULL) { @@ -6768,10 +6807,10 @@ static const zfs_ioc_key_t zfs_keys_change_key[] = { {"props", DATA_TYPE_NVLIST, ZK_OPTIONAL}, }; -/* ARGSUSED */ static int zfs_ioc_change_key(const char *dsname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) outnvl; int ret; uint64_t cmd = DCP_CMD_NONE; dsl_crypto_params_t *dcp = NULL; diff --git a/module/zfs/zfs_replay.c b/module/zfs/zfs_replay.c index df96cfee7dbb..f9b447d7b4e7 100644 --- a/module/zfs/zfs_replay.c +++ b/module/zfs/zfs_replay.c @@ -48,6 +48,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * NB: FreeBSD expects to be able to do vnode locking in lookup and * hold the locks across all subsequent VOPs until vput is called. @@ -80,10 +82,12 @@ zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t mode, vap->va_nodeid = nodeid; } -/* ARGSUSED */ static int zfs_replay_error(void *arg1, void *arg2, boolean_t byteswap) { + (void) arg1; + (void) arg2; + (void) byteswap; return (SET_ERROR(ENOTSUP)); } diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 8229bc9a93e5..7e61fef3243b 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -55,12 +55,15 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" static ulong_t zfs_fsync_sync_cnt = 4; int zfs_fsync(znode_t *zp, int syncflag, cred_t *cr) { + (void) syncflag; + (void) cr; zfsvfs_t *zfsvfs = ZTOZSB(zp); (void) tsd_set(zfs_fsyncer_key, (void *)zfs_fsync_sync_cnt); @@ -147,7 +150,6 @@ zfs_holey(znode_t *zp, ulong_t cmd, loff_t *off) } #endif /* SEEK_HOLE && SEEK_DATA */ -/*ARGSUSED*/ int zfs_access(znode_t *zp, int mode, int flag, cred_t *cr) { @@ -185,10 +187,10 @@ static unsigned long zfs_vnops_read_chunk_size = 1024 * 1024; /* Tunable */ * Side Effects: * inode - atime updated if byte count > 0 */ -/* ARGSUSED */ int zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) { + (void) cr; int error = 0; boolean_t frsync = B_FALSE; @@ -312,7 +314,6 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) * ip - ctime|mtime updated if byte count > 0 */ -/* ARGSUSED */ int zfs_write(znode_t *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) { @@ -693,7 +694,6 @@ zfs_write(znode_t *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) return (0); } -/*ARGSUSED*/ int zfs_getsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr) { @@ -709,7 +709,6 @@ zfs_getsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr) return (error); } -/*ARGSUSED*/ int zfs_setsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr) { @@ -879,10 +878,10 @@ zfs_get_data(void *arg, uint64_t gen, lr_write_t *lr, char *buf, } -/* ARGSUSED */ static void zfs_get_done(zgd_t *zgd, int error) { + (void) error; znode_t *zp = zgd->zgd_private; if (zgd->zgd_db) diff --git a/module/zfs/zil.c b/module/zfs/zil.c index d9c3042084e3..556246cad174 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -430,11 +430,12 @@ zil_parse(zilog_t *zilog, zil_parse_blk_func_t *parse_blk_func, return (error); } -/* ARGSUSED */ static int zil_clear_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx, uint64_t first_txg) { + (void) tx; + ASSERT(!BP_IS_HOLE(bp)); /* @@ -453,11 +454,14 @@ zil_clear_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx, return (0); } -/* ARGSUSED */ static int zil_noop_log_record(zilog_t *zilog, const lr_t *lrc, void *tx, uint64_t first_txg) { + (void) zilog; + (void) lrc; + (void) tx; + (void) first_txg; return (0); } @@ -505,13 +509,13 @@ zil_claim_log_record(zilog_t *zilog, const lr_t *lrc, void *tx, return (zil_claim_log_block(zilog, &lr->lr_blkptr, tx, first_txg)); } -/* ARGSUSED */ static int 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); + (void) claim_txg; + zio_free(zilog->zl_spa, dmu_tx_get_txg(tx), bp); return (0); } @@ -909,10 +913,11 @@ zil_claim(dsl_pool_t *dp, dsl_dataset_t *ds, void *txarg) * Checksum errors are ok as they indicate the end of the chain. * Any other error (no device or read failure) returns an error. */ -/* ARGSUSED */ int zil_check_log_chain(dsl_pool_t *dp, dsl_dataset_t *ds, void *tx) { + (void) dp; + zilog_t *zilog; objset_t *os; blkptr_t *bp; @@ -1960,7 +1965,7 @@ zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *tx) * This should be rare. */ zfs_dbgmsg("zil_itx_assign: missed itx cleanup for " - "txg %llu", itxg->itxg_txg); + "txg %llu", (u_longlong_t)itxg->itxg_txg); clean = itxg->itxg_itxs; } itxg->itxg_txg = txg; @@ -3091,10 +3096,12 @@ zil_sync(zilog_t *zilog, dmu_tx_t *tx) mutex_exit(&zilog->zl_lock); } -/* ARGSUSED */ static int zil_lwb_cons(void *vbuf, void *unused, int kmflag) { + (void) unused; + (void) kmflag; + lwb_t *lwb = vbuf; list_create(&lwb->lwb_itxs, sizeof (itx_t), offsetof(itx_t, itx_node)); list_create(&lwb->lwb_waiters, sizeof (zil_commit_waiter_t), @@ -3105,10 +3112,11 @@ zil_lwb_cons(void *vbuf, void *unused, int kmflag) return (0); } -/* ARGSUSED */ static void zil_lwb_dest(void *vbuf, void *unused) { + (void) unused; + lwb_t *lwb = vbuf; mutex_destroy(&lwb->lwb_vdev_lock); avl_destroy(&lwb->lwb_vdev_tree); @@ -3285,7 +3293,8 @@ zil_close(zilog_t *zilog) txg_wait_synced(zilog->zl_dmu_pool, txg); if (zilog_is_dirty(zilog)) - zfs_dbgmsg("zil (%px) is dirty, txg %llu", zilog, txg); + zfs_dbgmsg("zil (%px) is dirty, txg %llu", + zilog, (u_longlong_t)txg); if (txg < spa_freeze_txg(zilog->zl_spa)) VERIFY(!zilog_is_dirty(zilog)); @@ -3578,12 +3587,14 @@ zil_replay_log_record(zilog_t *zilog, const lr_t *lr, void *zra, return (0); } -/* ARGSUSED */ static int zil_incr_blks(zilog_t *zilog, const blkptr_t *bp, void *arg, uint64_t claim_txg) { - zilog->zl_replay_blks++; + (void) bp; + (void) arg; + (void) claim_txg; + zilog->zl_replay_blks++; return (0); } @@ -3640,10 +3651,10 @@ zil_replaying(zilog_t *zilog, dmu_tx_t *tx) return (B_FALSE); } -/* ARGSUSED */ int zil_reset(const char *osname, void *arg) { + (void) arg; int error; error = zil_suspend(osname, NULL); diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 87ccb6861850..2d878dbbf44e 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -52,6 +52,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + /* * ========================================================================== * I/O type descriptions @@ -369,6 +371,7 @@ zio_data_buf_free(void *buf, size_t size) static void zio_abd_free(void *abd, size_t size) { + (void) size; abd_free((abd_t *)abd); } @@ -925,6 +928,7 @@ static int zfs_blkptr_verify_log(spa_t *spa, const blkptr_t *bp, enum blk_verify_flag blk_verify, const char *fmt, ...) { + (void) bp; va_list adx; char buf[256]; @@ -1073,6 +1077,8 @@ zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp, boolean_t config_held, boolean_t zfs_dva_valid(spa_t *spa, const dva_t *dva, const blkptr_t *bp) { + (void) bp; + uint64_t vdevid = DVA_GET_VDEV(dva); if (vdevid >= spa->spa_root_vdev->vdev_children) @@ -2022,13 +2028,16 @@ zio_deadman_impl(zio_t *pio, int ziodepth) "stage=0x%x pipeline=0x%x pipeline-trace=0x%x " "objset=%llu object=%llu level=%llu blkid=%llu " "offset=%llu size=%llu error=%d", - ziodepth, pio, pio->io_timestamp, - delta, pio->io_delta, pio->io_delay, + ziodepth, pio, (u_longlong_t)pio->io_timestamp, + (u_longlong_t)delta, (u_longlong_t)pio->io_delta, + (u_longlong_t)pio->io_delay, vd ? vd->vdev_path : "NULL", vq ? vq->vq_io_complete_ts : 0, pio->io_type, pio->io_priority, pio->io_flags, pio->io_stage, pio->io_pipeline, pio->io_pipeline_trace, - zb->zb_objset, zb->zb_object, zb->zb_level, zb->zb_blkid, - pio->io_offset, pio->io_size, pio->io_error); + (u_longlong_t)zb->zb_objset, (u_longlong_t)zb->zb_object, + (u_longlong_t)zb->zb_level, (u_longlong_t)zb->zb_blkid, + (u_longlong_t)pio->io_offset, (u_longlong_t)pio->io_size, + pio->io_error); (void) zfs_ereport_post(FM_EREPORT_ZFS_DEADMAN, pio->io_spa, vd, zb, pio, 0); @@ -2129,6 +2138,8 @@ zio_execute_stack_check(zio_t *zio) !zio_taskq_member(zio, ZIO_TASKQ_ISSUE) && !zio_taskq_member(zio, ZIO_TASKQ_ISSUE_HIGH)) return (B_TRUE); +#else + (void) zio; #endif /* HAVE_LARGE_STACKS */ return (B_FALSE); @@ -2540,11 +2551,14 @@ zio_rewrite_gang(zio_t *pio, blkptr_t *bp, zio_gang_node_t *gn, abd_t *data, return (zio); } -/* ARGSUSED */ static zio_t * zio_free_gang(zio_t *pio, blkptr_t *bp, zio_gang_node_t *gn, abd_t *data, uint64_t offset) { + (void) gn; + (void) data; + (void) offset; + zio_t *zio = zio_free_sync(pio, pio->io_spa, pio->io_txg, bp, ZIO_GANG_CHILD_FLAGS(pio)); if (zio == NULL) { @@ -2554,11 +2568,13 @@ zio_free_gang(zio_t *pio, blkptr_t *bp, zio_gang_node_t *gn, abd_t *data, return (zio); } -/* ARGSUSED */ static zio_t * zio_claim_gang(zio_t *pio, blkptr_t *bp, zio_gang_node_t *gn, abd_t *data, uint64_t offset) { + (void) gn; + (void) data; + (void) offset; return (zio_claim(pio, pio->io_spa, pio->io_txg, bp, NULL, NULL, ZIO_GANG_CHILD_FLAGS(pio))); } @@ -3536,7 +3552,8 @@ zio_dva_allocate(zio_t *zio) if (zfs_flags & ZFS_DEBUG_METASLAB_ALLOC) { zfs_dbgmsg("%s: metaslab allocation failure, " "trying normal class: zio %px, size %llu, error %d", - spa_name(spa), zio, zio->io_size, error); + spa_name(spa), zio, + (u_longlong_t)zio->io_size, error); } error = metaslab_alloc(spa, mc, zio->io_size, bp, @@ -3548,7 +3565,8 @@ zio_dva_allocate(zio_t *zio) if (zfs_flags & ZFS_DEBUG_METASLAB_ALLOC) { zfs_dbgmsg("%s: metaslab allocation failure, " "trying ganging: zio %px, size %llu, error %d", - spa_name(spa), zio, zio->io_size, error); + spa_name(spa), zio, + (u_longlong_t)zio->io_size, error); } return (zio_write_gang_block(zio, mc)); } @@ -3557,7 +3575,8 @@ zio_dva_allocate(zio_t *zio) (zfs_flags & ZFS_DEBUG_METASLAB_ALLOC)) { zfs_dbgmsg("%s: metaslab allocation failure: zio %px, " "size %llu, error %d", - spa_name(spa), zio, zio->io_size, error); + spa_name(spa), zio, + (u_longlong_t)zio->io_size, error); } zio->io_error = error; } @@ -3683,7 +3702,8 @@ zio_alloc_zil(spa_t *spa, objset_t *os, uint64_t txg, blkptr_t *new_bp, } } else { zfs_dbgmsg("%s: zil block allocation failure: " - "size %llu, error %d", spa_name(spa), size, error); + "size %llu, error %d", + spa_name(spa), (u_longlong_t)size, error); } return (error); @@ -3945,7 +3965,6 @@ zio_vsd_default_cksum_finish(zio_cksum_report_t *zcr, zfs_ereport_finish_checksum(zcr, good_buf, zcr->zcr_cbdata, B_FALSE); } -/*ARGSUSED*/ void zio_vsd_default_cksum_report(zio_t *zio, zio_cksum_report_t *zcr) { diff --git a/module/zfs/zio_checksum.c b/module/zfs/zio_checksum.c index f8fee78c6068..3cc208045f0c 100644 --- a/module/zfs/zio_checksum.c +++ b/module/zfs/zio_checksum.c @@ -91,29 +91,31 @@ * invocation and passed to the checksum function. */ -/*ARGSUSED*/ static void abd_checksum_off(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) abd; + (void) size; + (void) ctx_template; ZIO_SET_CHECKSUM(zcp, 0, 0, 0, 0); } -/*ARGSUSED*/ static void abd_fletcher_2_native(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; fletcher_init(zcp); (void) abd_iterate_func(abd, 0, size, fletcher_2_incremental_native, zcp); } -/*ARGSUSED*/ static void abd_fletcher_2_byteswap(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; fletcher_init(zcp); (void) abd_iterate_func(abd, 0, size, fletcher_2_incremental_byteswap, zcp); @@ -127,11 +129,11 @@ abd_fletcher_4_impl(abd_t *abd, uint64_t size, zio_abd_checksum_data_t *acdp) fletcher_4_abd_ops.acf_fini(acdp); } -/*ARGSUSED*/ void abd_fletcher_4_native(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; fletcher_4_ctx_t ctx; zio_abd_checksum_data_t acd = { @@ -144,11 +146,11 @@ abd_fletcher_4_native(abd_t *abd, uint64_t size, } -/*ARGSUSED*/ void abd_fletcher_4_byteswap(abd_t *abd, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; fletcher_4_ctx_t ctx; zio_abd_checksum_data_t acd = { diff --git a/module/zfs/zio_compress.c b/module/zfs/zio_compress.c index 2db3cec35d5d..8930067d830f 100644 --- a/module/zfs/zio_compress.c +++ b/module/zfs/zio_compress.c @@ -74,6 +74,7 @@ uint8_t zio_complevel_select(spa_t *spa, enum zio_compress compress, uint8_t child, uint8_t parent) { + (void) spa; uint8_t result; if (!ZIO_COMPRESS_HASLEVEL(compress)) @@ -110,10 +111,11 @@ zio_compress_select(spa_t *spa, enum zio_compress child, return (result); } -/*ARGSUSED*/ static int zio_compress_zeroed_cb(void *data, size_t len, void *private) { + (void) private; + uint64_t *end = (uint64_t *)((char *)data + len); for (uint64_t *word = (uint64_t *)data; word < end; word++) if (*word != 0) diff --git a/module/zfs/zio_inject.c b/module/zfs/zio_inject.c index e56ea88682ff..6934ce60fd90 100644 --- a/module/zfs/zio_inject.c +++ b/module/zfs/zio_inject.c @@ -49,6 +49,8 @@ #include #include +#pragma GCC diagnostic error "-Wunused-parameter" + uint32_t zio_injection_enabled = 0; /* @@ -341,7 +343,6 @@ zio_handle_label_injection(zio_t *zio, int error) return (ret); } -/*ARGSUSED*/ static int zio_inject_bitflip_cb(void *data, size_t len, void *private) { diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 23df0e1541a3..25fbe4cb023a 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -87,6 +87,7 @@ #include +#pragma GCC diagnostic error "-Wunused-parameter" unsigned int zvol_inhibit_dev = 0; unsigned int zvol_volmode = ZFS_VOLMODE_GEOM; @@ -191,6 +192,7 @@ zvol_find_by_name(const char *name, int mode) void zvol_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx) { + (void) cr; zfs_creat_t *zct = arg; nvlist_t *nvprops = zct->zct_props; int error; @@ -535,6 +537,9 @@ zvol_replay_write(void *arg1, void *arg2, boolean_t byteswap) static int zvol_replay_err(void *arg1, void *arg2, boolean_t byteswap) { + (void) arg1; + (void) arg2; + (void) byteswap; return (SET_ERROR(ENOTSUP)); } @@ -657,10 +662,11 @@ zvol_log_truncate(zvol_state_t *zv, dmu_tx_t *tx, uint64_t off, uint64_t len, } -/* ARGSUSED */ static void zvol_get_done(zgd_t *zgd, int error) { + (void) error; + if (zgd->zgd_db) dmu_buf_rele(zgd->zgd_db, zgd); @@ -676,6 +682,7 @@ int zvol_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf, struct lwb *lwb, zio_t *zio) { + (void) arg2; zvol_state_t *zv = arg; uint64_t offset = lr->lr_offset; uint64_t size = lr->lr_length; @@ -1517,10 +1524,11 @@ zvol_set_snapdev_check(void *arg, dmu_tx_t *tx) return (error); } -/* ARGSUSED */ static int zvol_set_snapdev_sync_cb(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg) { + (void) arg; + char dsname[MAXNAMELEN]; zvol_task_t *task; uint64_t snapdev; @@ -1603,10 +1611,10 @@ zvol_set_volmode_check(void *arg, dmu_tx_t *tx) return (error); } -/* ARGSUSED */ static int zvol_set_volmode_sync_cb(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg) { + (void) arg; char dsname[MAXNAMELEN]; zvol_task_t *task; uint64_t volmode; diff --git a/tests/zfs-tests/cmd/btree_test/btree_test.c b/tests/zfs-tests/cmd/btree_test/btree_test.c index 8de14ff2a266..06d4b438168f 100644 --- a/tests/zfs-tests/cmd/btree_test/btree_test.c +++ b/tests/zfs-tests/cmd/btree_test/btree_test.c @@ -28,7 +28,7 @@ int contents_frequency = 100; int tree_limit = 64 * 1024; boolean_t stress_only = B_FALSE; -static void +static __attribute__((noreturn)) void usage(int exit_value) { (void) fprintf(stderr, "Usage:\tbtree_test -n \n"); @@ -294,6 +294,7 @@ drain_tree(zfs_btree_t *bt, char *why) static int stress_tree(zfs_btree_t *bt, char *why) { + (void) why; avl_tree_t avl; int_node_t *node; struct timeval tp; diff --git a/tests/zfs-tests/cmd/largest_file/largest_file.c b/tests/zfs-tests/cmd/largest_file/largest_file.c index 00e1019cc8e4..912607640965 100644 --- a/tests/zfs-tests/cmd/largest_file/largest_file.c +++ b/tests/zfs-tests/cmd/largest_file/largest_file.c @@ -137,9 +137,9 @@ usage(char *name) exit(1); } -/* ARGSUSED */ static void sigxfsz(int signo) { + (void) signo; (void) printf("\nlargest_file: sigxfsz() caught SIGXFSZ\n"); } diff --git a/tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c b/tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c index 21119ebca9d6..a02f46d91b30 100644 --- a/tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c +++ b/tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c @@ -52,6 +52,7 @@ do_sync_io(struct iocb *iocb) int main(int argc, char **argv) { + (void) argc; char *buf; int page_size = getpagesize(); int buf_size = strtol(argv[2], NULL, 0); diff --git a/tests/zfs-tests/cmd/rename_dir/rename_dir.c b/tests/zfs-tests/cmd/rename_dir/rename_dir.c index 5f80f7229462..6666aa3e9ed7 100644 --- a/tests/zfs-tests/cmd/rename_dir/rename_dir.c +++ b/tests/zfs-tests/cmd/rename_dir/rename_dir.c @@ -49,15 +49,14 @@ #include int -main(int argc, char *argvp[]) +main(void) { int i = 1; switch (fork()) { case -1: perror("fork"); - exit(1); - break; + return (1); case 0: while (i > 0) { int c_count = 0; @@ -69,7 +68,7 @@ main(int argc, char *argvp[]) (void) fprintf(stderr, "c_count: %d", c_count); } } - break; + return (0); default: while (i > 0) { int p_count = 0; @@ -81,8 +80,6 @@ main(int argc, char *argvp[]) (void) fprintf(stderr, "p_count: %d", p_count); } } - break; + return (0); } - - return (0); } diff --git a/tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c b/tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c index e262ecefea92..f8b6e3e808bb 100644 --- a/tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c +++ b/tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c @@ -55,10 +55,10 @@ pickidx(void) return (random() % 1000); } -/* ARGSUSED */ static void * mover(void *a) { + (void) a; char buf[256]; int idx, len, ret; @@ -75,10 +75,10 @@ mover(void *a) return (NULL); } -/* ARGSUSED */ static void * cleaner(void *a) { + (void) a; char buf[256]; int idx, len, ret; diff --git a/tests/zfs-tests/cmd/xattrtest/xattrtest.c b/tests/zfs-tests/cmd/xattrtest/xattrtest.c index 0b68126c0327..4025bc0fc57d 100644 --- a/tests/zfs-tests/cmd/xattrtest/xattrtest.c +++ b/tests/zfs-tests/cmd/xattrtest/xattrtest.c @@ -96,12 +96,12 @@ static char script[PATH_MAX] = "/bin/true"; static char xattrbytes[XATTR_SIZE_MAX]; static int -usage(int argc, char **argv) +usage(char *progname) { fprintf(stderr, "usage: %s [-hvycdrRk] [-n ] [-f ] [-x ]\n" " [-s ] [-p ] [-t