Lines Matching refs:d

38 	struct aoedev *d = disk->private_data;  in aoedisk_show_state()  local
41 (d->flags & DEVFL_UP) ? "up" : "down", in aoedisk_show_state()
42 (d->flags & DEVFL_KICKME) ? ",kickme" : in aoedisk_show_state()
43 (d->nopen && !(d->flags & DEVFL_UP)) ? ",closewait" : ""); in aoedisk_show_state()
50 struct aoedev *d = disk->private_data; in aoedisk_show_mac() local
51 struct aoetgt *t = d->targets[0]; in aoedisk_show_mac()
61 struct aoedev *d = disk->private_data; in aoedisk_show_netif() local
70 t = d->targets; in aoedisk_show_netif()
71 te = t + d->ntargets; in aoedisk_show_netif()
99 struct aoedev *d = disk->private_data; in aoedisk_show_fwver() local
101 return sysfs_emit(page, "0x%04x\n", (unsigned int) d->fw_ver); in aoedisk_show_fwver()
107 struct aoedev *d = disk->private_data; in aoedisk_show_payload() local
109 return sysfs_emit(page, "%lu\n", d->maxbcnt); in aoedisk_show_payload()
114 struct aoedev *d; in aoedisk_debugfs_show() local
120 d = s->private; in aoedisk_debugfs_show()
122 d->rttavg >> RTTSCALE, in aoedisk_debugfs_show()
123 d->rttdev >> RTTDSCALE); in aoedisk_debugfs_show()
124 seq_printf(s, "nskbpool: %d\n", skb_queue_len(&d->skbpool)); in aoedisk_debugfs_show()
125 seq_printf(s, "kicked: %ld\n", d->kicked); in aoedisk_debugfs_show()
126 seq_printf(s, "maxbcnt: %ld\n", d->maxbcnt); in aoedisk_debugfs_show()
127 seq_printf(s, "ref: %ld\n", d->ref); in aoedisk_debugfs_show()
129 spin_lock_irqsave(&d->lock, flags); in aoedisk_debugfs_show()
130 t = d->targets; in aoedisk_debugfs_show()
131 te = t + d->ntargets; in aoedisk_debugfs_show()
151 spin_unlock_irqrestore(&d->lock, flags); in aoedisk_debugfs_show()
196 aoedisk_add_debugfs(struct aoedev *d) in aoedisk_add_debugfs() argument
202 p = strchr(d->gd->disk_name, '/'); in aoedisk_add_debugfs()
204 p = d->gd->disk_name; in aoedisk_add_debugfs()
208 d->debugfs = debugfs_create_file(p, 0444, aoe_debugfs_dir, d, in aoedisk_add_debugfs()
212 aoedisk_rm_debugfs(struct aoedev *d) in aoedisk_rm_debugfs() argument
214 debugfs_remove(d->debugfs); in aoedisk_rm_debugfs()
215 d->debugfs = NULL; in aoedisk_rm_debugfs()
221 struct aoedev *d = bdev->bd_disk->private_data; in aoeblk_open() local
224 if (!virt_addr_valid(d)) { in aoeblk_open()
230 if (!(d->flags & DEVFL_UP) || d->flags & DEVFL_TKILL) in aoeblk_open()
234 spin_lock_irqsave(&d->lock, flags); in aoeblk_open()
235 if (d->flags & DEVFL_UP && !(d->flags & DEVFL_TKILL)) { in aoeblk_open()
236 d->nopen++; in aoeblk_open()
237 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_open()
241 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_open()
249 struct aoedev *d = disk->private_data; in aoeblk_release() local
252 spin_lock_irqsave(&d->lock, flags); in aoeblk_release()
254 if (--d->nopen == 0) { in aoeblk_release()
255 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_release()
256 aoecmd_cfg(d->aoemajor, d->aoeminor); in aoeblk_release()
259 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_release()
265 struct aoedev *d = hctx->queue->queuedata; in aoeblk_queue_rq() local
267 spin_lock_irq(&d->lock); in aoeblk_queue_rq()
269 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_queue_rq()
271 d->aoemajor, d->aoeminor); in aoeblk_queue_rq()
272 spin_unlock_irq(&d->lock); in aoeblk_queue_rq()
277 list_add_tail(&bd->rq->queuelist, &d->rq_list); in aoeblk_queue_rq()
278 aoecmd_work(d); in aoeblk_queue_rq()
279 spin_unlock_irq(&d->lock); in aoeblk_queue_rq()
286 struct aoedev *d = bdev->bd_disk->private_data; in aoeblk_getgeo() local
288 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_getgeo()
293 geo->cylinders = d->geo.cylinders; in aoeblk_getgeo()
294 geo->heads = d->geo.heads; in aoeblk_getgeo()
295 geo->sectors = d->geo.sectors; in aoeblk_getgeo()
302 struct aoedev *d; in aoeblk_ioctl() local
307 d = bdev->bd_disk->private_data; in aoeblk_ioctl()
308 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_ioctl()
314 if (!copy_to_user((void __user *) arg, &d->ident, in aoeblk_ioctl()
315 sizeof(d->ident))) in aoeblk_ioctl()
344 struct aoedev *d = vp; in aoeblk_gdalloc() local
352 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
353 if (d->flags & DEVFL_GDALLOC in aoeblk_gdalloc()
354 && !(d->flags & DEVFL_TKILL) in aoeblk_gdalloc()
355 && !(d->flags & DEVFL_GD_NOW)) in aoeblk_gdalloc()
356 d->flags |= DEVFL_GD_NOW; in aoeblk_gdalloc()
359 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
367 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
371 set = &d->tag_set; in aoeblk_gdalloc()
381 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
385 gd = blk_mq_alloc_disk(set, d); in aoeblk_gdalloc()
388 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
392 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
393 WARN_ON(!(d->flags & DEVFL_GD_NOW)); in aoeblk_gdalloc()
394 WARN_ON(!(d->flags & DEVFL_GDALLOC)); in aoeblk_gdalloc()
395 WARN_ON(d->flags & DEVFL_TKILL); in aoeblk_gdalloc()
396 WARN_ON(d->gd); in aoeblk_gdalloc()
397 WARN_ON(d->flags & DEVFL_UP); in aoeblk_gdalloc()
400 d->bufpool = mp; in aoeblk_gdalloc()
401 d->blkq = gd->queue; in aoeblk_gdalloc()
402 d->gd = gd; in aoeblk_gdalloc()
406 gd->first_minor = d->sysminor; in aoeblk_gdalloc()
409 gd->private_data = d; in aoeblk_gdalloc()
410 set_capacity(gd, d->ssize); in aoeblk_gdalloc()
412 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
414 d->flags &= ~DEVFL_GDALLOC; in aoeblk_gdalloc()
415 d->flags |= DEVFL_UP; in aoeblk_gdalloc()
417 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
422 aoedisk_add_debugfs(d); in aoeblk_gdalloc()
424 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
425 WARN_ON(!(d->flags & DEVFL_GD_NOW)); in aoeblk_gdalloc()
426 d->flags &= ~DEVFL_GD_NOW; in aoeblk_gdalloc()
427 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
437 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
438 d->flags &= ~DEVFL_GD_NOW; in aoeblk_gdalloc()
439 schedule_work(&d->work); in aoeblk_gdalloc()
440 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()