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:
Zach Brown
2016-07-05 14:20:19 -07:00
parent 59b1f62df8
commit ae748f0ebc
+3 -2
View File
@@ -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)