Lines Matching refs:d

37 	struct aoedev *d = disk->private_data;  in aoedisk_show_state()  local
40 (d->flags & DEVFL_UP) ? "up" : "down", in aoedisk_show_state()
41 (d->flags & DEVFL_KICKME) ? ",kickme" : in aoedisk_show_state()
42 (d->nopen && !(d->flags & DEVFL_UP)) ? ",closewait" : ""); in aoedisk_show_state()
49 struct aoedev *d = disk->private_data; in aoedisk_show_mac() local
50 struct aoetgt *t = d->targets[0]; in aoedisk_show_mac()
60 struct aoedev *d = disk->private_data; in aoedisk_show_netif() local
69 t = d->targets; in aoedisk_show_netif()
70 te = t + d->ntargets; in aoedisk_show_netif()
98 struct aoedev *d = disk->private_data; in aoedisk_show_fwver() local
100 return sysfs_emit(page, "0x%04x\n", (unsigned int) d->fw_ver); in aoedisk_show_fwver()
106 struct aoedev *d = disk->private_data; in aoedisk_show_payload() local
108 return sysfs_emit(page, "%lu\n", d->maxbcnt); in aoedisk_show_payload()
113 struct aoedev *d; in aoe_debugfs_show() local
119 d = s->private; in aoe_debugfs_show()
121 d->rttavg >> RTTSCALE, in aoe_debugfs_show()
122 d->rttdev >> RTTDSCALE); in aoe_debugfs_show()
123 seq_printf(s, "nskbpool: %d\n", skb_queue_len(&d->skbpool)); in aoe_debugfs_show()
124 seq_printf(s, "kicked: %ld\n", d->kicked); in aoe_debugfs_show()
125 seq_printf(s, "maxbcnt: %ld\n", d->maxbcnt); in aoe_debugfs_show()
126 seq_printf(s, "ref: %ld\n", d->ref); in aoe_debugfs_show()
128 spin_lock_irqsave(&d->lock, flags); in aoe_debugfs_show()
129 t = d->targets; in aoe_debugfs_show()
130 te = t + d->ntargets; in aoe_debugfs_show()
150 spin_unlock_irqrestore(&d->lock, flags); in aoe_debugfs_show()
184 aoedisk_add_debugfs(struct aoedev *d) in aoedisk_add_debugfs() argument
190 p = strchr(d->gd->disk_name, '/'); in aoedisk_add_debugfs()
192 p = d->gd->disk_name; in aoedisk_add_debugfs()
196 d->debugfs = debugfs_create_file(p, 0444, aoe_debugfs_dir, d, in aoedisk_add_debugfs()
200 aoedisk_rm_debugfs(struct aoedev *d) in aoedisk_rm_debugfs() argument
202 debugfs_remove(d->debugfs); in aoedisk_rm_debugfs()
203 d->debugfs = NULL; in aoedisk_rm_debugfs()
209 struct aoedev *d = disk->private_data; in aoeblk_open() local
212 if (!virt_addr_valid(d)) { in aoeblk_open()
218 if (!(d->flags & DEVFL_UP) || d->flags & DEVFL_TKILL) in aoeblk_open()
222 spin_lock_irqsave(&d->lock, flags); in aoeblk_open()
223 if (d->flags & DEVFL_UP && !(d->flags & DEVFL_TKILL)) { in aoeblk_open()
224 d->nopen++; in aoeblk_open()
225 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_open()
229 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_open()
237 struct aoedev *d = disk->private_data; in aoeblk_release() local
240 spin_lock_irqsave(&d->lock, flags); in aoeblk_release()
242 if (--d->nopen == 0) { in aoeblk_release()
243 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_release()
244 aoecmd_cfg(d->aoemajor, d->aoeminor); in aoeblk_release()
247 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_release()
253 struct aoedev *d = hctx->queue->queuedata; in aoeblk_queue_rq() local
255 spin_lock_irq(&d->lock); in aoeblk_queue_rq()
257 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_queue_rq()
259 d->aoemajor, d->aoeminor); in aoeblk_queue_rq()
260 spin_unlock_irq(&d->lock); in aoeblk_queue_rq()
265 list_add_tail(&bd->rq->queuelist, &d->rq_list); in aoeblk_queue_rq()
266 aoecmd_work(d); in aoeblk_queue_rq()
267 spin_unlock_irq(&d->lock); in aoeblk_queue_rq()
274 struct aoedev *d = bdev->bd_disk->private_data; in aoeblk_getgeo() local
276 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_getgeo()
281 geo->cylinders = d->geo.cylinders; in aoeblk_getgeo()
282 geo->heads = d->geo.heads; in aoeblk_getgeo()
283 geo->sectors = d->geo.sectors; in aoeblk_getgeo()
290 struct aoedev *d; in aoeblk_ioctl() local
295 d = bdev->bd_disk->private_data; in aoeblk_ioctl()
296 if ((d->flags & DEVFL_UP) == 0) { in aoeblk_ioctl()
302 if (!copy_to_user((void __user *) arg, &d->ident, in aoeblk_ioctl()
303 sizeof(d->ident))) in aoeblk_ioctl()
332 struct aoedev *d = vp; in aoeblk_gdalloc() local
341 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
342 if (d->flags & DEVFL_GDALLOC in aoeblk_gdalloc()
343 && !(d->flags & DEVFL_TKILL) in aoeblk_gdalloc()
344 && !(d->flags & DEVFL_GD_NOW)) in aoeblk_gdalloc()
345 d->flags |= DEVFL_GD_NOW; in aoeblk_gdalloc()
348 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
356 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
360 set = &d->tag_set; in aoeblk_gdalloc()
370 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
374 gd = blk_mq_alloc_disk(set, d); in aoeblk_gdalloc()
377 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
381 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
382 WARN_ON(!(d->flags & DEVFL_GD_NOW)); in aoeblk_gdalloc()
383 WARN_ON(!(d->flags & DEVFL_GDALLOC)); in aoeblk_gdalloc()
384 WARN_ON(d->flags & DEVFL_TKILL); in aoeblk_gdalloc()
385 WARN_ON(d->gd); in aoeblk_gdalloc()
386 WARN_ON(d->flags & DEVFL_UP); in aoeblk_gdalloc()
389 d->bufpool = mp; in aoeblk_gdalloc()
390 d->blkq = gd->queue; in aoeblk_gdalloc()
391 d->gd = gd; in aoeblk_gdalloc()
395 gd->first_minor = d->sysminor; in aoeblk_gdalloc()
398 gd->private_data = d; in aoeblk_gdalloc()
399 ssize = d->ssize; in aoeblk_gdalloc()
401 d->aoemajor, d->aoeminor); in aoeblk_gdalloc()
403 d->flags &= ~DEVFL_GDALLOC; in aoeblk_gdalloc()
404 d->flags |= DEVFL_UP; in aoeblk_gdalloc()
406 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
413 aoedisk_add_debugfs(d); in aoeblk_gdalloc()
415 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
416 WARN_ON(!(d->flags & DEVFL_GD_NOW)); in aoeblk_gdalloc()
417 d->flags &= ~DEVFL_GD_NOW; in aoeblk_gdalloc()
418 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()
428 spin_lock_irqsave(&d->lock, flags); in aoeblk_gdalloc()
429 d->flags &= ~DEVFL_GD_NOW; in aoeblk_gdalloc()
430 queue_work(aoe_wq, &d->work); in aoeblk_gdalloc()
431 spin_unlock_irqrestore(&d->lock, flags); in aoeblk_gdalloc()