Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Sep 2016 04:21:40 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r305273 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201609020421.u824LeSZ025418@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri Sep  2 04:21:40 2016
New Revision: 305273
URL: https://svnweb.freebsd.org/changeset/base/305273

Log:
  MFstable/11 r305271:
  
  MFC r303576:
  
  Conditionalize code which defines sysctls per _KERNEL #ifdef guard
  
  This resolves several issues when compiling libzpool (userspace library), i.e.
  -Wimplicit-function-declaration and -Wmissing-declarations issues.
  
  Tested with:	clang 3.8.1, gcc 4.2.1, gcc 5.3.0

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c	Fri Sep  2 04:12:36 2016	(r305272)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c	Fri Sep  2 04:21:40 2016	(r305273)
@@ -58,9 +58,11 @@ typedef struct mirror_map {
 
 static int vdev_mirror_shift = 21;
 
+#ifdef _KERNEL
 SYSCTL_DECL(_vfs_zfs_vdev);
 static SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0,
     "ZFS VDEV Mirror");
+#endif
 
 /*
  * The load configuration settings below are tuned by default for
@@ -74,34 +76,44 @@ static SYSCTL_NODE(_vfs_zfs_vdev, OID_AU
 
 /* Rotating media load calculation configuration. */
 static int rotating_inc = 0;
+#ifdef _KERNEL
 TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_inc", &rotating_inc);
 SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RW,
     &rotating_inc, 0, "Rotating media load increment for non-seeking I/O's");
+#endif
 
 static int rotating_seek_inc = 5;
+#ifdef _KERNEL
 TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_inc", &rotating_seek_inc);
 SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RW,
     &rotating_seek_inc, 0, "Rotating media load increment for seeking I/O's");
+#endif
 
 static int rotating_seek_offset = 1 * 1024 * 1024;
+#ifdef _KERNEL
 TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_offset", &rotating_seek_offset);
 SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RW,
     &rotating_seek_offset, 0, "Offset in bytes from the last I/O which "
     "triggers a reduced rotating media seek increment");
+#endif
 
 /* Non-rotating media load calculation configuration. */
 static int non_rotating_inc = 0;
+#ifdef _KERNEL
 TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_inc", &non_rotating_inc);
 SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RW,
     &non_rotating_inc, 0,
     "Non-rotating media load increment for non-seeking I/O's");
+#endif
 
 static int non_rotating_seek_inc = 1;
+#ifdef _KERNEL
 TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_seek_inc",
      &non_rotating_seek_inc);
 SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RW,
     &non_rotating_seek_inc, 0,
     "Non-rotating media load increment for seeking I/O's");
+#endif
 
 
 static inline size_t

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Fri Sep  2 04:12:36 2016	(r305272)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Fri Sep  2 04:21:40 2016	(r305273)
@@ -176,6 +176,7 @@ int zfs_vdev_read_gap_limit = 32 << 10;
 int zfs_vdev_write_gap_limit = 4 << 10;
 
 #ifdef __FreeBSD__
+#ifdef _KERNEL
 SYSCTL_DECL(_vfs_zfs_vdev);
 
 TUNABLE_INT("vfs.zfs.vdev.async_write_active_min_dirty_percent",
@@ -283,6 +284,7 @@ sysctl_zfs_async_write_active_max_dirty_
 	return (0);
 }
 #endif
+#endif
 
 int
 vdev_queue_offset_compare(const void *x1, const void *x2)



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