libzfs: fix unused, remove argsused

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12844
This commit is contained in:
наб 2021-12-12 15:38:17 +01:00 committed by Brian Behlendorf
parent 0cad373e5c
commit 1f182103aa
11 changed files with 37 additions and 29 deletions

View File

@ -592,7 +592,6 @@ compare_props(const void *a, const void *b, zfs_prop_t prop)
return (strcmp(propb, propa)); return (strcmp(propb, propa));
} }
/*ARGSUSED*/
static int static int
compare_mountpoints(const void *a, const void *b, void *unused) compare_mountpoints(const void *a, const void *b, void *unused)
{ {
@ -602,13 +601,14 @@ compare_mountpoints(const void *a, const void *b, void *unused)
* hierarchy that is different from the dataset hierarchy, and still * hierarchy that is different from the dataset hierarchy, and still
* allow it to be changed. * allow it to be changed.
*/ */
(void) unused;
return (compare_props(a, b, ZFS_PROP_MOUNTPOINT)); return (compare_props(a, b, ZFS_PROP_MOUNTPOINT));
} }
/*ARGSUSED*/
static int static int
compare_dataset_names(const void *a, const void *b, void *unused) compare_dataset_names(const void *a, const void *b, void *unused)
{ {
(void) unused;
return (compare_props(a, b, ZFS_PROP_NAME)); return (compare_props(a, b, ZFS_PROP_NAME));
} }

View File

@ -56,16 +56,14 @@ typedef struct config_node {
uu_avl_node_t cn_avl; uu_avl_node_t cn_avl;
} config_node_t; } config_node_t;
/* ARGSUSED */
static int static int
config_node_compare(const void *a, const void *b, void *unused) config_node_compare(const void *a, const void *b, void *unused)
{ {
int ret; (void) unused;
const config_node_t *ca = (config_node_t *)a; const config_node_t *ca = (config_node_t *)a;
const config_node_t *cb = (config_node_t *)b; const config_node_t *cb = (config_node_t *)b;
ret = strcmp(ca->cn_name, cb->cn_name); int ret = strcmp(ca->cn_name, cb->cn_name);
if (ret < 0) if (ret < 0)
return (-1); return (-1);

View File

@ -482,6 +482,7 @@ get_key_material_file(libzfs_handle_t *hdl, const char *uri,
const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey, const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey,
uint8_t **restrict buf, size_t *restrict len_out) uint8_t **restrict buf, size_t *restrict len_out)
{ {
(void) fsname, (void) newkey;
FILE *f = NULL; FILE *f = NULL;
int ret = 0; int ret = 0;
@ -508,6 +509,7 @@ get_key_material_https(libzfs_handle_t *hdl, const char *uri,
const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey, const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey,
uint8_t **restrict buf, size_t *restrict len_out) uint8_t **restrict buf, size_t *restrict len_out)
{ {
(void) fsname, (void) newkey;
int ret = 0; int ret = 0;
FILE *key = NULL; FILE *key = NULL;
boolean_t is_http = strncmp(uri, "http:", strlen("http:")) == 0; boolean_t is_http = strncmp(uri, "http:", strlen("http:")) == 0;
@ -773,7 +775,7 @@ error:
static int static int
derive_key(libzfs_handle_t *hdl, zfs_keyformat_t format, uint64_t iters, 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_material, uint64_t salt,
uint8_t **key_out) uint8_t **key_out)
{ {
int ret; int ret;
@ -916,8 +918,7 @@ populate_create_encryption_params_nvlists(libzfs_handle_t *hdl,
} }
/* derive a key from the key material */ /* derive a key from the key material */
ret = derive_key(hdl, keyformat, iters, key_material, key_material_len, ret = derive_key(hdl, keyformat, iters, key_material, salt, &key_data);
salt, &key_data);
if (ret != 0) if (ret != 0)
goto error; goto error;
@ -1175,6 +1176,7 @@ int
zfs_crypto_clone_check(libzfs_handle_t *hdl, zfs_handle_t *origin_zhp, zfs_crypto_clone_check(libzfs_handle_t *hdl, zfs_handle_t *origin_zhp,
char *parent_name, nvlist_t *props) char *parent_name, nvlist_t *props)
{ {
(void) origin_zhp, (void) parent_name;
char errbuf[1024]; char errbuf[1024];
(void) snprintf(errbuf, sizeof (errbuf), (void) snprintf(errbuf, sizeof (errbuf),
@ -1372,8 +1374,8 @@ try_again:
goto error; goto error;
/* derive a key from the key material */ /* derive a key from the key material */
ret = derive_key(zhp->zfs_hdl, keyformat, iters, key_material, ret = derive_key(zhp->zfs_hdl, keyformat, iters, key_material, salt,
key_material_len, salt, &key_data); &key_data);
if (ret != 0) if (ret != 0)
goto error; goto error;

View File

@ -3180,6 +3180,7 @@ userquota_propname_decode(const char *propname, boolean_t zoned,
if (errno != 0 || *end != '\0') if (errno != 0 || *end != '\0')
return (EINVAL); return (EINVAL);
#else #else
(void) domainlen;
return (ENOSYS); return (ENOSYS);
#endif /* HAVE_IDMAP */ #endif /* HAVE_IDMAP */
} else { } else {

View File

@ -39,7 +39,7 @@
#include "libzfs_impl.h" #include "libzfs_impl.h"
static int static int
zfs_iter_clones(zfs_handle_t *zhp, int flags, zfs_iter_f func, void *data) zfs_iter_clones(zfs_handle_t *zhp, zfs_iter_f func, void *data)
{ {
nvlist_t *nvl = zfs_get_clones_nvl(zhp); nvlist_t *nvl = zfs_get_clones_nvl(zhp);
nvpair_t *pair; nvpair_t *pair;
@ -206,6 +206,7 @@ zfs_iter_snapshots(zfs_handle_t *zhp, int flags, zfs_iter_f func,
int int
zfs_iter_bookmarks(zfs_handle_t *zhp, int flags, zfs_iter_f func, void *data) zfs_iter_bookmarks(zfs_handle_t *zhp, int flags, zfs_iter_f func, void *data)
{ {
(void) flags;
zfs_handle_t *nzhp; zfs_handle_t *nzhp;
nvlist_t *props = NULL; nvlist_t *props = NULL;
nvlist_t *bmarks = NULL; nvlist_t *bmarks = NULL;
@ -496,7 +497,7 @@ iter_dependents_cb(zfs_handle_t *zhp, void *arg)
ida->first = B_FALSE; ida->first = B_FALSE;
if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) { if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
err = zfs_iter_clones(zhp, ida->flags, iter_dependents_cb, ida); err = zfs_iter_clones(zhp, iter_dependents_cb, ida);
} else if (zhp->zfs_type != ZFS_TYPE_BOOKMARK) { } else if (zhp->zfs_type != ZFS_TYPE_BOOKMARK) {
iter_stack_frame_t isf; iter_stack_frame_t isf;
iter_stack_frame_t *f; iter_stack_frame_t *f;

View File

@ -244,12 +244,11 @@ zfs_is_mounted(zfs_handle_t *zhp, char **where)
* Checks any higher order concerns about whether the given dataset is * Checks any higher order concerns about whether the given dataset is
* mountable, false otherwise. zfs_is_mountable_internal specifically assumes * mountable, false otherwise. zfs_is_mountable_internal specifically assumes
* that the caller has verified the sanity of mounting the dataset at * that the caller has verified the sanity of mounting the dataset at
* mountpoint to the extent the caller wants. * its mountpoint to the extent the caller wants.
*/ */
static boolean_t 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) && if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) &&
getzoneid() == GLOBAL_ZONEID) getzoneid() == GLOBAL_ZONEID)
return (B_FALSE); 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) if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF)
return (B_FALSE); return (B_FALSE);
if (!zfs_is_mountable_internal(zhp, buf)) if (!zfs_is_mountable_internal(zhp))
return (B_FALSE); return (B_FALSE);
if (zfs_prop_get_int(zhp, ZFS_PROP_REDACTED) && !(flags & MS_FORCE)) 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; remount = 1;
/* Potentially duplicates some checks if invoked by zfs_mount(). */ /* Potentially duplicates some checks if invoked by zfs_mount(). */
if (!zfs_is_mountable_internal(zhp, mountpoint)) if (!zfs_is_mountable_internal(zhp))
return (0); return (0);
/* /*

View File

@ -96,48 +96,48 @@ static char *zfs_msgid_table[] = {
#define NMSGID (sizeof (zfs_msgid_table) / sizeof (zfs_msgid_table[0])) #define NMSGID (sizeof (zfs_msgid_table) / sizeof (zfs_msgid_table[0]))
/* ARGSUSED */
static int static int
vdev_missing(vdev_stat_t *vs, uint_t vsc) vdev_missing(vdev_stat_t *vs, uint_t vsc)
{ {
(void) vsc;
return (vs->vs_state == VDEV_STATE_CANT_OPEN && return (vs->vs_state == VDEV_STATE_CANT_OPEN &&
vs->vs_aux == VDEV_AUX_OPEN_FAILED); vs->vs_aux == VDEV_AUX_OPEN_FAILED);
} }
/* ARGSUSED */
static int static int
vdev_faulted(vdev_stat_t *vs, uint_t vsc) vdev_faulted(vdev_stat_t *vs, uint_t vsc)
{ {
(void) vsc;
return (vs->vs_state == VDEV_STATE_FAULTED); return (vs->vs_state == VDEV_STATE_FAULTED);
} }
/* ARGSUSED */
static int static int
vdev_errors(vdev_stat_t *vs, uint_t vsc) vdev_errors(vdev_stat_t *vs, uint_t vsc)
{ {
(void) vsc;
return (vs->vs_state == VDEV_STATE_DEGRADED || return (vs->vs_state == VDEV_STATE_DEGRADED ||
vs->vs_read_errors != 0 || vs->vs_write_errors != 0 || vs->vs_read_errors != 0 || vs->vs_write_errors != 0 ||
vs->vs_checksum_errors != 0); vs->vs_checksum_errors != 0);
} }
/* ARGSUSED */
static int static int
vdev_broken(vdev_stat_t *vs, uint_t vsc) vdev_broken(vdev_stat_t *vs, uint_t vsc)
{ {
(void) vsc;
return (vs->vs_state == VDEV_STATE_CANT_OPEN); return (vs->vs_state == VDEV_STATE_CANT_OPEN);
} }
/* ARGSUSED */
static int static int
vdev_offlined(vdev_stat_t *vs, uint_t vsc) vdev_offlined(vdev_stat_t *vs, uint_t vsc)
{ {
(void) vsc;
return (vs->vs_state == VDEV_STATE_OFFLINE); return (vs->vs_state == VDEV_STATE_OFFLINE);
} }
/* ARGSUSED */
static int static int
vdev_removed(vdev_stat_t *vs, uint_t vsc) vdev_removed(vdev_stat_t *vs, uint_t vsc)
{ {
(void) vsc;
return (vs->vs_state == VDEV_STATE_REMOVED); return (vs->vs_state == VDEV_STATE_REMOVED);
} }

View File

@ -123,6 +123,7 @@ do_mount(zfs_handle_t *zhp, const char *mntpt, char *opts, int flags)
int int
do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags) do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags)
{ {
(void) zhp;
if (unmount(mntpt, flags) < 0) if (unmount(mntpt, flags) < 0)
return (errno); return (errno);
return (0); return (0);
@ -138,10 +139,12 @@ zfs_mount_delegation_check(void)
void void
zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force) zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force)
{ {
(void) zhp, (void) force;
} }
/* Called from the tail end of zfs_unmount() */ /* Called from the tail end of zfs_unmount() */
void void
zpool_disable_volume_os(const char *name) zpool_disable_volume_os(const char *name)
{ {
(void) name;
} }

View File

@ -376,6 +376,8 @@ do_mount(zfs_handle_t *zhp, const char *mntpt, char *opts, int flags)
int int
do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags) do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags)
{ {
(void) zhp;
if (!libzfs_envvar_is_set("ZFS_MOUNT_HELPER")) { if (!libzfs_envvar_is_set("ZFS_MOUNT_HELPER")) {
int rv = umount2(mntpt, flags); int rv = umount2(mntpt, flags);
@ -416,10 +418,12 @@ zfs_mount_delegation_check(void)
void void
zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force) zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force)
{ {
(void) zhp, (void) force;
} }
/* Called from the tail end of zfs_unmount() */ /* Called from the tail end of zfs_unmount() */
void void
zpool_disable_volume_os(const char *name) zpool_disable_volume_os(const char *name)
{ {
(void) name;
} }

View File

@ -187,6 +187,7 @@ find_shares_object(differ_info_t *di)
int int
zfs_destroy_snaps_nvl_os(libzfs_handle_t *hdl, nvlist_t *snaps) zfs_destroy_snaps_nvl_os(libzfs_handle_t *hdl, nvlist_t *snaps)
{ {
(void) hdl, (void) snaps;
return (0); return (0);
} }

View File

@ -226,7 +226,6 @@ static struct fletcher_4_kstat {
/* Indicate that benchmark has been completed */ /* Indicate that benchmark has been completed */
static boolean_t fletcher_4_initialized = B_FALSE; static boolean_t fletcher_4_initialized = B_FALSE;
/*ARGSUSED*/
void void
fletcher_init(zio_cksum_t *zcp) fletcher_init(zio_cksum_t *zcp)
{ {
@ -258,11 +257,11 @@ fletcher_2_incremental_native(void *buf, size_t size, void *data)
return (0); return (0);
} }
/*ARGSUSED*/
void void
fletcher_2_native(const void *buf, uint64_t size, fletcher_2_native(const void *buf, uint64_t size,
const void *ctx_template, zio_cksum_t *zcp) const void *ctx_template, zio_cksum_t *zcp)
{ {
(void) ctx_template;
fletcher_init(zcp); fletcher_init(zcp);
(void) fletcher_2_incremental_native((void *) buf, size, 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); return (0);
} }
/*ARGSUSED*/
void void
fletcher_2_byteswap(const void *buf, uint64_t size, fletcher_2_byteswap(const void *buf, uint64_t size,
const void *ctx_template, zio_cksum_t *zcp) const void *ctx_template, zio_cksum_t *zcp)
{ {
(void) ctx_template;
fletcher_init(zcp); fletcher_init(zcp);
(void) fletcher_2_incremental_byteswap((void *) buf, size, zcp); (void) fletcher_2_incremental_byteswap((void *) buf, size, zcp);
} }
@ -460,11 +459,11 @@ fletcher_4_native_impl(const void *buf, uint64_t size, zio_cksum_t *zcp)
ops->fini_native(&ctx, zcp); ops->fini_native(&ctx, zcp);
} }
/*ARGSUSED*/
void void
fletcher_4_native(const void *buf, uint64_t size, fletcher_4_native(const void *buf, uint64_t size,
const void *ctx_template, zio_cksum_t *zcp) const void *ctx_template, zio_cksum_t *zcp)
{ {
(void) ctx_template;
const uint64_t p2size = P2ALIGN(size, FLETCHER_MIN_SIMD_SIZE); const uint64_t p2size = P2ALIGN(size, FLETCHER_MIN_SIMD_SIZE);
ASSERT(IS_P2ALIGNED(size, sizeof (uint32_t))); ASSERT(IS_P2ALIGNED(size, sizeof (uint32_t)));
@ -502,11 +501,11 @@ fletcher_4_byteswap_impl(const void *buf, uint64_t size, zio_cksum_t *zcp)
ops->fini_byteswap(&ctx, zcp); ops->fini_byteswap(&ctx, zcp);
} }
/*ARGSUSED*/
void void
fletcher_4_byteswap(const void *buf, uint64_t size, fletcher_4_byteswap(const void *buf, uint64_t size,
const void *ctx_template, zio_cksum_t *zcp) const void *ctx_template, zio_cksum_t *zcp)
{ {
(void) ctx_template;
const uint64_t p2size = P2ALIGN(size, FLETCHER_MIN_SIMD_SIZE); const uint64_t p2size = P2ALIGN(size, FLETCHER_MIN_SIMD_SIZE);
ASSERT(IS_P2ALIGNED(size, sizeof (uint32_t))); ASSERT(IS_P2ALIGNED(size, sizeof (uint32_t)));