btrfs-progs: Fix warning_trace compile error if backtrace is disabled
If we disable backtrace, btrfs-progs can't be compiled since we don't have warning_trace defined. Fix by move it out of #ifndef BTRFS_DISABLE_BACKTRACE block. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ move warning_trace to the right place ] Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
01ddfdbbcb
commit
bb5bcb8a4a
11
kerncompat.h
11
kerncompat.h
|
@ -99,6 +99,11 @@ static inline void assert_trace(const char *assertion, const char *filename,
|
|||
exit(1);
|
||||
}
|
||||
|
||||
#define BUG() assert_trace(NULL, __FILE__, __func__, __LINE__, 0)
|
||||
#else
|
||||
#define BUG() assert(0)
|
||||
#endif
|
||||
|
||||
static inline void warning_trace(const char *assertion, const char *filename,
|
||||
const char *func, unsigned line, int val,
|
||||
int trace)
|
||||
|
@ -113,14 +118,12 @@ static inline void warning_trace(const char *assertion, const char *filename,
|
|||
fprintf(stderr,
|
||||
"%s:%d: %s: Warning: assertion failed, value %d.\n",
|
||||
filename, line, func, val);
|
||||
#ifndef BTRFS_DISABLE_BACKTRACE
|
||||
if (trace)
|
||||
print_trace();
|
||||
#endif
|
||||
}
|
||||
|
||||
#define BUG() assert_trace(NULL, __FILE__, __func__, __LINE__, 0)
|
||||
#else
|
||||
#define BUG() assert(0)
|
||||
#endif
|
||||
|
||||
#ifdef __CHECKER__
|
||||
#define __force __attribute__((force))
|
||||
|
|
Loading…
Reference in New Issue