aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoeblk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/aoe/aoeblk.c')
-rw-r--r--drivers/block/aoe/aoeblk.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index c05ee8bffd97..039c0911fa8f 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -22,7 +22,9 @@ static ssize_t aoedisk_show_state(struct gendisk * disk, char *page)
22 return snprintf(page, PAGE_SIZE, 22 return snprintf(page, PAGE_SIZE,
23 "%s%s\n", 23 "%s%s\n",
24 (d->flags & DEVFL_UP) ? "up" : "down", 24 (d->flags & DEVFL_UP) ? "up" : "down",
25 (d->flags & DEVFL_CLOSEWAIT) ? ",closewait" : ""); 25 (d->flags & DEVFL_PAUSE) ? ",paused" :
26 (d->nopen && !(d->flags & DEVFL_UP)) ? ",closewait" : "");
27 /* I'd rather see nopen exported so we can ditch closewait */
26} 28}
27static ssize_t aoedisk_show_mac(struct gendisk * disk, char *page) 29static ssize_t aoedisk_show_mac(struct gendisk * disk, char *page)
28{ 30{
@@ -107,8 +109,7 @@ aoeblk_release(struct inode *inode, struct file *filp)
107 109
108 spin_lock_irqsave(&d->lock, flags); 110 spin_lock_irqsave(&d->lock, flags);
109 111
110 if (--d->nopen == 0 && (d->flags & DEVFL_CLOSEWAIT)) { 112 if (--d->nopen == 0 && !(d->flags & DEVFL_UP)) {
111 d->flags &= ~DEVFL_CLOSEWAIT;
112 spin_unlock_irqrestore(&d->lock, flags); 113 spin_unlock_irqrestore(&d->lock, flags);
113 aoecmd_cfg(d->aoemajor, d->aoeminor); 114 aoecmd_cfg(d->aoemajor, d->aoeminor);
114 return 0; 115 return 0;
@@ -158,14 +159,14 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
158 } 159 }
159 160
160 list_add_tail(&buf->bufs, &d->bufq); 161 list_add_tail(&buf->bufs, &d->bufq);
161 aoecmd_work(d);
162 162
163 aoecmd_work(d);
163 sl = d->sendq_hd; 164 sl = d->sendq_hd;
164 d->sendq_hd = d->sendq_tl = NULL; 165 d->sendq_hd = d->sendq_tl = NULL;
165 166
166 spin_unlock_irqrestore(&d->lock, flags); 167 spin_unlock_irqrestore(&d->lock, flags);
167
168 aoenet_xmit(sl); 168 aoenet_xmit(sl);
169
169 return 0; 170 return 0;
170} 171}
171 172
@@ -205,7 +206,7 @@ aoeblk_gdalloc(void *vp)
205 printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate disk " 206 printk(KERN_ERR "aoe: aoeblk_gdalloc: cannot allocate disk "
206 "structure for %ld.%ld\n", d->aoemajor, d->aoeminor); 207 "structure for %ld.%ld\n", d->aoemajor, d->aoeminor);
207 spin_lock_irqsave(&d->lock, flags); 208 spin_lock_irqsave(&d->lock, flags);
208 d->flags &= ~DEVFL_WORKON; 209 d->flags &= ~DEVFL_GDALLOC;
209 spin_unlock_irqrestore(&d->lock, flags); 210 spin_unlock_irqrestore(&d->lock, flags);
210 return; 211 return;
211 } 212 }
@@ -218,7 +219,7 @@ aoeblk_gdalloc(void *vp)
218 "for %ld.%ld\n", d->aoemajor, d->aoeminor); 219 "for %ld.%ld\n", d->aoemajor, d->aoeminor);
219 put_disk(gd); 220 put_disk(gd);
220 spin_lock_irqsave(&d->lock, flags); 221 spin_lock_irqsave(&d->lock, flags);
221 d->flags &= ~DEVFL_WORKON; 222 d->flags &= ~DEVFL_GDALLOC;
222 spin_unlock_irqrestore(&d->lock, flags); 223 spin_unlock_irqrestore(&d->lock, flags);
223 return; 224 return;
224 } 225 }
@@ -235,18 +236,13 @@ aoeblk_gdalloc(void *vp)
235 236
236 gd->queue = &d->blkq; 237 gd->queue = &d->blkq;
237 d->gd = gd; 238 d->gd = gd;
238 d->flags &= ~DEVFL_WORKON; 239 d->flags &= ~DEVFL_GDALLOC;
239 d->flags |= DEVFL_UP; 240 d->flags |= DEVFL_UP;
240 241
241 spin_unlock_irqrestore(&d->lock, flags); 242 spin_unlock_irqrestore(&d->lock, flags);
242 243
243 add_disk(gd); 244 add_disk(gd);
244 aoedisk_add_sysfs(d); 245 aoedisk_add_sysfs(d);
245
246 printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu "
247 "sectors\n", (unsigned long long)mac_addr(d->addr),
248 d->aoemajor, d->aoeminor,
249 d->fw_ver, (long long)d->ssize);
250} 246}
251 247
252void 248void