From ef70eff1982228862ef9ad70f21b222cde06eb5e Mon Sep 17 00:00:00 2001 From: наб Date: Wed, 16 Feb 2022 02:38:43 +0100 Subject: module: mark arguments used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Alejandro Colomar Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia Ziemiańska Closes #13110 --- module/os/freebsd/spl/callb.c | 2 +- module/os/freebsd/spl/spl_zlib.c | 6 +- module/os/freebsd/zfs/zfs_acl.c | 8 +-- module/os/freebsd/zfs/zfs_ctldir.c | 2 +- module/os/freebsd/zfs/zfs_vfsops.c | 3 - module/os/freebsd/zfs/zfs_vnops_os.c | 32 ++++------- module/os/freebsd/zfs/zfs_znode.c | 2 +- module/os/freebsd/zfs/zvol_os.c | 3 +- module/os/linux/zfs/zfs_acl.c | 8 +-- module/os/linux/zfs/zfs_vfsops.c | 5 +- module/os/linux/zfs/zfs_vnops_os.c | 30 +++------- module/os/linux/zfs/zfs_znode.c | 6 +- module/os/linux/zfs/zpl_ctldir.c | 31 +++++++--- module/zfs/dmu_recv.c | 4 -- module/zfs/dmu_tx.c | 1 - module/zfs/dsl_pool.c | 2 - module/zfs/edonr_zfs.c | 1 - module/zfs/skein_zfs.c | 1 - module/zfs/spa_history.c | 1 - module/zfs/zfs_byteswap.c | 13 +---- module/zfs/zfs_ioctl.c | 107 ++++++++++++++++------------------- module/zfs/zfs_replay.c | 2 +- module/zfs/zfs_vnops.c | 9 +-- module/zfs/zio_inject.c | 5 +- module/zfs/zvol.c | 6 +- 25 files changed, 119 insertions(+), 171 deletions(-) diff --git a/module/os/freebsd/spl/callb.c b/module/os/freebsd/spl/callb.c index 0b7fefc89..5db95bd97 100644 --- a/module/os/freebsd/spl/callb.c +++ b/module/os/freebsd/spl/callb.c @@ -338,10 +338,10 @@ 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 3644eba77..fa2b0a2b6 100644 --- a/module/os/freebsd/spl/spl_zlib.c +++ b/module/os/freebsd/spl/spl_zlib.c @@ -40,19 +40,17 @@ __FBSDID("$FreeBSD$"); #include -/*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); } diff --git a/module/os/freebsd/zfs/zfs_acl.c b/module/os/freebsd/zfs/zfs_acl.c index 838fad636..c0aa67327 100644 --- a/module/os/freebsd/zfs/zfs_acl.c +++ b/module/os/freebsd/zfs/zfs_acl.c @@ -144,10 +144,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 +163,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 +631,11 @@ 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; @@ -1120,11 +1120,11 @@ done: 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/freebsd/zfs/zfs_ctldir.c b/module/os/freebsd/zfs/zfs_ctldir.c index 10e7bc64b..6692e7b31 100644 --- a/module/os/freebsd/zfs/zfs_ctldir.c +++ b/module/os/freebsd/zfs/zfs_ctldir.c @@ -456,10 +456,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); } diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c index 0dff872b8..b68d84e3b 100644 --- a/module/os/freebsd/zfs/zfs_vfsops.c +++ b/module/os/freebsd/zfs/zfs_vfsops.c @@ -397,7 +397,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) { @@ -1310,7 +1309,6 @@ fetch_osname_options(char *name, bool *checkpointrewind) } } -/*ARGSUSED*/ static int zfs_mount(vfs_t *vfsp) { @@ -1641,7 +1639,6 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting) return (0); } -/*ARGSUSED*/ static int zfs_umount(vfs_t *vfsp, int fflag) { diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c index b36862bba..1b0f53c6d 100644 --- a/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/module/os/freebsd/zfs/zfs_vnops_os.c @@ -220,11 +220,10 @@ typedef ulong_t cookie_t; * ZFS_EXIT(zfsvfs); // finished in zfs * 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; @@ -245,10 +244,10 @@ 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; @@ -263,11 +262,11 @@ 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; @@ -764,7 +763,6 @@ 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, int flags, @@ -1034,12 +1032,11 @@ zfs_lookup(vnode_t *dvp, const char *nm, vnode_t **vpp, * dvp - ctime|mtime updated if new entry created * 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; @@ -1201,8 +1198,6 @@ out: * dvp - ctime|mtime * vp - ctime (if nlink > 0) */ - -/*ARGSUSED*/ static int zfs_remove_(vnode_t *dvp, vnode_t *vp, const char *name, cred_t *cr) { @@ -1390,11 +1385,11 @@ 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; @@ -1567,7 +1562,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) { @@ -1668,7 +1662,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, cookie_t **cookies) @@ -1994,7 +1987,6 @@ update: * * RETURN: 0 (always succeeds). */ -/* ARGSUSED */ static int zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr) { @@ -2208,7 +2200,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) { @@ -3191,7 +3182,6 @@ zfs_do_rename_impl(vnode_t *sdvp, vnode_t **svpp, struct componentname *scnp, * Timestamps: * sdvp,tdvp - ctime|mtime updated */ -/*ARGSUSED*/ static int zfs_do_rename(vnode_t *sdvp, vnode_t **svpp, struct componentname *scnp, vnode_t *tdvp, vnode_t **tvpp, struct componentname *tcnp, @@ -3514,11 +3504,11 @@ fail: * 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; @@ -3653,10 +3643,10 @@ 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; @@ -3690,11 +3680,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; @@ -3839,11 +3829,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; @@ -3890,10 +3880,10 @@ 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; @@ -3942,10 +3932,10 @@ _Static_assert(sizeof (struct zfid_short) <= sizeof (struct fid), _Static_assert(sizeof (struct zfid_long) <= sizeof (struct fid), "struct zfid_long bigger than 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; diff --git a/module/os/freebsd/zfs/zfs_znode.c b/module/os/freebsd/zfs/zfs_znode.c index 2ffa403d0..c9efdfc5b 100644 --- a/module/os/freebsd/zfs/zfs_znode.c +++ b/module/os/freebsd/zfs/zfs_znode.c @@ -156,10 +156,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)); diff --git a/module/os/freebsd/zfs/zvol_os.c b/module/os/freebsd/zfs/zvol_os.c index b72c6216a..487778472 100644 --- a/module/os/freebsd/zfs/zvol_os.c +++ b/module/os/freebsd/zfs/zvol_os.c @@ -203,7 +203,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) { @@ -336,10 +335,10 @@ out_locked: 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; diff --git a/module/os/linux/zfs/zfs_acl.c b/module/os/linux/zfs/zfs_acl.c index 9f193e06f..1859ecd99 100644 --- a/module/os/linux/zfs/zfs_acl.c +++ b/module/os/linux/zfs/zfs_acl.c @@ -144,10 +144,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 +163,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 +629,11 @@ 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 +1130,11 @@ done: 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_vfsops.c b/module/os/linux/zfs/zfs_vfsops.c index acf8c7b89..412af0e88 100644 --- a/module/os/linux/zfs/zfs_vfsops.c +++ b/module/os/linux/zfs/zfs_vfsops.c @@ -256,10 +256,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; /* @@ -1600,7 +1600,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) { @@ -2128,7 +2127,6 @@ zfs_get_vfs_flag_unmounted(objset_t *os) return (unmounted); } -/*ARGSUSED*/ void zfsvfs_update_fromname(const char *oldname, const char *newname) { @@ -2136,6 +2134,7 @@ 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 526249d03..ece7c373e 100644 --- a/module/os/linux/zfs/zfs_vnops_os.c +++ b/module/os/linux/zfs/zfs_vnops_os.c @@ -174,11 +174,10 @@ * ZFS_EXIT(zfsvfs); // finished in zfs * 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 +199,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); @@ -415,7 +414,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) @@ -535,8 +533,6 @@ zfs_lookup(znode_t *zdp, char *nm, znode_t **zpp, int flags, cred_t *cr, * dzp - ctime|mtime updated if new entry created * 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) @@ -782,11 +778,11 @@ out: 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; @@ -920,7 +916,6 @@ out: static uint64_t null_xattr = 0; -/*ARGSUSED*/ int zfs_remove(znode_t *dzp, char *name, cred_t *cr, int flags) { @@ -1160,7 +1155,6 @@ out: * 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) @@ -1349,7 +1343,6 @@ out: * Timestamps: * dzp - ctime|mtime updated */ -/*ARGSUSED*/ int zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd, cred_t *cr, int flags) @@ -1482,10 +1475,10 @@ out: * 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; @@ -1635,7 +1628,6 @@ out: * * RETURN: 0 (always succeeds) */ -/* ARGSUSED */ int zfs_getattr_fast(struct user_namespace *user_ns, struct inode *ip, struct kstat *sp) @@ -1823,7 +1815,6 @@ next: * Timestamps: * ip - ctime updated, mtime updated if size changed. */ -/* ARGSUSED */ int zfs_setattr(znode_t *zp, vattr_t *vap, int flags, cred_t *cr) { @@ -2652,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) @@ -3020,7 +3010,6 @@ out: * 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) @@ -3188,10 +3177,10 @@ top: * 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; @@ -3227,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) @@ -3430,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) { @@ -3687,7 +3674,6 @@ out: return (error); } -/*ARGSUSED*/ void zfs_inactive(struct inode *ip) { @@ -3791,7 +3777,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) { @@ -3825,11 +3810,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); @@ -3875,11 +3860,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; @@ -3926,7 +3911,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 65a3303e2..d65d75312 100644 --- a/module/os/linux/zfs/zfs_znode.c +++ b/module/os/linux/zfs/zfs_znode.c @@ -113,10 +113,10 @@ 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 +137,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 +159,7 @@ 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 +172,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); diff --git a/module/os/linux/zfs/zpl_ctldir.c b/module/os/linux/zfs/zpl_ctldir.c index a640930a0..f4e1ab7ae 100644 --- a/module/os/linux/zfs/zpl_ctldir.c +++ b/module/os/linux/zfs/zpl_ctldir.c @@ -36,7 +36,6 @@ /* * Common open routine. Disallow any write access. */ -/* ARGSUSED */ static int zpl_common_open(struct inode *ip, struct file *filp) { @@ -99,7 +98,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,10 +108,15 @@ 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) +#ifdef HAVE_USERNS_IOPS_GETATTR +#ifdef HAVE_GENERIC_FILLATTR_USERNS generic_fillattr(user_ns, ip, stat); +#else + (void) user_ns; +#endif #else generic_fillattr(ip, stat); #endif @@ -382,7 +385,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,12 +395,17 @@ 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); ZPL_ENTER(zfsvfs); -#if defined(HAVE_GENERIC_FILLATTR_USERNS) && defined(HAVE_USERNS_IOPS_GETATTR) +#ifdef HAVE_USERNS_IOPS_GETATTR +#ifdef HAVE_GENERIC_FILLATTR_USERNS generic_fillattr(user_ns, ip, stat); +#else + (void) user_ns; +#endif #else generic_fillattr(ip, stat); #endif @@ -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,7 @@ 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; @@ -543,8 +550,12 @@ zpl_shares_getattr_impl(const struct path *path, struct kstat *stat, ZPL_ENTER(zfsvfs); if (zfsvfs->z_shares_dir == 0) { -#if defined(HAVE_GENERIC_FILLATTR_USERNS) && defined(HAVE_USERNS_IOPS_GETATTR) +#ifdef HAVE_USERNS_IOPS_GETATTR +#ifdef HAVE_GENERIC_FILLATTR_USERNS generic_fillattr(user_ns, path->dentry->d_inode, stat); +#else + (void) user_ns; +#endif #else generic_fillattr(path->dentry->d_inode, stat); #endif @@ -556,8 +567,12 @@ zpl_shares_getattr_impl(const struct path *path, struct kstat *stat, error = -zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp); if (error == 0) { -#if defined(HAVE_GENERIC_FILLATTR_USERNS) && defined(HAVE_USERNS_IOPS_GETATTR) +#ifdef HAVE_USERNS_IOPS_GETATTR +#ifdef HAVE_GENERIC_FILLATTR_USERNS error = -zfs_getattr_fast(user_ns, ZTOI(dzp), stat); +#else + (void) user_ns; +#endif #else error = -zfs_getattr_fast(kcred->user_ns, ZTOI(dzp), stat); #endif diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c index 0d7659213..b507d37c7 100644 --- a/module/zfs/dmu_recv.c +++ b/module/zfs/dmu_recv.c @@ -1828,7 +1828,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) @@ -2230,7 +2229,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) { @@ -2305,7 +2303,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) { @@ -2454,7 +2451,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) diff --git a/module/zfs/dmu_tx.c b/module/zfs/dmu_tx.c index b4735bb7f..fe9860066 100644 --- a/module/zfs/dmu_tx.c +++ b/module/zfs/dmu_tx.c @@ -219,7 +219,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) { diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c index 9a15f6284..c120d19b8 100644 --- a/module/zfs/dsl_pool.c +++ b/module/zfs/dsl_pool.c @@ -1010,7 +1010,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) { @@ -1101,7 +1100,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/edonr_zfs.c b/module/zfs/edonr_zfs.c index 938d684ec..7c62e0be0 100644 --- a/module/zfs/edonr_zfs.c +++ b/module/zfs/edonr_zfs.c @@ -45,7 +45,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/skein_zfs.c b/module/zfs/skein_zfs.c index 11b9940e0..55c7ac2a5 100644 --- a/module/zfs/skein_zfs.c +++ b/module/zfs/skein_zfs.c @@ -41,7 +41,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_history.c b/module/zfs/spa_history.c index dae06e46c..c0e0d8eee 100644 --- a/module/zfs/spa_history.c +++ b/module/zfs/spa_history.c @@ -248,7 +248,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) { diff --git a/module/zfs/zfs_byteswap.c b/module/zfs/zfs_byteswap.c index cd35849c3..fcedf295c 100644 --- a/module/zfs/zfs_byteswap.c +++ b/module/zfs/zfs_byteswap.c @@ -36,9 +36,7 @@ static void zfs_oldace_byteswap(ace_t *ace, int ace_cnt) { - int i; - - for (i = 0; i != ace_cnt; i++, ace++) { + for (int i = 0; i != ace_cnt; i++, ace++) { ace->a_who = BSWAP_32(ace->a_who); ace->a_access_mask = BSWAP_32(ace->a_access_mask); ace->a_flags = BSWAP_16(ace->a_flags); @@ -138,23 +136,16 @@ zfs_ace_byteswap(void *buf, size_t size, boolean_t zfs_layout) } } -/* ARGSUSED */ void zfs_oldacl_byteswap(void *buf, size_t size) { - int cnt; - /* * Arggh, since we don't know how many ACEs are in * the array, we have to swap the entire block */ - - cnt = size / sizeof (ace_t); - - zfs_oldace_byteswap((ace_t *)buf, cnt); + zfs_oldace_byteswap((ace_t *)buf, size / sizeof (ace_t)); } -/* ARGSUSED */ void zfs_acl_byteswap(void *buf, size_t size) { diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 17eb7d497..a2824c5cc 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -373,10 +373,10 @@ 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 +384,10 @@ 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); @@ -656,35 +656,29 @@ 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) { - int error; - - error = zfs_dozonecheck(zc->zc_name, cr); - if (error != 0) - return (error); - /* * permission to set permissions will be evaluated later in * dsl_deleg_can_allow() */ - return (0); + (void) innvl; + return (zfs_dozonecheck(zc->zc_name, cr)); } -/* 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; dsl_pool_t *dp; dsl_dataset_t *ds; const char *cp; @@ -717,10 +711,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 +722,14 @@ 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 +767,10 @@ 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) innvl; return (zfs_secpolicy_destroy_perms(zc->zc_name, cr)); } @@ -782,10 +778,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 +840,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 +895,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,13 +913,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) -{ - return (zfs_secpolicy_recv(zc, innvl, cr)); -} - int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr) { @@ -934,10 +923,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 +954,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 +979,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 +1020,10 @@ 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 +1061,11 @@ 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 +1075,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 +1091,17 @@ 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 +1164,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 +1196,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; @@ -3149,7 +3139,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) { @@ -3511,11 +3500,11 @@ 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; return (0); } @@ -3603,10 +3592,10 @@ 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; @@ -3709,10 +3698,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); } @@ -3756,7 +3745,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) { @@ -3809,10 +3797,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)); } @@ -3849,11 +3837,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; @@ -3958,10 +3946,10 @@ 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)); } @@ -3973,11 +3961,11 @@ 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)); } @@ -4339,7 +4327,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) { @@ -4411,14 +4398,15 @@ 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}, }; + static int zfs_ioc_redact(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) { + (void) outnvl; nvlist_t *redactnvl = NULL; char *redactbook = NULL; @@ -5800,10 +5788,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; @@ -6210,10 +6198,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; @@ -6262,10 +6250,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)); } @@ -6284,10 +6272,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)); } @@ -6521,10 +6509,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; @@ -6571,11 +6559,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); } @@ -6767,10 +6756,10 @@ 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) onvl; int err; boolean_t rc, force = B_FALSE; spa_t *spa; @@ -6810,10 +6799,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; @@ -6852,10 +6841,10 @@ 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) { @@ -6873,7 +6862,7 @@ out: /* * Changes a user's wrapping key used to decrypt a dataset. The keyformat, - * keylocation, pbkdf2salt, and pbkdf2iters properties can also be specified + * keylocation, pbkdf2salt, and pbkdf2iters properties can also be specified * here to change how the key is derived in userspace. * * innvl: { @@ -6890,10 +6879,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; @@ -7122,7 +7111,7 @@ zfs_ioctl_init(void) ARRAY_SIZE(zfs_keys_destroy_bookmarks)); zfs_ioctl_register("receive", ZFS_IOC_RECV_NEW, - zfs_ioc_recv_new, zfs_secpolicy_recv_new, DATASET_NAME, + zfs_ioc_recv_new, zfs_secpolicy_recv, DATASET_NAME, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE, zfs_keys_recv_new, ARRAY_SIZE(zfs_keys_recv_new)); zfs_ioctl_register("load-key", ZFS_IOC_LOAD_KEY, diff --git a/module/zfs/zfs_replay.c b/module/zfs/zfs_replay.c index b8288b50f..860ca5929 100644 --- a/module/zfs/zfs_replay.c +++ b/module/zfs/zfs_replay.c @@ -80,10 +80,10 @@ 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 918938d62..5d5b5f29a 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -154,7 +154,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) { @@ -192,10 +191,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; @@ -389,8 +388,6 @@ zfs_clear_setid_bits_if_necessary(zfsvfs_t *zfsvfs, znode_t *zp, cred_t *cr, * Timestamps: * ip - ctime|mtime updated if byte count > 0 */ - -/* ARGSUSED */ int zfs_write(znode_t *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) { @@ -779,7 +776,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) { @@ -795,7 +791,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) { @@ -965,10 +960,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/zio_inject.c b/module/zfs/zio_inject.c index feaf41dc6..cfc2e8f5b 100644 --- a/module/zfs/zio_inject.c +++ b/module/zfs/zio_inject.c @@ -341,15 +341,14 @@ 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) { - zio_t *zio __maybe_unused = private; + zio_t *zio = private; uint8_t *buffer = data; uint_t byte = random_in_range(len); - ASSERT(zio->io_type == ZIO_TYPE_READ); + ASSERT3U(zio->io_type, ==, ZIO_TYPE_READ); /* flip a single random bit in an abd data buffer */ buffer[byte] ^= 1 << random_in_range(8); diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 943be01d4..eb68b05c5 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -613,10 +613,10 @@ 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); @@ -1511,10 +1511,10 @@ 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; @@ -1597,10 +1597,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; -- cgit v1.2.3