MFV r324198: 8081 Compiler warnings in zdb
illumos/illumos-gate@3f7978d02b
3f7978d02b
https://www.illumos.org/issues/8081
zdb(8) is full of minor problems that generate compiler warnings. On FreeBSD,
which uses -WError, the only way to build it is to disable all compiler
warnings. This makes it much harder to detect newly introduced bugs. We should
cleanup all the warnings.
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Alan Somers <asomers@gmail.com>
This commit is contained in:
commit
d8e89539c8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329694
@ -4439,8 +4439,9 @@ arc_kmem_reap_now(void)
|
||||
* This possible deadlock is avoided by always acquiring a hash lock
|
||||
* using mutex_tryenter() from arc_reclaim_thread().
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
arc_reclaim_thread(void *dummy __unused)
|
||||
arc_reclaim_thread(void *unused __unused)
|
||||
{
|
||||
hrtime_t growtime = 0;
|
||||
callb_cpr_t cpr;
|
||||
@ -7580,8 +7581,9 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
|
||||
* This thread feeds the L2ARC at regular intervals. This is the beating
|
||||
* heart of the L2ARC.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
l2arc_feed_thread(void *dummy __unused)
|
||||
l2arc_feed_thread(void *unused __unused)
|
||||
{
|
||||
callb_cpr_t cpr;
|
||||
l2arc_dev_t *dev;
|
||||
|
@ -495,8 +495,9 @@ dbuf_evict_one(void)
|
||||
* of the dbuf cache is at or below the maximum size. Once the dbuf is aged
|
||||
* out of the cache it is destroyed and becomes eligible for arc eviction.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
dbuf_evict_thread(void *dummy __unused)
|
||||
dbuf_evict_thread(void *unused __unused)
|
||||
{
|
||||
callb_cpr_t cpr;
|
||||
|
||||
|
@ -6175,7 +6175,7 @@ spa_async_autoexpand(spa_t *spa, vdev_t *vd)
|
||||
static void
|
||||
spa_async_thread(void *arg)
|
||||
{
|
||||
spa_t *spa = arg;
|
||||
spa_t *spa = (spa_t *)arg;
|
||||
int tasks;
|
||||
|
||||
ASSERT(spa->spa_sync_on);
|
||||
|
@ -41,7 +41,7 @@ extern "C" {
|
||||
* particular object, use FTAG (which is a string) for the holder_tag.
|
||||
* Otherwise, use the object that holds the reference.
|
||||
*/
|
||||
#define FTAG ((char *)__func__)
|
||||
#define FTAG ((char *)(uintptr_t)__func__)
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
typedef struct reference {
|
||||
|
@ -147,8 +147,8 @@ int sa_replace_all_by_template(sa_handle_t *, sa_bulk_attr_t *,
|
||||
int sa_replace_all_by_template_locked(sa_handle_t *, sa_bulk_attr_t *,
|
||||
int, dmu_tx_t *);
|
||||
boolean_t sa_enabled(objset_t *);
|
||||
void sa_cache_init();
|
||||
void sa_cache_fini();
|
||||
void sa_cache_init(void);
|
||||
void sa_cache_fini(void);
|
||||
int sa_set_sa_object(objset_t *, uint64_t);
|
||||
int sa_hdrsize(void *);
|
||||
void sa_handle_lock(sa_handle_t *);
|
||||
|
@ -890,7 +890,7 @@ extern void vdev_cache_stat_fini(void);
|
||||
/* Initialization and termination */
|
||||
extern void spa_init(int flags);
|
||||
extern void spa_fini(void);
|
||||
extern void spa_boot_init();
|
||||
extern void spa_boot_init(void);
|
||||
|
||||
/* properties */
|
||||
extern int spa_prop_set(spa_t *spa, nvlist_t *nvp);
|
||||
|
@ -389,7 +389,7 @@ typedef int zil_parse_blk_func_t(zilog_t *zilog, blkptr_t *bp, void *arg,
|
||||
uint64_t txg);
|
||||
typedef int zil_parse_lr_func_t(zilog_t *zilog, lr_t *lr, void *arg,
|
||||
uint64_t txg);
|
||||
typedef int zil_replay_func_t();
|
||||
typedef int zil_replay_func_t(void *arg1, void *arg2, boolean_t byteswap);
|
||||
typedef int zil_get_data_t(void *arg, lr_write_t *lr, char *dbuf,
|
||||
struct lwb *lwb, zio_t *zio);
|
||||
|
||||
|
@ -72,7 +72,7 @@ zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t mode,
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
zfs_replay_error(zfsvfs_t *zfsvfs, lr_t *lr, boolean_t byteswap)
|
||||
zfs_replay_error(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
return (SET_ERROR(ENOTSUP));
|
||||
}
|
||||
@ -265,9 +265,10 @@ zfs_replay_swap_attrs(lr_attr_t *lrattr)
|
||||
* as option FUID information.
|
||||
*/
|
||||
static int
|
||||
zfs_replay_create_acl(zfsvfs_t *zfsvfs,
|
||||
lr_acl_create_t *lracl, boolean_t byteswap)
|
||||
zfs_replay_create_acl(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_acl_create_t *lracl = arg2;
|
||||
char *name = NULL; /* location determined later */
|
||||
lr_create_t *lr = (lr_create_t *)lracl;
|
||||
znode_t *dzp;
|
||||
@ -414,8 +415,10 @@ zfs_replay_create_acl(zfsvfs_t *zfsvfs,
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_replay_create(zfsvfs_t *zfsvfs, lr_create_t *lr, boolean_t byteswap)
|
||||
zfs_replay_create(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_create_t *lr = arg2;
|
||||
char *name = NULL; /* location determined later */
|
||||
char *link; /* symlink content follows name */
|
||||
znode_t *dzp;
|
||||
@ -546,8 +549,10 @@ zfs_replay_create(zfsvfs_t *zfsvfs, lr_create_t *lr, boolean_t byteswap)
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap)
|
||||
zfs_replay_remove(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_remove_t *lr = arg2;
|
||||
char *name = (char *)(lr + 1); /* name follows lr_remove_t */
|
||||
znode_t *dzp;
|
||||
struct componentname cn;
|
||||
@ -597,8 +602,10 @@ zfs_replay_remove(zfsvfs_t *zfsvfs, lr_remove_t *lr, boolean_t byteswap)
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap)
|
||||
zfs_replay_link(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_link_t *lr = arg2;
|
||||
char *name = (char *)(lr + 1); /* name follows lr_link_t */
|
||||
znode_t *dzp, *zp;
|
||||
struct componentname cn;
|
||||
@ -637,8 +644,10 @@ zfs_replay_link(zfsvfs_t *zfsvfs, lr_link_t *lr, boolean_t byteswap)
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap)
|
||||
zfs_replay_rename(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_rename_t *lr = arg2;
|
||||
char *sname = (char *)(lr + 1); /* sname and tname follow lr_rename_t */
|
||||
char *tname = sname + strlen(sname) + 1;
|
||||
znode_t *sdzp, *tdzp;
|
||||
@ -707,8 +716,10 @@ zfs_replay_rename(zfsvfs_t *zfsvfs, lr_rename_t *lr, boolean_t byteswap)
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_replay_write(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap)
|
||||
zfs_replay_write(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_write_t *lr = arg2;
|
||||
char *data = (char *)(lr + 1); /* data follows lr_write_t */
|
||||
znode_t *zp;
|
||||
int error;
|
||||
@ -773,8 +784,10 @@ zfs_replay_write(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap)
|
||||
* the file is grown.
|
||||
*/
|
||||
static int
|
||||
zfs_replay_write2(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap)
|
||||
zfs_replay_write2(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_write_t *lr = arg2;
|
||||
znode_t *zp;
|
||||
int error;
|
||||
uint64_t end;
|
||||
@ -818,9 +831,11 @@ zfs_replay_write2(zfsvfs_t *zfsvfs, lr_write_t *lr, boolean_t byteswap)
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_replay_truncate(zfsvfs_t *zfsvfs, lr_truncate_t *lr, boolean_t byteswap)
|
||||
zfs_replay_truncate(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
#ifdef illumos
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_truncate_t *lr = arg2;
|
||||
znode_t *zp;
|
||||
flock64_t fl;
|
||||
int error;
|
||||
@ -850,8 +865,10 @@ zfs_replay_truncate(zfsvfs_t *zfsvfs, lr_truncate_t *lr, boolean_t byteswap)
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_replay_setattr(zfsvfs_t *zfsvfs, lr_setattr_t *lr, boolean_t byteswap)
|
||||
zfs_replay_setattr(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_setattr_t *lr = arg2;
|
||||
znode_t *zp;
|
||||
xvattr_t xva;
|
||||
vattr_t *vap = &xva.xva_vattr;
|
||||
@ -909,8 +926,10 @@ extern int zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int flag, cred_t *cr,
|
||||
caller_context_t *ct);
|
||||
|
||||
static int
|
||||
zfs_replay_acl_v0(zfsvfs_t *zfsvfs, lr_acl_v0_t *lr, boolean_t byteswap)
|
||||
zfs_replay_acl_v0(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_acl_v0_t *lr = arg2;
|
||||
ace_t *ace = (ace_t *)(lr + 1); /* ace array follows lr_acl_t */
|
||||
vsecattr_t vsa;
|
||||
vnode_t *vp;
|
||||
@ -957,8 +976,10 @@ zfs_replay_acl_v0(zfsvfs_t *zfsvfs, lr_acl_v0_t *lr, boolean_t byteswap)
|
||||
*
|
||||
*/
|
||||
static int
|
||||
zfs_replay_acl(zfsvfs_t *zfsvfs, lr_acl_t *lr, boolean_t byteswap)
|
||||
zfs_replay_acl(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = arg1;
|
||||
lr_acl_t *lr = arg2;
|
||||
ace_t *ace = (ace_t *)(lr + 1);
|
||||
vsecattr_t vsa;
|
||||
znode_t *zp;
|
||||
|
@ -495,8 +495,10 @@ zvol_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx)
|
||||
* implement DKIOCFREE/free-long-range.
|
||||
*/
|
||||
static int
|
||||
zvol_replay_truncate(zvol_state_t *zv, lr_truncate_t *lr, boolean_t byteswap)
|
||||
zvol_replay_truncate(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zvol_state_t *zv = arg1;
|
||||
lr_truncate_t *lr = arg2;
|
||||
uint64_t offset, length;
|
||||
|
||||
if (byteswap)
|
||||
@ -513,8 +515,10 @@ zvol_replay_truncate(zvol_state_t *zv, lr_truncate_t *lr, boolean_t byteswap)
|
||||
* after a system failure
|
||||
*/
|
||||
static int
|
||||
zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, boolean_t byteswap)
|
||||
zvol_replay_write(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
zvol_state_t *zv = arg1;
|
||||
lr_write_t *lr = arg2;
|
||||
objset_t *os = zv->zv_objset;
|
||||
char *data = (char *)(lr + 1); /* data follows lr_write_t */
|
||||
uint64_t offset, length;
|
||||
@ -551,7 +555,7 @@ zvol_replay_write(zvol_state_t *zv, lr_write_t *lr, boolean_t byteswap)
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
zvol_replay_err(zvol_state_t *zv, lr_t *lr, boolean_t byteswap)
|
||||
zvol_replay_err(void *arg1, void *arg2, boolean_t byteswap)
|
||||
{
|
||||
return (SET_ERROR(ENOTSUP));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user