libspl: move cmn_err definitions from zfs_context.h

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #17861
This commit is contained in:
Rob Norris 2025-08-09 10:44:05 +10:00 committed by Brian Behlendorf
parent e7a856d954
commit 7234d69748
2 changed files with 28 additions and 31 deletions

View File

@ -122,6 +122,7 @@ extern "C" {
#include <sys/mutex.h>
#include <sys/rwlock.h>
#include <sys/condvar.h>
#include <sys/cmn_err.h>
#include <sys/zfs_delay.h>
#include <sys/zfs_context_os.h>
@ -134,37 +135,6 @@ extern "C" {
#define likely(x) __builtin_expect((x), 1)
#define unlikely(x) __builtin_expect((x), 0)
/*
* Debugging
*/
/*
* Note that we are not using the debugging levels.
*/
#define CE_CONT 0 /* continuation */
#define CE_NOTE 1 /* notice */
#define CE_WARN 2 /* warning */
#define CE_PANIC 3 /* panic */
#define CE_IGNORE 4 /* print nothing */
/*
* ZFS debugging
*/
extern void dprintf_setup(int *argc, char **argv);
extern void cmn_err(int, const char *, ...)
__attribute__((format(printf, 2, 3)));
extern void vcmn_err(int, const char *, va_list)
__attribute__((format(printf, 2, 0)));
extern void panic(const char *, ...)
__attribute__((format(printf, 1, 2), noreturn));
extern void vpanic(const char *, va_list)
__attribute__((format(printf, 1, 0), noreturn));
#define fm_panic panic
/*
* 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

View File

@ -62,4 +62,31 @@ do { \
} \
} while (0)
/*
* Note that we are not using the debugging levels.
*/
#define CE_CONT 0 /* continuation */
#define CE_NOTE 1 /* notice */
#define CE_WARN 2 /* warning */
#define CE_PANIC 3 /* panic */
#define CE_IGNORE 4 /* print nothing */
/*
* ZFS debugging
*/
extern void dprintf_setup(int *argc, char **argv);
extern void cmn_err(int, const char *, ...)
__attribute__((format(printf, 2, 3)));
extern void vcmn_err(int, const char *, va_list)
__attribute__((format(printf, 2, 0)));
extern void panic(const char *, ...)
__attribute__((format(printf, 1, 2), noreturn));
extern void vpanic(const char *, va_list)
__attribute__((format(printf, 1, 0), noreturn));
#define fm_panic panic
#endif