libspl: staticify buf and pagesize, rename aok to libspl_assert_ok

Exporting names this short can easily cause nasty collisions with user code.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12050
This commit is contained in:
наб 2021-06-03 19:04:13 +02:00 committed by GitHub
parent f97142c748
commit 94f942c658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 8778 additions and 5537 deletions

View File

@ -8496,7 +8496,7 @@ main(int argc, char **argv)
dump_opt[c] += verbose;
}
aok = (dump_opt['A'] == 1) || (dump_opt['A'] > 2);
libspl_assert_ok = (dump_opt['A'] == 1) || (dump_opt['A'] > 2);
zfs_recover = (dump_opt['A'] > 1);
argc -= optind;

View File

@ -160,8 +160,6 @@ extern void vpanic(const char *, va_list) __NORETURN;
#define fm_panic panic
extern int aok;
/*
* DTrace SDT probes have different signatures in userland than they do in
* the kernel. If they're being used in kernel code, re-define them out of

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@
#include <assert.h>
int aok = 0;
int libspl_assert_ok = 0;
/* printf version of libspl_assert */
void
@ -39,7 +39,7 @@ libspl_assertf(const char *file, const char *func, int line,
fprintf(stderr, "\n");
fprintf(stderr, "ASSERT at %s:%d:%s()", file, line, func);
va_end(args);
if (aok) {
if (libspl_assert_ok) {
return;
}
abort();

View File

@ -34,7 +34,7 @@
#include <stdarg.h>
/* Set to non-zero to avoid abort()ing on an assertion failure */
extern int aok;
extern int libspl_assert_ok;
/* printf version of libspl_assert */
extern void libspl_assertf(const char *file, const char *func, int line,

View File

@ -41,7 +41,7 @@
#define BUFSIZE (MNT_LINE_MAX + 2)
__thread char buf[BUFSIZE];
static __thread char buf[BUFSIZE];
#define DIFF(xx) ( \
(mrefp->xx != NULL) && \

View File

@ -22,7 +22,7 @@
#include <unistd.h>
size_t pagesize = 0;
static size_t pagesize = 0;
size_t
spl_pagesize(void)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff