mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-27 10:33:08 +00:00
scoutfs: allow tracing with a null sb
The sb counter field isn't necessary, allow a null sb pointer arg which then results in a counter output of 0. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
+3
-2
@@ -97,7 +97,8 @@ static inline void only_check_format(const char *fmt, ...)
|
||||
*/
|
||||
#define scoutfs_trace(sb, fmt, ...) \
|
||||
do { \
|
||||
struct scoutfs_sb_info *__sbi = SCOUTFS_SB(sb); \
|
||||
struct super_block *__sb = (sb); \
|
||||
u64 __sbi_ctr = __sb ? SCOUTFS_SB(__sb)->ctr : 0; \
|
||||
static char __scoutfs_trace_section __fmt[] = \
|
||||
"[%llu.%llu] %llu %llu %llu " __stringify(__LINE__) ": "\
|
||||
fmt; \
|
||||
@@ -111,7 +112,7 @@ do { \
|
||||
do_gettimeofday(&__tv); \
|
||||
\
|
||||
__trace_write(__fmt, CAST_ARGS_U64(__tv.tv_sec, __tv.tv_usec, \
|
||||
__sbi->ctr, current->pid, get_cpu(), \
|
||||
__sbi_ctr, current->pid, get_cpu(), \
|
||||
__VA_ARGS__)); \
|
||||
put_cpu(); \
|
||||
} while (0)
|
||||
|
||||
Reference in New Issue
Block a user