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_MAX (256 * 1024)
/*ARGSUSED*/
kthread_t *
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
* =========================================================================
*/
/*ARGSUSED*/
kstat_t *
kstat_create(const char *module, int instance, const char *name,
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);
}
/*ARGSUSED*/
void
kstat_install(kstat_t *ksp)
{}
{
(void) ksp;
}
/*ARGSUSED*/
void
kstat_delete(kstat_t *ksp)
{}
{
(void) ksp;
}
void
kstat_set_raw_ops(kstat_t *ksp,
int (*headers)(char *buf, size_t size),
int (*data)(char *buf, size_t size, void *data),
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
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));
memset(&mp->m_owner, 0, sizeof (pthread_t));
}
@ -183,9 +188,7 @@ mutex_enter(kmutex_t *mp)
int
mutex_tryenter(kmutex_t *mp)
{
int error;
error = pthread_mutex_trylock(&mp->m_lock);
int error = pthread_mutex_trylock(&mp->m_lock);
if (error == 0) {
mp->m_owner = pthread_self();
return (1);
@ -211,6 +214,7 @@ mutex_exit(kmutex_t *mp)
void
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));
rwlp->rw_readers = 0;
rwlp->rw_owner = 0;
@ -269,19 +273,20 @@ rw_tryenter(krwlock_t *rwlp, krw_t rw)
return (0);
}
/* ARGSUSED */
uint32_t
zone_get_hostid(void *zonep)
{
/*
* We're emulating the system's hostid in userland.
*/
(void) zonep;
return (strtoul(hw_serial, NULL, 10));
}
int
rw_tryupgrade(krwlock_t *rwlp)
{
(void) rwlp;
return (0);
}
@ -294,6 +299,7 @@ rw_tryupgrade(krwlock_t *rwlp)
void
cv_init(kcondvar_t *cv, char *name, int type, void *arg)
{
(void) name, (void) type, (void) arg;
VERIFY0(pthread_cond_init(cv, NULL));
}
@ -351,11 +357,11 @@ cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime)
return (1);
}
/*ARGSUSED*/
int
cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res,
int flag)
{
(void) res;
int error;
struct timeval tv;
struct timespec ts;
@ -411,7 +417,9 @@ cv_broadcast(kcondvar_t *cv)
void
seq_printf(struct seq_file *m, const char *fmt, ...)
{}
{
(void) m, (void) fmt;
}
void
procfs_list_install(const char *module,
@ -424,6 +432,8 @@ procfs_list_install(const char *module,
int (*clear)(procfs_list_t *procfs_list),
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);
list_create(&procfs_list->pl_list,
procfs_list_node_off + sizeof (procfs_list_node_t),
@ -434,7 +444,9 @@ procfs_list_install(const char *module,
void
procfs_list_uninstall(procfs_list_t *procfs_list)
{}
{
(void) procfs_list;
}
void
procfs_list_destroy(procfs_list_t *procfs_list)
@ -738,6 +750,7 @@ random_get_pseudo_bytes(uint8_t *ptr, size_t len)
int
ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result)
{
(void) nptr;
char *end;
*result = strtoul(hw_serial, &end, base);
@ -749,6 +762,7 @@ ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result)
int
ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result)
{
(void) nptr;
char *end;
*result = strtoull(str, &end, base);
@ -826,60 +840,70 @@ kernel_fini(void)
uid_t
crgetuid(cred_t *cr)
{
(void) cr;
return (0);
}
uid_t
crgetruid(cred_t *cr)
{
(void) cr;
return (0);
}
gid_t
crgetgid(cred_t *cr)
{
(void) cr;
return (0);
}
int
crgetngroups(cred_t *cr)
{
(void) cr;
return (0);
}
gid_t *
crgetgroups(cred_t *cr)
{
(void) cr;
return (NULL);
}
int
zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr)
{
(void) name, (void) cr;
return (0);
}
int
zfs_secpolicy_rename_perms(const char *from, const char *to, cred_t *cr)
{
(void) from, (void) to, (void) cr;
return (0);
}
int
zfs_secpolicy_destroy_perms(const char *name, cred_t *cr)
{
(void) name, (void) cr;
return (0);
}
int
secpolicy_zfs(const cred_t *cr)
{
(void) cr;
return (0);
}
int
secpolicy_zfs_proc(const cred_t *cr, proc_t *proc)
{
(void) cr, (void) proc;
return (0);
}
@ -926,25 +950,25 @@ kmem_asprintf(const char *fmt, ...)
return (buf);
}
/* ARGSUSED */
zfs_file_t *
zfs_onexit_fd_hold(int fd, minor_t *minorp)
{
(void) fd;
*minorp = 0;
return (NULL);
}
/* ARGSUSED */
void
zfs_onexit_fd_rele(zfs_file_t *fp)
{
(void) fp;
}
/* ARGSUSED */
int
zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data,
uint64_t *action_handle)
{
(void) minor, (void) func, (void) data, (void) action_handle;
return (0);
}
@ -957,6 +981,7 @@ spl_fstrans_mark(void)
void
spl_fstrans_unmark(fstrans_cookie_t cookie)
{
(void) cookie;
}
int
@ -976,22 +1001,26 @@ void *zvol_tag = "zvol_tag";
void
zvol_create_minor(const char *name)
{
(void) name;
}
void
zvol_create_minors_recursive(const char *name)
{
(void) name;
}
void
zvol_remove_minors(spa_t *spa, const char *name, boolean_t async)
{
(void) spa, (void) name, (void) async;
}
void
zvol_rename_minors(spa_t *spa, const char *oldname, const char *newname,
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
zfs_file_fsync(zfs_file_t *fp, int flags)
{
int rc;
(void) flags;
rc = fsync(fp->f_fd);
if (rc < 0)
if (fsync(fp->f_fd) < 0)
return (errno);
return (0);
@ -1310,6 +1338,7 @@ zfs_file_fallocate(zfs_file_t *fp, int mode, loff_t offset, loff_t len)
#ifdef __linux__
return (fallocate(fp->f_fd, mode, offset, len));
#else
(void) fp, (void) mode, (void) offset, (void) len;
return (EOPNOTSUPP);
#endif
}
@ -1353,8 +1382,8 @@ zfs_file_unlink(const char *path)
zfs_file_t *
zfs_file_get(int fd)
{
(void) fd;
abort();
return (NULL);
}
/*
@ -1368,9 +1397,11 @@ void
zfs_file_put(zfs_file_t *fp)
{
abort();
(void) fp;
}
void
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
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)
{
(void) tq, (void) func, (void) arg, (void) tqflags, (void) expire_time;
return (0);
}
@ -199,12 +200,14 @@ taskq_wait(taskq_t *tq)
void
taskq_wait_id(taskq_t *tq, taskqid_t id)
{
(void) id;
taskq_wait(tq);
}
void
taskq_wait_outstanding(taskq_t *tq, taskqid_t id)
{
(void) id;
taskq_wait(tq);
}
@ -247,11 +250,11 @@ taskq_thread(void *arg)
thread_exit();
}
/*ARGSUSED*/
taskq_t *
taskq_create(const char *name, int nthreads, pri_t pri,
int minalloc, int maxalloc, uint_t flags)
{
(void) pri;
taskq_t *tq = kmem_zalloc(sizeof (taskq_t), KM_SLEEP);
int t;
@ -356,6 +359,7 @@ taskq_of_curthread(void)
int
taskq_cancel_id(taskq_t *tq, taskqid_t id)
{
(void) tq, (void) id;
return (ENOENT);
}

View File

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