Lines Matching refs:d
38 struct aoedev *d = disk->private_data; in aoedisk_show_state() local
42 (d->flags & DEVFL_UP) ? "up" : "down", in aoedisk_show_state()
43 (d->flags & DEVFL_KICKME) ? ",kickme" : in aoedisk_show_state()
44 (d->nopen && !(d->flags & DEVFL_UP)) ? ",closewait" : ""); in aoedisk_show_state()
51 struct aoedev *d = disk->private_data; in aoedisk_show_mac() local
52 struct aoetgt *t = d->targets[0]; in aoedisk_show_mac()
62 struct aoedev *d = disk->private_data; in aoedisk_show_netif() local
71 t = d->targets; in aoedisk_show_netif()
72 te = t + d->ntargets; in aoedisk_show_netif()
100 struct aoedev *d = disk->private_data; in aoedisk_show_fwver() local
102 return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver); in aoedisk_show_fwver()
108 struct aoedev *d = disk->private_data; in aoedisk_show_payload() local
110 return snprintf(page, PAGE_SIZE, "%lu\n", d->maxbcnt); in aoedisk_show_payload()
115 struct aoedev *d; in aoedisk_debugfs_show() local
121 d = s->private; in aoedisk_debugfs_show()
123 d->rttavg >> RTTSCALE, in aoedisk_debugfs_show()
124 d->rttdev >> RTTDSCALE); in aoedisk_debugfs_show()
125 seq_printf(s, "nskbpool: %d\n", skb_queue_len(&d->skbpool)); in aoedisk_debugfs_show()
126 seq_printf(s, "kicked: %ld\n", d->kicked); in aoedisk_debugfs_show()
127 seq_printf(s, "maxbcnt: %ld\n", d->maxbcnt); in aoedisk_debugfs_show()
128 seq_printf(s, "ref: %ld\n", d->ref); in aoedisk_debugfs_show()
130 spin_lock_irqsave(&d->lock, flags); in aoedisk_debugfs_show()
131 t = d->targets; in aoedisk_debugfs_show()
132 te = t + d->ntargets; in aoedisk_debugfs_show()
152 spin_unlock_irqrestore(&d->lock, flags); in aoedisk_debugfs_show()
197 aoedisk_add_debugfs(struct aoedev *d) in aoedisk_add_debugfs() argument
203 p = strchr(d->gd->disk_name, '/'); in aoedisk_add_debugfs()
205 p = d->gd->disk_name; in aoedisk_add_debugfs()
209 d->debugfs = debugfs_create_file(p, 0444, aoe_debugfs_dir, d, in aoedisk_add_debugfs()
213 aoedisk_rm_debugfs(struct aoedev *d) in aoedisk_rm_debugfs() argument
215 debugfs_remove(d->debugfs); in aoedisk_rm_debugfs()
216 d->debugfs = NULL; in aoedisk_rm_debugfs()
222 struct aoedev *d = bdev->bd_disk->private_data; in aoeblk_open() local
225 if (!virt_addr_valid(d)) { in aoeblk_open()
231 if (!(d->flags & DEVFL_UP) || d->flags & DEVFL_TKILL) in aoeblk_open()
235 spin_lock_irqsave(&d->lock, flags); in aoeblk_open()
236 if (d->flags & DEVFL_UP && !(d->flags & DEVFL_TKILL)) { in aoeblk_open()
237 d->nopen++; in aoeblk_open()
238 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_open()
242 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_open()
250 struct aoedev *d = disk->private_data; in aoeblk_release() local
253 spin_lock_irqsave(&d->lock, flags); in aoeblk_release()
255 if (--d->nopen == 0) { in aoeblk_release()
256 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_release()
257 aoecmd_cfg(d->aoemajor, d->aoeminor); in aoeblk_release()
260 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_release()
266 struct aoedev *d = hctx->queue->queuedata; in aoeblk_queue_rq() local
268 spin_lock_irq(&d->lock); in aoeblk_queue_rq()
270 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_queue_rq()
272 d->aoemajor, d->aoeminor); in aoeblk_queue_rq()
273 spin_unlock_irq(&d->lock); in aoeblk_queue_rq()
278 list_add_tail(&bd->rq->queuelist, &d->rq_list); in aoeblk_queue_rq()
279 aoecmd_work(d); in aoeblk_queue_rq()
280 spin_unlock_irq(&d->lock); in aoeblk_queue_rq()
287 struct aoedev *d = bdev->bd_disk->private_data; in aoeblk_getgeo() local
289 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_getgeo()
294 geo->cylinders = d->geo.cylinders; in aoeblk_getgeo()
295 geo->heads = d->geo.heads; in aoeblk_getgeo()
296 geo->sectors = d->geo.sectors; in aoeblk_getgeo()
303 struct aoedev *d; in aoeblk_ioctl() local
308 d = bdev->bd_disk->private_data; in aoeblk_ioctl()
309 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_ioctl()
315 if (!copy_to_user((void __user *) arg, &d->ident, in aoeblk_ioctl()
316 sizeof(d->ident))) in aoeblk_ioctl()
345 struct aoedev *d = vp; in aoeblk_gdalloc() local
354 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
355 if (d->flags & DEVFL_GDALLOC in aoeblk_gdalloc()
356 && !(d->flags & DEVFL_TKILL) in aoeblk_gdalloc()
357 && !(d->flags & DEVFL_GD_NOW)) in aoeblk_gdalloc()
358 d->flags |= DEVFL_GD_NOW; in aoeblk_gdalloc()
361 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
368 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
376 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
380 set = &d->tag_set; in aoeblk_gdalloc()
390 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
397 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
402 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
403 WARN_ON(!(d->flags & DEVFL_GD_NOW)); in aoeblk_gdalloc()
404 WARN_ON(!(d->flags & DEVFL_GDALLOC)); in aoeblk_gdalloc()
405 WARN_ON(d->flags & DEVFL_TKILL); in aoeblk_gdalloc()
406 WARN_ON(d->gd); in aoeblk_gdalloc()
407 WARN_ON(d->flags & DEVFL_UP); in aoeblk_gdalloc()
410 d->bufpool = mp; in aoeblk_gdalloc()
411 d->blkq = gd->queue = q; in aoeblk_gdalloc()
412 q->queuedata = d; in aoeblk_gdalloc()
413 d->gd = gd; in aoeblk_gdalloc()
417 gd->first_minor = d->sysminor; in aoeblk_gdalloc()
419 gd->private_data = d; in aoeblk_gdalloc()
420 set_capacity(gd, d->ssize); in aoeblk_gdalloc()
422 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
424 d->flags &= ~DEVFL_GDALLOC; in aoeblk_gdalloc()
425 d->flags |= DEVFL_UP; in aoeblk_gdalloc()
427 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
430 aoedisk_add_debugfs(d); in aoeblk_gdalloc()
432 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
433 WARN_ON(!(d->flags & DEVFL_GD_NOW)); in aoeblk_gdalloc()
434 d->flags &= ~DEVFL_GD_NOW; in aoeblk_gdalloc()
435 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
443 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
444 d->flags &= ~DEVFL_GD_NOW; in aoeblk_gdalloc()
445 schedule_work(&d->work); in aoeblk_gdalloc()
446 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()