aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/rnbd/rnbd-log.h
blob: 136e7d6c345189a1a0382843934e47209faf5eae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * RDMA Network Block Driver
 *
 * Copyright (c) 2014 - 2018 ProfitBricks GmbH. All rights reserved.
 * Copyright (c) 2018 - 2019 1&1 IONOS Cloud GmbH. All rights reserved.
 * Copyright (c) 2019 - 2020 1&1 IONOS SE. All rights reserved.
 */
#ifndef RNBD_LOG_H
#define RNBD_LOG_H

#include "rnbd-clt.h"
#include "rnbd-srv.h"

#define rnbd_clt_log(fn, dev, fmt, ...) (				\
		fn("<%s@%s> " fmt, (dev)->pathname,			\
		(dev)->sess->sessname,					\
		   ##__VA_ARGS__))
#define rnbd_srv_log(fn, dev, fmt, ...) (				\
			fn("<%s@%s>: " fmt, (dev)->pathname,		\
			   (dev)->sess->sessname, ##__VA_ARGS__))

#define rnbd_clt_err(dev, fmt, ...)	\
	rnbd_clt_log(pr_err, dev, fmt, ##__VA_ARGS__)
#define rnbd_clt_err_rl(dev, fmt, ...)	\
	rnbd_clt_log(pr_err_ratelimited, dev, fmt, ##__VA_ARGS__)
#define rnbd_clt_info(dev, fmt, ...) \
	rnbd_clt_log(pr_info, dev, fmt, ##__VA_ARGS__)
#define rnbd_clt_info_rl(dev, fmt, ...) \
	rnbd_clt_log(pr_info_ratelimited, dev, fmt, ##__VA_ARGS__)

#define rnbd_srv_err(dev, fmt, ...)	\
	rnbd_srv_log(pr_err, dev, fmt, ##__VA_ARGS__)
#define rnbd_srv_err_rl(dev, fmt, ...)	\
	rnbd_srv_log(pr_err_ratelimited, dev, fmt, ##__VA_ARGS__)
#define rnbd_srv_info(dev, fmt, ...) \
	rnbd_srv_log(pr_info, dev, fmt, ##__VA_ARGS__)
#define rnbd_srv_info_rl(dev, fmt, ...) \
	rnbd_srv_log(pr_info_ratelimited, dev, fmt, ##__VA_ARGS__)

#endif /* RNBD_LOG_H */