Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2018 23:58:05 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331399 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
Message-ID:  <201803222358.w2MNw5kP001312@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Mar 22 23:58:05 2018
New Revision: 331399
URL: https://svnweb.freebsd.org/changeset/base/331399

Log:
  MFC r329694: MFV r324198: 8081 Compiler warnings in zdb
  
  illumos/illumos-gate@3f7978d02b206a6ebc5652c91aa9f42da6fbe00c
  https://github.com/illumos/illumos-gate/commit/3f7978d02b206a6ebc5652c91aa9f42da6fbe00c
  
  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>

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Thu Mar 22 23:58:05 2018	(r331399)
@@ -4458,8 +4458,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;
@@ -7596,8 +7597,9 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint
  * 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;

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Thu Mar 22 23:58:05 2018	(r331399)
@@ -505,8 +505,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;
 

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Thu Mar 22 23:58:05 2018	(r331399)
@@ -6180,7 +6180,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);

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h	Thu Mar 22 23:58:05 2018	(r331399)
@@ -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 {

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa.h
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa.h	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa.h	Thu Mar 22 23:58:05 2018	(r331399)
@@ -147,8 +147,8 @@ int sa_replace_all_by_template(sa_handle_t *, sa_bulk_
 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 *);

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h	Thu Mar 22 23:58:05 2018	(r331399)
@@ -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);

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h	Thu Mar 22 23:58:05 2018	(r331399)
@@ -389,7 +389,7 @@ typedef int zil_parse_blk_func_t(zilog_t *zilog, blkpt
     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);
 

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c	Thu Mar 22 23:58:05 2018	(r331399)
@@ -72,7 +72,7 @@ zfs_init_vattr(vattr_t *vap, uint64_t mask, uint64_t m
 
 /* 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 @@ bail:
 }
 
 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 @@ out:
 }
 
 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 @@ fail:
 }
 
 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, boole
 }
 
 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 @@ fail:
 }
 
 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, boo
  * 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 @@ top:
 }
 
 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 *l
 }
 
 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 *vse
     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, b
  *
  */
 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;

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Thu Mar 22 23:56:53 2018	(r331398)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Thu Mar 22 23:58:05 2018	(r331399)
@@ -495,8 +495,10 @@ zvol_create_cb(objset_t *os, void *arg, cred_t *cr, dm
  * 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 *
  * 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, bo
 
 /* 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));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803222358.w2MNw5kP001312>