提交 60ae4966 编写于 作者: P Philipp Reisner

drbd: conn_printk() a dev_printk() alike for drbd's connections

Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 b53339fc
...@@ -102,6 +102,16 @@ struct drbd_tconn; ...@@ -102,6 +102,16 @@ struct drbd_tconn;
/* to shorten dev_warn(DEV, "msg"); and relatives statements */ /* to shorten dev_warn(DEV, "msg"); and relatives statements */
#define DEV (disk_to_dev(mdev->vdisk)) #define DEV (disk_to_dev(mdev->vdisk))
#define conn_printk(LEVEL, TCONN, FMT, ARGS...) \
printk(LEVEL "d-con %s: " FMT, TCONN->name , ## ARGS)
#define conn_alert(TCONN, FMT, ARGS...) conn_printk(KERN_ALERT, TCONN, FMT, ## ARGS)
#define conn_crit(TCONN, FMT, ARGS...) conn_printk(KERN_CRIT, TCONN, FMT, ## ARGS)
#define conn_err(TCONN, FMT, ARGS...) conn_printk(KERN_ERR, TCONN, FMT, ## ARGS)
#define conn_warn(TCONN, FMT, ARGS...) conn_printk(KERN_WARNING, TCONN, FMT, ## ARGS)
#define conn_notice(TCONN, FMT, ARGS...) conn_printk(KERN_NOTICE, TCONN, FMT, ## ARGS)
#define conn_info(TCONN, FMT, ARGS...) conn_printk(KERN_INFO, TCONN, FMT, ## ARGS)
#define conn_dbg(TCONN, FMT, ARGS...) conn_printk(KERN_DEBUG, TCONN, FMT, ## ARGS)
#define D_ASSERT(exp) if (!(exp)) \ #define D_ASSERT(exp) if (!(exp)) \
dev_err(DEV, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__) dev_err(DEV, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__)
......
...@@ -2217,12 +2217,14 @@ struct drbd_conf *drbd_new_device(unsigned int minor) ...@@ -2217,12 +2217,14 @@ struct drbd_conf *drbd_new_device(unsigned int minor)
struct drbd_conf *mdev; struct drbd_conf *mdev;
struct gendisk *disk; struct gendisk *disk;
struct request_queue *q; struct request_queue *q;
char conn_name[9]; /* drbd1234N */
/* GFP_KERNEL, we are outside of all write-out paths */ /* GFP_KERNEL, we are outside of all write-out paths */
mdev = kzalloc(sizeof(struct drbd_conf), GFP_KERNEL); mdev = kzalloc(sizeof(struct drbd_conf), GFP_KERNEL);
if (!mdev) if (!mdev)
return NULL; return NULL;
mdev->tconn = drbd_new_tconn("dummy"); sprintf(conn_name, "drbd%d", minor);
mdev->tconn = drbd_new_tconn(conn_name);
if (!mdev->tconn) if (!mdev->tconn)
goto out_no_tconn; goto out_no_tconn;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册