aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2012-10-04 20:16:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:05:27 -0400
commitb21faa25c6d25a76c09f1e05a1b18ee2372e3841 (patch)
tree0a09a402dbfa7f2179a0921be004e53d19201053 /drivers/block/aoe
parent1b86fda9adf1b691a76f8ceddfc59d0c8386257c (diff)
aoe: remove unused code and add cosmetic improvements
This change removes some unused code and attempts to increase code consistency. Signed-off-by: Ed Cashin <ecashin@coraid.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/aoe')
-rw-r--r--drivers/block/aoe/aoe.h10
-rw-r--r--drivers/block/aoe/aoechr.c1
-rw-r--r--drivers/block/aoe/aoecmd.c13
-rw-r--r--drivers/block/aoe/aoenet.c3
4 files changed, 10 insertions, 17 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
index dab7258ddb2..eb41fc54995 100644
--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -75,18 +75,14 @@ enum {
75 DEVFL_UP = 1, /* device is installed in system and ready for AoE->ATA commands */ 75 DEVFL_UP = 1, /* device is installed in system and ready for AoE->ATA commands */
76 DEVFL_TKILL = (1<<1), /* flag for timer to know when to kill self */ 76 DEVFL_TKILL = (1<<1), /* flag for timer to know when to kill self */
77 DEVFL_EXT = (1<<2), /* device accepts lba48 commands */ 77 DEVFL_EXT = (1<<2), /* device accepts lba48 commands */
78 DEVFL_CLOSEWAIT = (1<<3), /* device is waiting for all closes to revalidate */ 78 DEVFL_GDALLOC = (1<<3), /* need to alloc gendisk */
79 DEVFL_GDALLOC = (1<<4), /* need to alloc gendisk */ 79 DEVFL_KICKME = (1<<4), /* slow polling network card catch */
80 DEVFL_KICKME = (1<<5), /* slow polling network card catch */ 80 DEVFL_NEWSIZE = (1<<5), /* need to update dev size in block layer */
81 DEVFL_NEWSIZE = (1<<6), /* need to update dev size in block layer */
82
83 BUFFL_FAIL = 1,
84}; 81};
85 82
86enum { 83enum {
87 DEFAULTBCNT = 2 * 512, /* 2 sectors */ 84 DEFAULTBCNT = 2 * 512, /* 2 sectors */
88 NPERSHELF = 16, /* number of slots per shelf address */ 85 NPERSHELF = 16, /* number of slots per shelf address */
89 FREETAG = -1,
90 MIN_BUFS = 16, 86 MIN_BUFS = 16,
91 NTARGETS = 8, 87 NTARGETS = 8,
92 NAOEIFS = 8, 88 NAOEIFS = 8,
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index acdd0adaf5d..723e60419ed 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -174,6 +174,7 @@ aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp
174 break; 174 break;
175 case MINOR_FLUSH: 175 case MINOR_FLUSH:
176 ret = aoedev_flush(buf, cnt); 176 ret = aoedev_flush(buf, cnt);
177 break;
177 } 178 }
178 if (ret == 0) 179 if (ret == 0)
179 ret = cnt; 180 ret = cnt;
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 2f19b9bba91..6d2a21458b5 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -284,7 +284,6 @@ aoecmd_ata_rw(struct aoedev *d)
284 struct aoe_hdr *h; 284 struct aoe_hdr *h;
285 struct aoe_atahdr *ah; 285 struct aoe_atahdr *ah;
286 struct buf *buf; 286 struct buf *buf;
287 struct bio_vec *bv;
288 struct aoetgt *t; 287 struct aoetgt *t;
289 struct sk_buff *skb; 288 struct sk_buff *skb;
290 struct sk_buff_head queue; 289 struct sk_buff_head queue;
@@ -301,7 +300,6 @@ aoecmd_ata_rw(struct aoedev *d)
301 if (f == NULL) 300 if (f == NULL)
302 return 0; 301 return 0;
303 t = *d->tgt; 302 t = *d->tgt;
304 bv = buf->bv;
305 bcnt = d->maxbcnt; 303 bcnt = d->maxbcnt;
306 if (bcnt == 0) 304 if (bcnt == 0)
307 bcnt = DEFAULTBCNT; 305 bcnt = DEFAULTBCNT;
@@ -788,28 +786,25 @@ void
788aoecmd_sleepwork(struct work_struct *work) 786aoecmd_sleepwork(struct work_struct *work)
789{ 787{
790 struct aoedev *d = container_of(work, struct aoedev, work); 788 struct aoedev *d = container_of(work, struct aoedev, work);
789 struct block_device *bd;
790 u64 ssize;
791 791
792 if (d->flags & DEVFL_GDALLOC) 792 if (d->flags & DEVFL_GDALLOC)
793 aoeblk_gdalloc(d); 793 aoeblk_gdalloc(d);
794 794
795 if (d->flags & DEVFL_NEWSIZE) { 795 if (d->flags & DEVFL_NEWSIZE) {
796 struct block_device *bd;
797 unsigned long flags;
798 u64 ssize;
799
800 ssize = get_capacity(d->gd); 796 ssize = get_capacity(d->gd);
801 bd = bdget_disk(d->gd, 0); 797 bd = bdget_disk(d->gd, 0);
802
803 if (bd) { 798 if (bd) {
804 mutex_lock(&bd->bd_inode->i_mutex); 799 mutex_lock(&bd->bd_inode->i_mutex);
805 i_size_write(bd->bd_inode, (loff_t)ssize<<9); 800 i_size_write(bd->bd_inode, (loff_t)ssize<<9);
806 mutex_unlock(&bd->bd_inode->i_mutex); 801 mutex_unlock(&bd->bd_inode->i_mutex);
807 bdput(bd); 802 bdput(bd);
808 } 803 }
809 spin_lock_irqsave(&d->lock, flags); 804 spin_lock_irq(&d->lock);
810 d->flags |= DEVFL_UP; 805 d->flags |= DEVFL_UP;
811 d->flags &= ~DEVFL_NEWSIZE; 806 d->flags &= ~DEVFL_NEWSIZE;
812 spin_unlock_irqrestore(&d->lock, flags); 807 spin_unlock_irq(&d->lock);
813 } 808 }
814} 809}
815 810
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c
index 5f43710601a..3c923e56d53 100644
--- a/drivers/block/aoe/aoenet.c
+++ b/drivers/block/aoe/aoenet.c
@@ -175,7 +175,8 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
175 default: 175 default:
176 if (h->cmd >= AOECMD_VEND_MIN) 176 if (h->cmd >= AOECMD_VEND_MIN)
177 break; /* don't complain about vendor commands */ 177 break; /* don't complain about vendor commands */
178 printk(KERN_INFO "aoe: unknown cmd %d\n", h->cmd); 178 pr_info("aoe: unknown AoE command type 0x%02x\n", h->cmd);
179 break;
179 } 180 }
180 181
181 if (!skb) 182 if (!skb)