aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-12-12 15:38:17 +0100
committerBrian Behlendorf <[email protected]>2021-12-23 09:42:47 -0800
commit1f182103aaf504669923f037ba49629201304263 (patch)
tree2a231f3ae9ad1331b937fd8d36616f52ac93d332 /lib/libzfs
parent0cad373e5c9daa99c8b8063f17b630782d868ee0 (diff)
libzfs: fix unused, remove argsused
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12844
Diffstat (limited to 'lib/libzfs')
-rw-r--r--lib/libzfs/libzfs_changelist.c4
-rw-r--r--lib/libzfs/libzfs_config.c6
-rw-r--r--lib/libzfs/libzfs_crypto.c12
-rw-r--r--lib/libzfs/libzfs_dataset.c1
-rw-r--r--lib/libzfs/libzfs_iter.c5
-rw-r--r--lib/libzfs/libzfs_mount.c9
-rw-r--r--lib/libzfs/libzfs_status.c12
-rw-r--r--lib/libzfs/os/freebsd/libzfs_zmount.c3
-rw-r--r--lib/libzfs/os/linux/libzfs_mount_os.c4
-rw-r--r--lib/libzfs/os/linux/libzfs_util_os.c1
10 files changed, 33 insertions, 24 deletions
diff --git a/lib/libzfs/libzfs_changelist.c b/lib/libzfs/libzfs_changelist.c
index cb0b0fd0d..645a0fbef 100644
--- a/lib/libzfs/libzfs_changelist.c
+++ b/lib/libzfs/libzfs_changelist.c
@@ -592,7 +592,6 @@ 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)
{
@@ -602,13 +601,14 @@ compare_mountpoints(const void *a, const void *b, void *unused)
* hierarchy that is different from the dataset hierarchy, and still
* allow it to be changed.
*/
+ (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 a3ecc4a32..dd5901596 100644
--- a/lib/libzfs/libzfs_config.c
+++ b/lib/libzfs/libzfs_config.c
@@ -56,16 +56,14 @@ 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)
{
- int ret;
-
+ (void) unused;
const config_node_t *ca = (config_node_t *)a;
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)
return (-1);
diff --git a/lib/libzfs/libzfs_crypto.c b/lib/libzfs/libzfs_crypto.c
index f55c1c957..464a7f0fc 100644
--- a/lib/libzfs/libzfs_crypto.c
+++ b/lib/libzfs/libzfs_crypto.c
@@ -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,
uint8_t **restrict buf, size_t *restrict len_out)
{
+ (void) fsname, (void) newkey;
FILE *f = NULL;
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,
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;
@@ -773,7 +775,7 @@ error:
static int
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)
{
int ret;
@@ -916,8 +918,7 @@ populate_create_encryption_params_nvlists(libzfs_handle_t *hdl,
}
/* derive a key from the key material */
- ret = derive_key(hdl, keyformat, iters, key_material, key_material_len,
- salt, &key_data);
+ ret = derive_key(hdl, keyformat, iters, key_material, salt, &key_data);
if (ret != 0)
goto error;
@@ -1175,6 +1176,7 @@ 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),
@@ -1372,8 +1374,8 @@ try_again:
goto error;
/* derive a key from the key material */
- ret = derive_key(zhp->zfs_hdl, keyformat, iters, key_material,
- key_material_len, salt, &key_data);
+ ret = derive_key(zhp->zfs_hdl, keyformat, iters, key_material, salt,
+ &key_data);
if (ret != 0)
goto error;
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c
index 2b0bba47a..fb99abfe3 100644
--- a/lib/libzfs/libzfs_dataset.c
+++ b/lib/libzfs/libzfs_dataset.c
@@ -3180,6 +3180,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_iter.c b/lib/libzfs/libzfs_iter.c
index 0e9d97201..2e9ebf42f 100644
--- a/lib/libzfs/libzfs_iter.c
+++ b/lib/libzfs/libzfs_iter.c
@@ -39,7 +39,7 @@
#include "libzfs_impl.h"
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);
nvpair_t *pair;
@@ -206,6 +206,7 @@ zfs_iter_snapshots(zfs_handle_t *zhp, int flags, zfs_iter_f func,
int
zfs_iter_bookmarks(zfs_handle_t *zhp, int flags, zfs_iter_f func, void *data)
{
+ (void) flags;
zfs_handle_t *nzhp;
nvlist_t *props = NULL;
nvlist_t *bmarks = NULL;
@@ -496,7 +497,7 @@ iter_dependents_cb(zfs_handle_t *zhp, void *arg)
ida->first = B_FALSE;
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) {
iter_stack_frame_t isf;
iter_stack_frame_t *f;
diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c
index 62fed92fa..fca7455f4 100644
--- a/lib/libzfs/libzfs_mount.c
+++ b/lib/libzfs/libzfs_mount.c
@@ -244,12 +244,11 @@ zfs_is_mounted(zfs_handle_t *zhp, char **where)
* Checks any higher order concerns about whether the given dataset is
* mountable, false otherwise. zfs_is_mountable_internal specifically assumes
* 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
-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_status.c b/lib/libzfs/libzfs_status.c
index 33d6e1bfd..b7713b2bf 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_zmount.c b/lib/libzfs/os/freebsd/libzfs_zmount.c
index 12317fdde..79a8fe111 100644
--- a/lib/libzfs/os/freebsd/libzfs_zmount.c
+++ b/lib/libzfs/os/freebsd/libzfs_zmount.c
@@ -123,6 +123,7 @@ do_mount(zfs_handle_t *zhp, const char *mntpt, char *opts, int flags)
int
do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags)
{
+ (void) zhp;
if (unmount(mntpt, flags) < 0)
return (errno);
return (0);
@@ -138,10 +139,12 @@ zfs_mount_delegation_check(void)
void
zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force)
{
+ (void) zhp, (void) force;
}
/* Called from the tail end of zfs_unmount() */
void
zpool_disable_volume_os(const char *name)
{
+ (void) name;
}
diff --git a/lib/libzfs/os/linux/libzfs_mount_os.c b/lib/libzfs/os/linux/libzfs_mount_os.c
index 29fea736b..e4fe8181b 100644
--- a/lib/libzfs/os/linux/libzfs_mount_os.c
+++ b/lib/libzfs/os/linux/libzfs_mount_os.c
@@ -376,6 +376,8 @@ do_mount(zfs_handle_t *zhp, const char *mntpt, char *opts, int flags)
int
do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags)
{
+ (void) zhp;
+
if (!libzfs_envvar_is_set("ZFS_MOUNT_HELPER")) {
int rv = umount2(mntpt, flags);
@@ -416,10 +418,12 @@ zfs_mount_delegation_check(void)
void
zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force)
{
+ (void) zhp, (void) force;
}
/* Called from the tail end of zfs_unmount() */
void
zpool_disable_volume_os(const char *name)
{
+ (void) name;
}
diff --git a/lib/libzfs/os/linux/libzfs_util_os.c b/lib/libzfs/os/linux/libzfs_util_os.c
index 2ac31f107..a32aa1513 100644
--- a/lib/libzfs/os/linux/libzfs_util_os.c
+++ b/lib/libzfs/os/linux/libzfs_util_os.c
@@ -187,6 +187,7 @@ find_shares_object(differ_info_t *di)
int
zfs_destroy_snaps_nvl_os(libzfs_handle_t *hdl, nvlist_t *snaps)
{
+ (void) hdl, (void) snaps;
return (0);
}