Skip to content

Commit

Permalink
libspl: declare aok extern in header
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Reviewed-by: Paul Zuchowski <pzuchowski@datto.com>
Signed-off-by: Nick Black <dankamongmen@gmail.com>
Closes openzfs#9752
  • Loading branch information
dankamongmen authored and tonyhutter committed Jan 2, 2020
1 parent ba8e51f commit 085d2d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libspl/include/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <stdarg.h>

#ifndef _KERNEL
int aok;
extern int aok;
#endif

static inline int
Expand Down
2 changes: 2 additions & 0 deletions lib/libspl/zone.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <string.h>
#include <errno.h>

int aok = 0;

zoneid_t
getzoneid()
{
Expand Down
2 changes: 2 additions & 0 deletions tests/zfs-tests/tests/functional/checksum/edonr_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 085d2d0

Please sign in to comment.