]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
define aok in libnvpair which is linked to all zfs libraries that need aok
authoravg <avg@FreeBSD.org>
Mon, 28 Sep 2015 15:25:36 +0000 (15:25 +0000)
committeravg <avg@FreeBSD.org>
Mon, 28 Sep 2015 15:25:36 +0000 (15:25 +0000)
This removes the circular dependency of libnvpair on libzfs / libzpool.

PR: 199811
Obtained from: bapt
MFC after: 23 days

cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
sys/cddl/contrib/opensolaris/common/nvpair/opensolaris_nvpair.c

index 427b2fd8dee4159d2d7bb8546c0a1ce6ebd1d5f4..ab8a9bffefba2b578e401e7afc6694987d8e8123 100644 (file)
@@ -55,7 +55,6 @@
 #include "zfs_prop.h"
 #include "zfeature_common.h"
 
-int aok;
 
 int
 libzfs_errno(libzfs_handle_t *hdl)
index ef386968e8583ebd8b12e3faa169f211ddb37141..f2515d5ab4a64f871076177b3edae2645345621e 100644 (file)
@@ -45,7 +45,9 @@
  * Emulation of kernel services in userland.
  */
 
+#ifndef __FreeBSD__
 int aok;
+#endif
 uint64_t physmem;
 vnode_t *rootdir = (vnode_t *)0xabcd1234;
 char hw_serial[HW_HOSTID_LEN];
index cd6af4e0de8f21b8d6863aa3ac31126c86a2ea56..7038f7f9f1568a30d1e59f6b686e8601d4958d56 100644 (file)
 #endif
 #define        skip_whitespace(p)      while ((*(p) == ' ') || (*(p) == '\t')) p++
 
+#if defined(__FreeBSD__) && !defined(_KERNEL)
+/*
+ * libnvpair is the lowest commen denominator for ZFS related libraries,
+ * defining aok here makes it usable by all ZFS related libraries
+ */
+int aok;
+#endif
+
 /*
  * nvpair.c - Provides kernel & userland interfaces for manipulating
  *     name-value pairs.