mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-09 04:00:10 +00:00
scoutfs: add _sk console message wrappers
Add some _sk suffix variants of the message printing calls so that we can use per-cpu key buffer arguments without the full SK_PCPU() wrapper. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
|
||||
#include "msg.h"
|
||||
|
||||
/*
|
||||
* This can be called with pre-emption disabled if the caller is printing
|
||||
* the contents of formated per-cpu key string buffers.
|
||||
*/
|
||||
void scoutfs_msg(struct super_block *sb, const char *prefix, const char *str,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
#ifndef _SCOUTFS_MSG_H_
|
||||
#define _SCOUTFS_MSG_H_
|
||||
|
||||
#include "key.h"
|
||||
|
||||
void __printf(4, 5) scoutfs_msg(struct super_block *sb, const char *prefix,
|
||||
const char *str, const char *fmt, ...);
|
||||
|
||||
/*
|
||||
* The _sk variants wrap the message in the SK_PCPU calls which safely
|
||||
* manage the use of per-cpu key buffers in the arguments.
|
||||
*/
|
||||
|
||||
#define scoutfs_err(sb, fmt, args...) \
|
||||
scoutfs_msg(sb, KERN_ERR, " error", fmt, ##args)
|
||||
|
||||
#define scoutfs_err_sk(sb, fmt, args...) \
|
||||
SK_PCPU(scoutfs_err(sb, fmt, ##args))
|
||||
|
||||
#define scoutfs_warn(sb, fmt, args...) \
|
||||
scoutfs_msg(sb, KERN_WARNING, " warning", fmt, ##args)
|
||||
|
||||
#define scoutfs_warn_sk(sb, fmt, args...) \
|
||||
SK_PCPU(scoutfs_warn(sb, fmt, ##args))
|
||||
|
||||
#define scoutfs_info(sb, fmt, args...) \
|
||||
scoutfs_msg(sb, KERN_INFO, "", fmt, ##args)
|
||||
|
||||
#define scoutfs_info_sk(sb, fmt, args...) \
|
||||
SK_PCPU(scoutfs_info(sb, fmt, ##args))
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user