Module Name: src
Committed By: riastradh
Date: Thu Nov 15 04:55:38 UTC 2018
Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: spa_misc.c
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: spa_impl.h
Log Message:
Be consistent about _KERNEL vs _HARDKERNEL in zfs.
As it happens, on x86 both _HARDKERNEL and _KERNEL get defined; see
the conditional in sys/rump/Makefile.rump that _refrains_ from
defining _RUMPKERNEL on x86.
So the only version of this code that has been tested is the one with
all of it included. But on, e.g., aarch64, we do not get _HARDKERNEL
here, and the code fails to build because some things use the field
struct spa::spa_deadman_cycid under _KERNEL when it is declared only
under _HARDKERNEL.
If there's a reason _not_ to use this in rump -- and it's not obvious
to me why -- then all access to the field needs to agree to use
_HARDKERNEL.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c:1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c:1.4
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c:1.3 Mon May 28 21:05:07 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c Thu Nov 15 04:55:38 2018
@@ -391,7 +391,7 @@ zfs_deadman_init(void)
#endif /* __FreeBSD__ */
#ifdef __NetBSD__
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
static struct workqueue *spa_workqueue;
static void spa_deadman(void *arg);
@@ -420,10 +420,10 @@ zfs_deadman_fini(void)
workqueue_destroy(spa_workqueue);
spa_workqueue = NULL;
}
-#else /* !_HARDKERNEL */
+#else /* !_KERNEL */
#define zfs_deadman_init() /* nothing */
#define zfs_deadman_fini() /* nothing */
-#endif /* !_HARDKERNEL */
+#endif /* !_KERNEL */
#endif /* __NetBSD__ */
/*
@@ -664,7 +664,7 @@ spa_deadman(void *arg)
#endif
}
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
static void
spa_deadman_timeout(void *arg)
{
@@ -771,7 +771,7 @@ spa_add(const char *name, nvlist_t *conf
#endif
#endif
#ifdef __NetBSD__
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
callout_init(&spa->spa_deadman_cycid, 0);
callout_setfunc(&spa->spa_deadman_cycid, spa_deadman_timeout, spa);
#endif
@@ -892,7 +892,7 @@ spa_remove(spa_t *spa)
#endif
#endif
#ifdef __NetBSD__
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
callout_drain(&spa->spa_deadman_cycid);
#endif
#endif
Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h:1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h:1.3
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h:1.2 Mon May 28 21:05:07 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h Thu Nov 15 04:55:38 2018
@@ -44,7 +44,7 @@
#include <sys/zfeature.h>
#include <zfeature_common.h>
-#if defined(__NetBSD__) && defined(_HARDKERNEL)
+#if defined(__NetBSD__) && defined(_KERNEL)
#include <sys/workqueue.h>
#endif
@@ -276,7 +276,7 @@ struct spa {
#endif
#endif /* __FreeBSD__ */
#ifdef __NetBSD__
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
struct callout spa_deadman_cycid; /* callout id */
struct work spa_deadman_work;
#endif