libzpool: 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 16:01:06 +01:00 committed by Brian Behlendorf
parent 57bff80ebf
commit 56050599c9
3 changed files with 61 additions and 23 deletions

View File

@ -75,7 +75,6 @@ struct proc p0;
#define TS_STACK_MIN MAX(PTHREAD_STACK_MIN, 32768) #define TS_STACK_MIN MAX(PTHREAD_STACK_MIN, 32768)
#define TS_STACK_MAX (256 * 1024) #define TS_STACK_MAX (256 * 1024)
/*ARGSUSED*/
kthread_t * kthread_t *
zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state) zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state)
{ {
@ -129,30 +128,35 @@ zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state)
* kstats * kstats
* ========================================================================= * =========================================================================
*/ */
/*ARGSUSED*/
kstat_t * kstat_t *
kstat_create(const char *module, int instance, const char *name, kstat_create(const char *module, int instance, const char *name,
const char *class, uchar_t type, ulong_t ndata, uchar_t ks_flag) 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); return (NULL);
} }
/*ARGSUSED*/
void void
kstat_install(kstat_t *ksp) kstat_install(kstat_t *ksp)
{} {
(void) ksp;
}
/*ARGSUSED*/
void void
kstat_delete(kstat_t *ksp) kstat_delete(kstat_t *ksp)
{} {
(void) ksp;
}
void void
kstat_set_raw_ops(kstat_t *ksp, kstat_set_raw_ops(kstat_t *ksp,
int (*headers)(char *buf, size_t size), int (*headers)(char *buf, size_t size),
int (*data)(char *buf, size_t size, void *data), int (*data)(char *buf, size_t size, void *data),
void *(*addr)(kstat_t *ksp, loff_t index)) void *(*addr)(kstat_t *ksp, loff_t index))
{} {
(void) ksp, (void) headers, (void) data, (void) addr;
}
/* /*
* ========================================================================= * =========================================================================
@ -163,6 +167,7 @@ kstat_set_raw_ops(kstat_t *ksp,
void void
mutex_init(kmutex_t *mp, char *name, int type, void *cookie) 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)); VERIFY0(pthread_mutex_init(&mp->m_lock, NULL));
memset(&mp->m_owner, 0, sizeof (pthread_t)); memset(&mp->m_owner, 0, sizeof (pthread_t));
} }
@ -183,9 +188,7 @@ mutex_enter(kmutex_t *mp)
int int
mutex_tryenter(kmutex_t *mp) mutex_tryenter(kmutex_t *mp)
{ {
int error; int error = pthread_mutex_trylock(&mp->m_lock);
error = pthread_mutex_trylock(&mp->m_lock);
if (error == 0) { if (error == 0) {
mp->m_owner = pthread_self(); mp->m_owner = pthread_self();
return (1); return (1);
@ -211,6 +214,7 @@ mutex_exit(kmutex_t *mp)
void void
rw_init(krwlock_t *rwlp, char *name, int type, void *arg) 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)); VERIFY0(pthread_rwlock_init(&rwlp->rw_lock, NULL));
rwlp->rw_readers = 0; rwlp->rw_readers = 0;
rwlp->rw_owner = 0; rwlp->rw_owner = 0;
@ -269,19 +273,20 @@ rw_tryenter(krwlock_t *rwlp, krw_t rw)
return (0); return (0);
} }
/* ARGSUSED */
uint32_t uint32_t
zone_get_hostid(void *zonep) zone_get_hostid(void *zonep)
{ {
/* /*
* We're emulating the system's hostid in userland. * We're emulating the system's hostid in userland.
*/ */
(void) zonep;
return (strtoul(hw_serial, NULL, 10)); return (strtoul(hw_serial, NULL, 10));
} }
int int
rw_tryupgrade(krwlock_t *rwlp) rw_tryupgrade(krwlock_t *rwlp)
{ {
(void) rwlp;
return (0); return (0);
} }
@ -294,6 +299,7 @@ rw_tryupgrade(krwlock_t *rwlp)
void void
cv_init(kcondvar_t *cv, char *name, int type, void *arg) cv_init(kcondvar_t *cv, char *name, int type, void *arg)
{ {
(void) name, (void) type, (void) arg;
VERIFY0(pthread_cond_init(cv, NULL)); VERIFY0(pthread_cond_init(cv, NULL));
} }
@ -351,11 +357,11 @@ cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime)
return (1); return (1);
} }
/*ARGSUSED*/
int int
cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res, cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res,
int flag) int flag)
{ {
(void) res;
int error; int error;
struct timeval tv; struct timeval tv;
struct timespec ts; struct timespec ts;
@ -411,7 +417,9 @@ cv_broadcast(kcondvar_t *cv)
void void
seq_printf(struct seq_file *m, const char *fmt, ...) seq_printf(struct seq_file *m, const char *fmt, ...)
{} {
(void) m, (void) fmt;
}
void void
procfs_list_install(const char *module, procfs_list_install(const char *module,
@ -424,6 +432,8 @@ procfs_list_install(const char *module,
int (*clear)(procfs_list_t *procfs_list), int (*clear)(procfs_list_t *procfs_list),
size_t procfs_list_node_off) 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); mutex_init(&procfs_list->pl_lock, NULL, MUTEX_DEFAULT, NULL);
list_create(&procfs_list->pl_list, list_create(&procfs_list->pl_list,
procfs_list_node_off + sizeof (procfs_list_node_t), procfs_list_node_off + sizeof (procfs_list_node_t),
@ -434,7 +444,9 @@ procfs_list_install(const char *module,
void void
procfs_list_uninstall(procfs_list_t *procfs_list) procfs_list_uninstall(procfs_list_t *procfs_list)
{} {
(void) procfs_list;
}
void void
procfs_list_destroy(procfs_list_t *procfs_list) procfs_list_destroy(procfs_list_t *procfs_list)
@ -738,6 +750,7 @@ random_get_pseudo_bytes(uint8_t *ptr, size_t len)
int int
ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result) ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result)
{ {
(void) nptr;
char *end; char *end;
*result = strtoul(hw_serial, &end, base); *result = strtoul(hw_serial, &end, base);
@ -749,6 +762,7 @@ ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result)
int int
ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result) ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result)
{ {
(void) nptr;
char *end; char *end;
*result = strtoull(str, &end, base); *result = strtoull(str, &end, base);
@ -826,60 +840,70 @@ kernel_fini(void)
uid_t uid_t
crgetuid(cred_t *cr) crgetuid(cred_t *cr)
{ {
(void) cr;
return (0); return (0);
} }
uid_t uid_t
crgetruid(cred_t *cr) crgetruid(cred_t *cr)
{ {
(void) cr;
return (0); return (0);
} }
gid_t gid_t
crgetgid(cred_t *cr) crgetgid(cred_t *cr)
{ {
(void) cr;
return (0); return (0);
} }
int int
crgetngroups(cred_t *cr) crgetngroups(cred_t *cr)
{ {
(void) cr;
return (0); return (0);
} }
gid_t * gid_t *
crgetgroups(cred_t *cr) crgetgroups(cred_t *cr)
{ {
(void) cr;
return (NULL); return (NULL);
} }
int int
zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr) zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr)
{ {
(void) name, (void) cr;
return (0); return (0);
} }
int int
zfs_secpolicy_rename_perms(const char *from, const char *to, cred_t *cr) zfs_secpolicy_rename_perms(const char *from, const char *to, cred_t *cr)
{ {
(void) from, (void) to, (void) cr;
return (0); return (0);
} }
int int
zfs_secpolicy_destroy_perms(const char *name, cred_t *cr) zfs_secpolicy_destroy_perms(const char *name, cred_t *cr)
{ {
(void) name, (void) cr;
return (0); return (0);
} }
int int
secpolicy_zfs(const cred_t *cr) secpolicy_zfs(const cred_t *cr)
{ {
(void) cr;
return (0); return (0);
} }
int int
secpolicy_zfs_proc(const cred_t *cr, proc_t *proc) secpolicy_zfs_proc(const cred_t *cr, proc_t *proc)
{ {
(void) cr, (void) proc;
return (0); return (0);
} }
@ -926,25 +950,25 @@ kmem_asprintf(const char *fmt, ...)
return (buf); return (buf);
} }
/* ARGSUSED */
zfs_file_t * zfs_file_t *
zfs_onexit_fd_hold(int fd, minor_t *minorp) zfs_onexit_fd_hold(int fd, minor_t *minorp)
{ {
(void) fd;
*minorp = 0; *minorp = 0;
return (NULL); return (NULL);
} }
/* ARGSUSED */
void void
zfs_onexit_fd_rele(zfs_file_t *fp) zfs_onexit_fd_rele(zfs_file_t *fp)
{ {
(void) fp;
} }
/* ARGSUSED */
int int
zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data, zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data,
uint64_t *action_handle) uint64_t *action_handle)
{ {
(void) minor, (void) func, (void) data, (void) action_handle;
return (0); return (0);
} }
@ -957,6 +981,7 @@ spl_fstrans_mark(void)
void void
spl_fstrans_unmark(fstrans_cookie_t cookie) spl_fstrans_unmark(fstrans_cookie_t cookie)
{ {
(void) cookie;
} }
int int
@ -976,22 +1001,26 @@ void *zvol_tag = "zvol_tag";
void void
zvol_create_minor(const char *name) zvol_create_minor(const char *name)
{ {
(void) name;
} }
void void
zvol_create_minors_recursive(const char *name) zvol_create_minors_recursive(const char *name)
{ {
(void) name;
} }
void void
zvol_remove_minors(spa_t *spa, const char *name, boolean_t async) zvol_remove_minors(spa_t *spa, const char *name, boolean_t async)
{ {
(void) spa, (void) name, (void) async;
} }
void void
zvol_rename_minors(spa_t *spa, const char *oldname, const char *newname, zvol_rename_minors(spa_t *spa, const char *oldname, const char *newname,
boolean_t async) boolean_t async)
{ {
(void) spa, (void) oldname, (void) newname, (void) async;
} }
/* /*
@ -1285,10 +1314,9 @@ zfs_file_getattr(zfs_file_t *fp, zfs_file_attr_t *zfattr)
int int
zfs_file_fsync(zfs_file_t *fp, int flags) zfs_file_fsync(zfs_file_t *fp, int flags)
{ {
int rc; (void) flags;
rc = fsync(fp->f_fd); if (fsync(fp->f_fd) < 0)
if (rc < 0)
return (errno); return (errno);
return (0); return (0);
@ -1310,6 +1338,7 @@ zfs_file_fallocate(zfs_file_t *fp, int mode, loff_t offset, loff_t len)
#ifdef __linux__ #ifdef __linux__
return (fallocate(fp->f_fd, mode, offset, len)); return (fallocate(fp->f_fd, mode, offset, len));
#else #else
(void) fp, (void) mode, (void) offset, (void) len;
return (EOPNOTSUPP); return (EOPNOTSUPP);
#endif #endif
} }
@ -1353,8 +1382,8 @@ zfs_file_unlink(const char *path)
zfs_file_t * zfs_file_t *
zfs_file_get(int fd) zfs_file_get(int fd)
{ {
(void) fd;
abort(); abort();
return (NULL); return (NULL);
} }
/* /*
@ -1368,9 +1397,11 @@ void
zfs_file_put(zfs_file_t *fp) zfs_file_put(zfs_file_t *fp)
{ {
abort(); abort();
(void) fp;
} }
void void
zfsvfs_update_fromname(const char *oldname, const char *newname) zfsvfs_update_fromname(const char *oldname, const char *newname)
{ {
(void) oldname, (void) newname;
} }

View File

@ -134,9 +134,10 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags)
} }
taskqid_t 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) clock_t expire_time)
{ {
(void) tq, (void) func, (void) arg, (void) tqflags, (void) expire_time;
return (0); return (0);
} }
@ -199,12 +200,14 @@ taskq_wait(taskq_t *tq)
void void
taskq_wait_id(taskq_t *tq, taskqid_t id) taskq_wait_id(taskq_t *tq, taskqid_t id)
{ {
(void) id;
taskq_wait(tq); taskq_wait(tq);
} }
void void
taskq_wait_outstanding(taskq_t *tq, taskqid_t id) taskq_wait_outstanding(taskq_t *tq, taskqid_t id)
{ {
(void) id;
taskq_wait(tq); taskq_wait(tq);
} }
@ -247,11 +250,11 @@ taskq_thread(void *arg)
thread_exit(); thread_exit();
} }
/*ARGSUSED*/
taskq_t * taskq_t *
taskq_create(const char *name, int nthreads, pri_t pri, taskq_create(const char *name, int nthreads, pri_t pri,
int minalloc, int maxalloc, uint_t flags) int minalloc, int maxalloc, uint_t flags)
{ {
(void) pri;
taskq_t *tq = kmem_zalloc(sizeof (taskq_t), KM_SLEEP); taskq_t *tq = kmem_zalloc(sizeof (taskq_t), KM_SLEEP);
int t; int t;
@ -356,6 +359,7 @@ taskq_of_curthread(void)
int int
taskq_cancel_id(taskq_t *tq, taskqid_t id) taskq_cancel_id(taskq_t *tq, taskqid_t id)
{ {
(void) tq, (void) id;
return (ENOENT); return (ENOENT);
} }

View File

@ -242,6 +242,7 @@ out_ret:
static nvlist_t * static nvlist_t *
refresh_config(void *unused, nvlist_t *tryconfig) refresh_config(void *unused, nvlist_t *tryconfig)
{ {
(void) unused;
return (spa_tryimport(tryconfig)); return (spa_tryimport(tryconfig));
} }
@ -254,6 +255,7 @@ refresh_config(void *unused, nvlist_t *tryconfig)
static int static int
pool_active(void *unused, const char *name, uint64_t guid, boolean_t *isactive) pool_active(void *unused, const char *name, uint64_t guid, boolean_t *isactive)
{ {
(void) unused, (void) guid;
zfs_iocparm_t zp; zfs_iocparm_t zp;
zfs_cmd_t *zc = NULL; zfs_cmd_t *zc = NULL;
zfs_cmd_legacy_t *zcl = NULL; zfs_cmd_legacy_t *zcl = NULL;
@ -322,6 +324,7 @@ static int
pool_active(void *unused, const char *name, uint64_t guid, pool_active(void *unused, const char *name, uint64_t guid,
boolean_t *isactive) boolean_t *isactive)
{ {
(void) unused, (void) guid;
int fd = open(ZFS_DEV, O_RDWR | O_CLOEXEC); int fd = open(ZFS_DEV, O_RDWR | O_CLOEXEC);
if (fd < 0) if (fd < 0)
return (-1); return (-1);