Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Be consistent abo...



details:   https://anonhg.NetBSD.org/src/rev/e8222b7c2c0e
branches:  trunk
changeset: 994599:e8222b7c2c0e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Nov 15 04:55:38 2018 +0000

description:
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.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c     |  12 ++++++------
 external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h |   4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (73 lines):

diff -r 4fb05338b111 -r e8222b7c2c0e external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c     Thu Nov 15 04:55:26 2018 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c     Thu Nov 15 04:55:38 2018 +0000
@@ -391,7 +391,7 @@
 #endif /* __FreeBSD__ */
 
 #ifdef __NetBSD__
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
 static struct workqueue *spa_workqueue;
 
 static void spa_deadman(void *arg);
@@ -420,10 +420,10 @@
        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 @@
 #endif
 }
 
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
 static void
 spa_deadman_timeout(void *arg)
 {
@@ -771,7 +771,7 @@
 #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 @@
 #endif
 #endif
 #ifdef __NetBSD__
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
        callout_drain(&spa->spa_deadman_cycid);
 #endif
 #endif
diff -r 4fb05338b111 -r e8222b7c2c0e external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h Thu Nov 15 04:55:26 2018 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h Thu Nov 15 04:55:38 2018 +0000
@@ -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 @@
 #endif
 #endif /* __FreeBSD__ */
 #ifdef __NetBSD__
-#ifdef _HARDKERNEL
+#ifdef _KERNEL
        struct callout  spa_deadman_cycid;      /* callout id */
        struct work     spa_deadman_work;
 #endif



Home | Main Index | Thread Index | Old Index