Commit a12c93f0 authored by Ed L. Cashin's avatar Ed L. Cashin Committed by Greg Kroah-Hartman

aoe: revert printk macros

This patch addresses the concern that the aoe driver should
not introduce unecessary conventions that must be learned by
the reader.  It reverts patch 6.
Signed-off-by: default avatar"Ed L. Cashin" <ecashin@coraid.com>
Acked-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 086216db
...@@ -10,11 +10,6 @@ ...@@ -10,11 +10,6 @@
#define AOE_PARTITIONS (16) #define AOE_PARTITIONS (16)
#endif #endif
#define xprintk(L, fmt, arg...) printk(L "aoe: " "%s: " fmt, __func__, ## arg)
#define iprintk(fmt, arg...) xprintk(KERN_INFO, fmt, ## arg)
#define eprintk(fmt, arg...) xprintk(KERN_ERR, fmt, ## arg)
#define dprintk(fmt, arg...) xprintk(KERN_DEBUG, fmt, ## arg)
#define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * NPERSHELF + (aoeminor)) #define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * NPERSHELF + (aoeminor))
#define AOEMAJOR(sysminor) ((sysminor) / NPERSHELF) #define AOEMAJOR(sysminor) ((sysminor) / NPERSHELF)
#define AOEMINOR(sysminor) ((sysminor) % NPERSHELF) #define AOEMINOR(sysminor) ((sysminor) % NPERSHELF)
......
...@@ -131,7 +131,7 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio) ...@@ -131,7 +131,7 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
d = bio->bi_bdev->bd_disk->private_data; d = bio->bi_bdev->bd_disk->private_data;
buf = mempool_alloc(d->bufpool, GFP_NOIO); buf = mempool_alloc(d->bufpool, GFP_NOIO);
if (buf == NULL) { if (buf == NULL) {
iprintk("buf allocation failure\n"); printk(KERN_INFO "aoe: buf allocation failure\n");
bio_endio(bio, bio->bi_size, -ENOMEM); bio_endio(bio, bio->bi_size, -ENOMEM);
return 0; return 0;
} }
...@@ -149,7 +149,8 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio) ...@@ -149,7 +149,8 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
spin_lock_irqsave(&d->lock, flags); spin_lock_irqsave(&d->lock, flags);
if ((d->flags & DEVFL_UP) == 0) { if ((d->flags & DEVFL_UP) == 0) {
iprintk("device %ld.%ld is not up\n", d->aoemajor, d->aoeminor); printk(KERN_INFO "aoe: device %ld.%ld is not up\n",
d->aoemajor, d->aoeminor);
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
mempool_free(buf, d->bufpool); mempool_free(buf, d->bufpool);
bio_endio(bio, bio->bi_size, -ENXIO); bio_endio(bio, bio->bi_size, -ENXIO);
...@@ -174,7 +175,7 @@ aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo) ...@@ -174,7 +175,7 @@ aoeblk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
struct aoedev *d = bdev->bd_disk->private_data; struct aoedev *d = bdev->bd_disk->private_data;
if ((d->flags & DEVFL_UP) == 0) { if ((d->flags & DEVFL_UP) == 0) {
eprintk("disk not up\n"); printk(KERN_ERR "aoe: disk not up\n");
return -ENODEV; return -ENODEV;
} }
...@@ -201,7 +202,7 @@ aoeblk_gdalloc(void *vp) ...@@ -201,7 +202,7 @@ aoeblk_gdalloc(void *vp)
gd = alloc_disk(AOE_PARTITIONS); gd = alloc_disk(AOE_PARTITIONS);
if (gd == NULL) { if (gd == NULL) {
eprintk("cannot allocate disk structure for %ld.%ld\n", printk(KERN_ERR "aoe: cannot allocate disk structure for %ld.%ld\n",
d->aoemajor, d->aoeminor); d->aoemajor, d->aoeminor);
spin_lock_irqsave(&d->lock, flags); spin_lock_irqsave(&d->lock, flags);
d->flags &= ~DEVFL_GDALLOC; d->flags &= ~DEVFL_GDALLOC;
...@@ -211,7 +212,7 @@ aoeblk_gdalloc(void *vp) ...@@ -211,7 +212,7 @@ aoeblk_gdalloc(void *vp)
d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache); d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache);
if (d->bufpool == NULL) { if (d->bufpool == NULL) {
eprintk("cannot allocate bufpool for %ld.%ld\n", printk(KERN_ERR "aoe: cannot allocate bufpool for %ld.%ld\n",
d->aoemajor, d->aoeminor); d->aoemajor, d->aoeminor);
put_disk(gd); put_disk(gd);
spin_lock_irqsave(&d->lock, flags); spin_lock_irqsave(&d->lock, flags);
......
...@@ -55,7 +55,8 @@ static int ...@@ -55,7 +55,8 @@ static int
interfaces(const char __user *str, size_t size) interfaces(const char __user *str, size_t size)
{ {
if (set_aoe_iflist(str, size)) { if (set_aoe_iflist(str, size)) {
eprintk("could not set interface list: too many interfaces\n"); printk(KERN_ERR
"aoe: could not set interface list: too many interfaces\n");
return -EINVAL; return -EINVAL;
} }
return 0; return 0;
...@@ -78,7 +79,7 @@ revalidate(const char __user *str, size_t size) ...@@ -78,7 +79,7 @@ revalidate(const char __user *str, size_t size)
/* should be e%d.%d format */ /* should be e%d.%d format */
n = sscanf(buf, "e%d.%d", &major, &minor); n = sscanf(buf, "e%d.%d", &major, &minor);
if (n != 2) { if (n != 2) {
eprintk("invalid device specification\n"); printk(KERN_ERR "aoe: invalid device specification\n");
return -EINVAL; return -EINVAL;
} }
d = aoedev_by_aoeaddr(major, minor); d = aoedev_by_aoeaddr(major, minor);
...@@ -113,7 +114,7 @@ bail: spin_unlock_irqrestore(&emsgs_lock, flags); ...@@ -113,7 +114,7 @@ bail: spin_unlock_irqrestore(&emsgs_lock, flags);
mp = kmalloc(n, GFP_ATOMIC); mp = kmalloc(n, GFP_ATOMIC);
if (mp == NULL) { if (mp == NULL) {
eprintk("allocation failure, len=%ld\n", n); printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
goto bail; goto bail;
} }
...@@ -138,7 +139,7 @@ aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp ...@@ -138,7 +139,7 @@ aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp
switch ((unsigned long) filp->private_data) { switch ((unsigned long) filp->private_data) {
default: default:
iprintk("can't write to that file.\n"); printk(KERN_INFO "aoe: can't write to that file.\n");
break; break;
case MINOR_DISCOVER: case MINOR_DISCOVER:
ret = discover(); ret = discover();
...@@ -247,7 +248,7 @@ aoechr_init(void) ...@@ -247,7 +248,7 @@ aoechr_init(void)
n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops); n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops);
if (n < 0) { if (n < 0) {
eprintk("can't register char device\n"); printk(KERN_ERR "aoe: can't register char device\n");
return n; return n;
} }
sema_init(&emsgs_sema, 0); sema_init(&emsgs_sema, 0);
......
...@@ -159,7 +159,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f) ...@@ -159,7 +159,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
buf->nframesout += 1; buf->nframesout += 1;
buf->bufaddr += bcnt; buf->bufaddr += bcnt;
buf->bv_resid -= bcnt; buf->bv_resid -= bcnt;
/* dprintk("bv_resid=%ld\n", buf->bv_resid); */ /* printk(KERN_DEBUG "aoe: bv_resid=%ld\n", buf->bv_resid); */
buf->resid -= bcnt; buf->resid -= bcnt;
buf->sector += bcnt >> 9; buf->sector += bcnt >> 9;
if (buf->resid == 0) { if (buf->resid == 0) {
...@@ -203,7 +203,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail) ...@@ -203,7 +203,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
skb = new_skb(sizeof *h + sizeof *ch); skb = new_skb(sizeof *h + sizeof *ch);
if (skb == NULL) { if (skb == NULL) {
iprintk("skb alloc failure\n"); printk(KERN_INFO "aoe: skb alloc failure\n");
continue; continue;
} }
skb->dev = ifp; skb->dev = ifp;
...@@ -276,7 +276,7 @@ aoecmd_work(struct aoedev *d) ...@@ -276,7 +276,7 @@ aoecmd_work(struct aoedev *d)
return; return;
buf = container_of(d->bufq.next, struct buf, bufs); buf = container_of(d->bufq.next, struct buf, bufs);
list_del(d->bufq.next); list_del(d->bufq.next);
/*dprintk("bi_size=%ld\n", buf->bio->bi_size); */ /*printk(KERN_DEBUG "aoe: bi_size=%ld\n", buf->bio->bi_size); */
d->inprocess = buf; d->inprocess = buf;
} }
aoecmd_ata_rw(d, f); aoecmd_ata_rw(d, f);
...@@ -319,7 +319,7 @@ rexmit(struct aoedev *d, struct frame *f) ...@@ -319,7 +319,7 @@ rexmit(struct aoedev *d, struct frame *f)
} }
if (++d->lostjumbo > (d->nframes << 1)) if (++d->lostjumbo > (d->nframes << 1))
if (d->maxbcnt != DEFAULTBCNT) { if (d->maxbcnt != DEFAULTBCNT) {
iprintk("e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n", printk(KERN_INFO "aoe: e%ld.%ld: too many lost jumbo on %s - using 1KB frames.\n",
d->aoemajor, d->aoeminor, d->ifp->name); d->aoemajor, d->aoeminor, d->ifp->name);
d->maxbcnt = DEFAULTBCNT; d->maxbcnt = DEFAULTBCNT;
d->flags |= DEVFL_MAXBCNT; d->flags |= DEVFL_MAXBCNT;
...@@ -472,7 +472,7 @@ ataid_complete(struct aoedev *d, unsigned char *id) ...@@ -472,7 +472,7 @@ ataid_complete(struct aoedev *d, unsigned char *id)
} }
if (d->ssize != ssize) if (d->ssize != ssize)
iprintk("%012llx e%lu.%lu v%04x has %llu sectors\n", printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu sectors\n",
(unsigned long long)mac_addr(d->addr), (unsigned long long)mac_addr(d->addr),
d->aoemajor, d->aoeminor, d->aoemajor, d->aoeminor,
d->fw_ver, (long long)ssize); d->fw_ver, (long long)ssize);
...@@ -483,7 +483,7 @@ ataid_complete(struct aoedev *d, unsigned char *id) ...@@ -483,7 +483,7 @@ ataid_complete(struct aoedev *d, unsigned char *id)
d->flags |= DEVFL_NEWSIZE; d->flags |= DEVFL_NEWSIZE;
} else { } else {
if (d->flags & DEVFL_GDALLOC) { if (d->flags & DEVFL_GDALLOC) {
eprintk("can't schedule work for e%lu.%lu, %s\n", printk(KERN_ERR "aoe: can't schedule work for e%lu.%lu, %s\n",
d->aoemajor, d->aoeminor, d->aoemajor, d->aoeminor,
"it's already on! This shouldn't happen.\n"); "it's already on! This shouldn't happen.\n");
return; return;
...@@ -569,7 +569,8 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -569,7 +569,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
if (ahout->cmdstat == WIN_IDENTIFY) if (ahout->cmdstat == WIN_IDENTIFY)
d->flags &= ~DEVFL_PAUSE; d->flags &= ~DEVFL_PAUSE;
if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */ if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */
eprintk("ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n", printk(KERN_ERR
"aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%ld\n",
ahout->cmdstat, ahin->cmdstat, ahout->cmdstat, ahin->cmdstat,
d->aoemajor, d->aoeminor); d->aoemajor, d->aoeminor);
if (buf) if (buf)
...@@ -580,7 +581,8 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -580,7 +581,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
case WIN_READ: case WIN_READ:
case WIN_READ_EXT: case WIN_READ_EXT:
if (skb->len - sizeof *hin - sizeof *ahin < n) { if (skb->len - sizeof *hin - sizeof *ahin < n) {
eprintk("runt data size in read. skb->len=%d\n", printk(KERN_ERR
"aoe: runt data size in read. skb->len=%d\n",
skb->len); skb->len);
/* fail frame f? just returning will rexmit. */ /* fail frame f? just returning will rexmit. */
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
...@@ -618,7 +620,8 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -618,7 +620,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
break; break;
case WIN_IDENTIFY: case WIN_IDENTIFY:
if (skb->len - sizeof *hin - sizeof *ahin < 512) { if (skb->len - sizeof *hin - sizeof *ahin < 512) {
iprintk("runt data size in ataid. skb->len=%d\n", printk(KERN_INFO
"aoe: runt data size in ataid. skb->len=%d\n",
skb->len); skb->len);
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
return; return;
...@@ -626,7 +629,8 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -626,7 +629,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
ataid_complete(d, (char *) (ahin+1)); ataid_complete(d, (char *) (ahin+1));
break; break;
default: default:
iprintk("unrecognized ata command %2.2Xh for %d.%d\n", printk(KERN_INFO
"aoe: unrecognized ata command %2.2Xh for %d.%d\n",
ahout->cmdstat, ahout->cmdstat,
be16_to_cpu(hin->major), be16_to_cpu(hin->major),
hin->minor); hin->minor);
...@@ -686,7 +690,7 @@ aoecmd_ata_id(struct aoedev *d) ...@@ -686,7 +690,7 @@ aoecmd_ata_id(struct aoedev *d)
f = freeframe(d); f = freeframe(d);
if (f == NULL) { if (f == NULL) {
eprintk("can't get a frame. This shouldn't happen.\n"); printk(KERN_ERR "aoe: can't get a frame. This shouldn't happen.\n");
return NULL; return NULL;
} }
...@@ -732,14 +736,14 @@ aoecmd_cfg_rsp(struct sk_buff *skb) ...@@ -732,14 +736,14 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
*/ */
aoemajor = be16_to_cpu(h->major); aoemajor = be16_to_cpu(h->major);
if (aoemajor == 0xfff) { if (aoemajor == 0xfff) {
eprintk("Warning: shelf address is all ones. " printk(KERN_ERR "aoe: Warning: shelf address is all ones. "
"Check shelf dip switches.\n"); "Check shelf dip switches.\n");
return; return;
} }
sysminor = SYSMINOR(aoemajor, h->minor); sysminor = SYSMINOR(aoemajor, h->minor);
if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) { if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
iprintk("e%ld.%d: minor number too large\n", printk(KERN_INFO "aoe: e%ld.%d: minor number too large\n",
aoemajor, (int) h->minor); aoemajor, (int) h->minor);
return; return;
} }
...@@ -750,7 +754,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) ...@@ -750,7 +754,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
d = aoedev_by_sysminor_m(sysminor, n); d = aoedev_by_sysminor_m(sysminor, n);
if (d == NULL) { if (d == NULL) {
iprintk("device sysminor_m failure\n"); printk(KERN_INFO "aoe: device sysminor_m failure\n");
return; return;
} }
...@@ -767,7 +771,8 @@ aoecmd_cfg_rsp(struct sk_buff *skb) ...@@ -767,7 +771,8 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
n = ch->scnt; n = ch->scnt;
n = n ? n * 512 : DEFAULTBCNT; n = n ? n * 512 : DEFAULTBCNT;
if (n != d->maxbcnt) { if (n != d->maxbcnt) {
iprintk("e%ld.%ld: setting %d byte data frames on %s\n", printk(KERN_INFO
"aoe: e%ld.%ld: setting %d byte data frames on %s\n",
d->aoemajor, d->aoeminor, n, d->ifp->name); d->aoemajor, d->aoeminor, n, d->ifp->name);
d->maxbcnt = n; d->maxbcnt = n;
} }
......
...@@ -156,7 +156,7 @@ aoedev_by_sysminor_m(ulong sysminor, ulong bufcnt) ...@@ -156,7 +156,7 @@ aoedev_by_sysminor_m(ulong sysminor, ulong bufcnt)
d = aoedev_newdev(bufcnt); d = aoedev_newdev(bufcnt);
if (d == NULL) { if (d == NULL) {
spin_unlock_irqrestore(&devlist_lock, flags); spin_unlock_irqrestore(&devlist_lock, flags);
iprintk("aoedev_newdev failure.\n"); printk(KERN_INFO "aoe: aoedev_newdev failure.\n");
return NULL; return NULL;
} }
d->sysminor = sysminor; d->sysminor = sysminor;
......
...@@ -84,11 +84,11 @@ aoe_init(void) ...@@ -84,11 +84,11 @@ aoe_init(void)
goto net_fail; goto net_fail;
ret = register_blkdev(AOE_MAJOR, DEVICE_NAME); ret = register_blkdev(AOE_MAJOR, DEVICE_NAME);
if (ret < 0) { if (ret < 0) {
eprintk("can't register major\n"); printk(KERN_ERR "aoe: can't register major\n");
goto blkreg_fail; goto blkreg_fail;
} }
iprintk("AoE v%s initialised.\n", VERSION); printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION);
discover_timer(TINIT); discover_timer(TINIT);
return 0; return 0;
...@@ -101,7 +101,7 @@ aoe_init(void) ...@@ -101,7 +101,7 @@ aoe_init(void)
chr_fail: chr_fail:
aoedev_exit(); aoedev_exit();
iprintk("initialisation failure.\n"); printk(KERN_INFO "aoe: initialisation failure.\n");
return ret; return ret;
} }
......
...@@ -74,7 +74,7 @@ set_aoe_iflist(const char __user *user_str, size_t size) ...@@ -74,7 +74,7 @@ set_aoe_iflist(const char __user *user_str, size_t size)
return -EINVAL; return -EINVAL;
if (copy_from_user(aoe_iflist, user_str, size)) { if (copy_from_user(aoe_iflist, user_str, size)) {
iprintk("copy from user failed\n"); printk(KERN_INFO "aoe: copy from user failed\n");
return -EFAULT; return -EFAULT;
} }
aoe_iflist[size] = 0x00; aoe_iflist[size] = 0x00;
...@@ -132,7 +132,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, ...@@ -132,7 +132,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
if (n > NECODES) if (n > NECODES)
n = 0; n = 0;
if (net_ratelimit()) if (net_ratelimit())
eprintk("error packet from %d.%d; ecode=%d '%s'\n", printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n",
be16_to_cpu(h->major), h->minor, be16_to_cpu(h->major), h->minor,
h->err, aoe_errlist[n]); h->err, aoe_errlist[n]);
goto exit; goto exit;
...@@ -146,7 +146,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, ...@@ -146,7 +146,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
aoecmd_cfg_rsp(skb); aoecmd_cfg_rsp(skb);
break; break;
default: default:
iprintk("unknown cmd %d\n", h->cmd); printk(KERN_INFO "aoe: unknown cmd %d\n", h->cmd);
} }
exit: exit:
dev_kfree_skb(skb); dev_kfree_skb(skb);
......
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