From 0d55a0957fb0eb8df431f202b066b16698b78a07 Mon Sep 17 00:00:00 2001 From: Nick Black Date: Thu, 26 Dec 2019 13:52:14 -0500 Subject: [PATCH] libspl: declare aok extern in header Rather than defining a new instance of 'aok' in every compilation unit which includes this header, there is a single instance defined in zone.c, and the header now only declares an extern. Reviewed-by: Brian Behlendorf Reviewed-by: Paul Zuchowski Signed-off-by: Nick Black Closes #9752 --- lib/libspl/include/assert.h | 2 +- lib/libspl/zone.c | 2 ++ tests/zfs-tests/tests/functional/checksum/edonr_test.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h index b7b406850..820519c00 100644 --- a/lib/libspl/include/assert.h +++ b/lib/libspl/include/assert.h @@ -34,7 +34,7 @@ #include #ifndef _KERNEL -int aok; +extern int aok; #endif static inline int diff --git a/lib/libspl/zone.c b/lib/libspl/zone.c index 5ca93b224..4a0e600ca 100644 --- a/lib/libspl/zone.c +++ b/lib/libspl/zone.c @@ -27,6 +27,8 @@ #include #include +int aok = 0; + zoneid_t getzoneid() { diff --git a/tests/zfs-tests/tests/functional/checksum/edonr_test.c b/tests/zfs-tests/tests/functional/checksum/edonr_test.c index a2a924e5d..596ef2b33 100644 --- a/tests/zfs-tests/tests/functional/checksum/edonr_test.c +++ b/tests/zfs-tests/tests/functional/checksum/edonr_test.c @@ -42,6 +42,8 @@ typedef enum boolean { B_FALSE, B_TRUE } boolean_t; typedef unsigned long long u_longlong_t; +int aok = 0; + /* * Test messages from: * http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf