Commit f88c5d90 authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

drbd: cosmetic: change all printk(level, ...) to pr_<level>(...)

Cosmetic change only.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 2f2abeae
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -353,9 +355,8 @@ static void bm_free_pages(struct page **pages, unsigned long number) ...@@ -353,9 +355,8 @@ static void bm_free_pages(struct page **pages, unsigned long number)
for (i = 0; i < number; i++) { for (i = 0; i < number; i++) {
if (!pages[i]) { if (!pages[i]) {
printk(KERN_ALERT "drbd: bm_free_pages tried to free " pr_alert("bm_free_pages tried to free a NULL pointer; i=%lu n=%lu\n",
"a NULL pointer; i=%lu n=%lu\n", i, number);
i, number);
continue; continue;
} }
__free_page(pages[i]); __free_page(pages[i]);
...@@ -592,7 +593,7 @@ static void bm_memset(struct drbd_bitmap *b, size_t offset, int c, size_t len) ...@@ -592,7 +593,7 @@ static void bm_memset(struct drbd_bitmap *b, size_t offset, int c, size_t len)
end = offset + len; end = offset + len;
if (end > b->bm_words) { if (end > b->bm_words) {
printk(KERN_ALERT "drbd: bm_memset end > bm_words\n"); pr_alert("bm_memset end > bm_words\n");
return; return;
} }
...@@ -602,7 +603,7 @@ static void bm_memset(struct drbd_bitmap *b, size_t offset, int c, size_t len) ...@@ -602,7 +603,7 @@ static void bm_memset(struct drbd_bitmap *b, size_t offset, int c, size_t len)
p_addr = bm_map_pidx(b, idx); p_addr = bm_map_pidx(b, idx);
bm = p_addr + MLPP(offset); bm = p_addr + MLPP(offset);
if (bm+do_now > p_addr + LWPP) { if (bm+do_now > p_addr + LWPP) {
printk(KERN_ALERT "drbd: BUG BUG BUG! p_addr:%p bm:%p do_now:%d\n", pr_alert("BUG BUG BUG! p_addr:%p bm:%p do_now:%d\n",
p_addr, bm, (int)do_now); p_addr, bm, (int)do_now);
} else } else
memset(bm, c, do_now * sizeof(long)); memset(bm, c, do_now * sizeof(long));
......
...@@ -1467,9 +1467,7 @@ static inline void drbd_generic_make_request(struct drbd_device *device, ...@@ -1467,9 +1467,7 @@ static inline void drbd_generic_make_request(struct drbd_device *device,
{ {
__release(local); __release(local);
if (!bio->bi_bdev) { if (!bio->bi_bdev) {
printk(KERN_ERR "drbd%d: drbd_generic_make_request: " drbd_err(device, "drbd_generic_make_request: bio->bi_bdev == NULL\n");
"bio->bi_bdev == NULL\n",
device_to_minor(device));
bio_endio(bio, -ENODEV); bio_endio(bio, -ENODEV);
return; return;
} }
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/drbd.h> #include <linux/drbd.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -2333,7 +2335,7 @@ static void drbd_cleanup(void) ...@@ -2333,7 +2335,7 @@ static void drbd_cleanup(void)
idr_destroy(&drbd_devices); idr_destroy(&drbd_devices);
printk(KERN_INFO "drbd: module cleanup done.\n"); pr_info("module cleanup done.\n");
} }
/** /**
...@@ -2869,8 +2871,7 @@ static int __init drbd_init(void) ...@@ -2869,8 +2871,7 @@ static int __init drbd_init(void)
int err; int err;
if (minor_count < DRBD_MINOR_COUNT_MIN || minor_count > DRBD_MINOR_COUNT_MAX) { if (minor_count < DRBD_MINOR_COUNT_MIN || minor_count > DRBD_MINOR_COUNT_MAX) {
printk(KERN_ERR pr_err("invalid minor_count (%d)\n", minor_count);
"drbd: invalid minor_count (%d)\n", minor_count);
#ifdef MODULE #ifdef MODULE
return -EINVAL; return -EINVAL;
#else #else
...@@ -2880,8 +2881,7 @@ static int __init drbd_init(void) ...@@ -2880,8 +2881,7 @@ static int __init drbd_init(void)
err = register_blkdev(DRBD_MAJOR, "drbd"); err = register_blkdev(DRBD_MAJOR, "drbd");
if (err) { if (err) {
printk(KERN_ERR pr_err("unable to register block device major %d\n",
"drbd: unable to register block device major %d\n",
DRBD_MAJOR); DRBD_MAJOR);
return err; return err;
} }
...@@ -2899,7 +2899,7 @@ static int __init drbd_init(void) ...@@ -2899,7 +2899,7 @@ static int __init drbd_init(void)
err = drbd_genl_register(); err = drbd_genl_register();
if (err) { if (err) {
printk(KERN_ERR "drbd: unable to register generic netlink family\n"); pr_err("unable to register generic netlink family\n");
goto fail; goto fail;
} }
...@@ -2910,34 +2910,32 @@ static int __init drbd_init(void) ...@@ -2910,34 +2910,32 @@ static int __init drbd_init(void)
err = -ENOMEM; err = -ENOMEM;
drbd_proc = proc_create_data("drbd", S_IFREG | S_IRUGO , NULL, &drbd_proc_fops, NULL); drbd_proc = proc_create_data("drbd", S_IFREG | S_IRUGO , NULL, &drbd_proc_fops, NULL);
if (!drbd_proc) { if (!drbd_proc) {
printk(KERN_ERR "drbd: unable to register proc file\n"); pr_err("unable to register proc file\n");
goto fail; goto fail;
} }
retry.wq = create_singlethread_workqueue("drbd-reissue"); retry.wq = create_singlethread_workqueue("drbd-reissue");
if (!retry.wq) { if (!retry.wq) {
printk(KERN_ERR "drbd: unable to create retry workqueue\n"); pr_err("unable to create retry workqueue\n");
goto fail; goto fail;
} }
INIT_WORK(&retry.worker, do_retry); INIT_WORK(&retry.worker, do_retry);
spin_lock_init(&retry.lock); spin_lock_init(&retry.lock);
INIT_LIST_HEAD(&retry.writes); INIT_LIST_HEAD(&retry.writes);
printk(KERN_INFO "drbd: initialized. " pr_info("initialized. "
"Version: " REL_VERSION " (api:%d/proto:%d-%d)\n", "Version: " REL_VERSION " (api:%d/proto:%d-%d)\n",
API_VERSION, PRO_VERSION_MIN, PRO_VERSION_MAX); API_VERSION, PRO_VERSION_MIN, PRO_VERSION_MAX);
printk(KERN_INFO "drbd: %s\n", drbd_buildtag()); pr_info("%s\n", drbd_buildtag());
printk(KERN_INFO "drbd: registered as block device major %d\n", pr_info("registered as block device major %d\n", DRBD_MAJOR);
DRBD_MAJOR);
return 0; /* Success! */ return 0; /* Success! */
fail: fail:
drbd_cleanup(); drbd_cleanup();
if (err == -ENOMEM) if (err == -ENOMEM)
printk(KERN_ERR "drbd: ran out of memory\n"); pr_err("ran out of memory\n");
else else
printk(KERN_ERR "drbd: initialization failure\n"); pr_err("initialization failure\n");
return err; return err;
} }
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/drbd.h> #include <linux/drbd.h>
#include <linux/in.h> #include <linux/in.h>
...@@ -85,7 +87,7 @@ static void drbd_adm_send_reply(struct sk_buff *skb, struct genl_info *info) ...@@ -85,7 +87,7 @@ static void drbd_adm_send_reply(struct sk_buff *skb, struct genl_info *info)
{ {
genlmsg_end(skb, genlmsg_data(nlmsg_data(nlmsg_hdr(skb)))); genlmsg_end(skb, genlmsg_data(nlmsg_data(nlmsg_hdr(skb))));
if (genlmsg_reply(skb, info)) if (genlmsg_reply(skb, info))
printk(KERN_ERR "drbd: error sending genl reply\n"); pr_err("error sending genl reply\n");
} }
/* Used on a fresh "drbd_adm_prepare"d reply_skb, this cannot fail: The only /* Used on a fresh "drbd_adm_prepare"d reply_skb, this cannot fail: The only
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment