7 #include <linux/kernel.h>
13 #include <linux/slab.h>
16 #include <linux/netdevice.h>
18 #include <linux/export.h>
27 struct gendisk *disk = dev_to_disk(dev);
28 struct aoedev *
d = disk->private_data;
40 struct gendisk *disk = dev_to_disk(dev);
41 struct aoedev *d = disk->private_data;
51 struct gendisk *disk = dev_to_disk(dev);
52 struct aoedev *d = disk->private_data;
58 memset(nds, 0,
sizeof nds);
63 for (; t < te && *
t; t++) {
66 for (; ifp < e && ifp->
nd; ifp++) {
67 for (nnd = nds; nnd <
nd; nnd++)
70 if (nnd == nd && nd != ne)
79 for (p = page; nd <
ne; nd++)
81 p == page ?
"" :
",", (*nd)->name);
89 struct gendisk *disk = dev_to_disk(dev);
90 struct aoedev *d = disk->private_data;
99 .attr = { .name =
"firmware-version", .mode =
S_IRUGO },
100 .show = aoedisk_show_fwver,
104 &dev_attr_state.attr,
106 &dev_attr_netif.attr,
107 &dev_attr_firmware_version.
attr,
116 aoedisk_add_sysfs(
struct aoedev *d)
136 spin_unlock_irqrestore(&d->
lock, flags);
140 spin_unlock_irqrestore(&d->
lock, flags);
146 aoeblk_release(
struct gendisk *disk,
fmode_t mode)
148 struct aoedev *d = disk->private_data;
153 if (--d->
nopen == 0) {
154 spin_unlock_irqrestore(&d->
lock, flags);
158 spin_unlock_irqrestore(&d->
lock, flags);
198 static const struct block_device_operations aoe_bdops = {
200 .release = aoeblk_release,
201 .getgeo = aoeblk_getgeo,
218 pr_err(
"aoe: cannot allocate disk structure for %ld.%d\n",
232 pr_err(
"aoe: cannot allocate block queue for %ld.%d\n",
241 d->
blkq->backing_dev_info.name =
"aoe";
248 d->
blkq = gd->queue =
q;
253 gd->fops = &aoe_bdops;
254 gd->private_data =
d;
255 set_capacity(gd, d->
ssize);
256 snprintf(gd->disk_name,
sizeof gd->disk_name,
"etherd/e%ld.%d",
262 spin_unlock_irqrestore(&d->
lock, flags);
265 aoedisk_add_sysfs(d);
278 spin_unlock_irqrestore(&d->
lock, flags);
293 if (buf_pool_cache ==
NULL)