Skip to content

Commit

Permalink
module: zfs: fix unused, remove argsused
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12844
  • Loading branch information
nabijaczleweli authored and tonyhutter committed Feb 16, 2022
1 parent 5e0c37f commit da52f2f
Show file tree
Hide file tree
Showing 55 changed files with 226 additions and 175 deletions.
2 changes: 1 addition & 1 deletion module/os/freebsd/zfs/vdev_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,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 = {
Expand Down
4 changes: 4 additions & 0 deletions module/os/freebsd/zfs/zfs_racct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}

Expand All @@ -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 */
}
5 changes: 2 additions & 3 deletions module/os/freebsd/zfs/zio_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,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)
Expand Down Expand Up @@ -1259,13 +1258,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;
Expand Down Expand Up @@ -1562,12 +1561,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;
Expand Down
2 changes: 1 addition & 1 deletion module/os/linux/zfs/vdev_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 2 additions & 0 deletions module/os/linux/zfs/zfs_racct.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
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;
}
1 change: 1 addition & 0 deletions module/os/linux/zfs/zio_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,7 @@ 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;
Expand Down
6 changes: 3 additions & 3 deletions module/zfs/abd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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));
}

Expand Down
53 changes: 30 additions & 23 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,8 +1093,6 @@ static kmem_cache_t *buf_cache;
static void
buf_fini(void)
{
int i;

#if defined(_KERNEL)
/*
* Large allocations which do not require contiguous pages
Expand All @@ -1106,7 +1104,7 @@ buf_fini(void)
kmem_free(buf_hash_table.ht_table,
(buf_hash_table.ht_mask + 1) * sizeof (void *));
#endif
for (i = 0; i < BUF_LOCKS; i++)
for (int i = 0; i < BUF_LOCKS; i++)
mutex_destroy(BUF_HASH_LOCK(i));
kmem_cache_destroy(hdr_full_cache);
kmem_cache_destroy(hdr_full_crypt_cache);
Expand All @@ -1118,10 +1116,10 @@ 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);
Expand All @@ -1137,10 +1135,10 @@ 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);
Expand All @@ -1150,10 +1148,10 @@ 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);
Expand All @@ -1162,10 +1160,10 @@ 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));
Expand All @@ -1179,10 +1177,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));
Expand All @@ -1193,30 +1191,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);
Expand Down Expand Up @@ -1512,11 +1510,11 @@ arc_cksum_compute(arc_buf_t *buf)
void
arc_buf_sigsegv(int sig, siginfo_t *si, void *unused)
{
(void) sig, (void) unused;
panic("Got SIGSEGV at address: 0x%lx\n", (long)si->si_addr);
}
#endif

/* ARGSUSED */
static void
arc_buf_unwatch(arc_buf_t *buf)
{
Expand All @@ -1525,17 +1523,20 @@ 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)
{
#ifndef _KERNEL
if (arc_watch)
ASSERT0(mprotect(buf->b_data, arc_buf_size(buf),
PROT_READ));
#else
(void) buf;
#endif
}

Expand Down Expand Up @@ -1947,7 +1948,7 @@ arc_fill_hdr_crypt(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, spa_t *spa,
* arc_buf_fill().
*/
static void
arc_buf_untransform_in_place(arc_buf_t *buf, kmutex_t *hash_lock)
arc_buf_untransform_in_place(arc_buf_t *buf)
{
arc_buf_hdr_t *hdr = buf->b_hdr;

Expand Down Expand Up @@ -2051,7 +2052,7 @@ arc_buf_fill(arc_buf_t *buf, spa_t *spa, const zbookmark_phys_t *zb,

if (hash_lock != NULL)
mutex_enter(hash_lock);
arc_buf_untransform_in_place(buf, hash_lock);
arc_buf_untransform_in_place(buf);
if (hash_lock != NULL)
mutex_exit(hash_lock);

Expand Down Expand Up @@ -2337,6 +2338,7 @@ remove_reference(arc_buf_hdr_t *hdr, kmutex_t *hash_lock, void *tag)
void
arc_buf_info(arc_buf_t *ab, arc_buf_info_t *abi, int state_index)
{
(void) state_index;
arc_buf_hdr_t *hdr = ab->b_hdr;
l1arc_buf_hdr_t *l1hdr = NULL;
l2arc_buf_hdr_t *l2hdr = NULL;
Expand Down Expand Up @@ -4872,10 +4874,11 @@ 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
Expand Down Expand Up @@ -4915,10 +4918,11 @@ 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();

Expand Down Expand Up @@ -4955,10 +4959,11 @@ 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;

Expand Down Expand Up @@ -5002,10 +5007,11 @@ 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();

Expand Down Expand Up @@ -5620,11 +5626,12 @@ 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;

Expand All @@ -5633,11 +5640,11 @@ 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) {
Expand Down Expand Up @@ -9687,10 +9694,10 @@ 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;
Expand Down
Loading

0 comments on commit da52f2f

Please sign in to comment.