diff options
author | Ed Cashin <ecashin@coraid.com> | 2012-10-04 20:16:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:28 -0400 |
commit | 0c966214589b9767fd8771b71328f83bac58cb25 (patch) | |
tree | fa46832f149cb30b1847bc6eee13e79ef9c0c444 /drivers/block/aoe/aoecmd.c | |
parent | eecdf226721673095ef7849f960350897392e8bf (diff) |
aoe: support more AoE addresses with dynamic block device minor numbers
The ATA over Ethernet protocol uses a major (shelf) and minor (slot)
address to identify a particular storage target. These changes remove an
artificial limitation the aoe driver imposes on the use of AoE addresses.
For example, without these changes, the slot address has a maximum of 15,
but users commonly use slot numbers much greater than that.
The AoE shelf and slot address space is often used sparsely. Instead of
using a static mapping between AoE addresses and the block device minor
number, the block device minor numbers are now allocated on demand.
Signed-off-by: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/aoe/aoecmd.c')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 39dacdbda7f1..94e810c36de1 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -1149,7 +1149,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
1149 | 1149 | ||
1150 | h = (struct aoe_hdr *) skb->data; | 1150 | h = (struct aoe_hdr *) skb->data; |
1151 | aoemajor = be16_to_cpu(get_unaligned(&h->major)); | 1151 | aoemajor = be16_to_cpu(get_unaligned(&h->major)); |
1152 | d = aoedev_by_aoeaddr(aoemajor, h->minor); | 1152 | d = aoedev_by_aoeaddr(aoemajor, h->minor, 0); |
1153 | if (d == NULL) { | 1153 | if (d == NULL) { |
1154 | snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " | 1154 | snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " |
1155 | "for unknown device %d.%d\n", | 1155 | "for unknown device %d.%d\n", |
@@ -1330,7 +1330,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
1330 | struct aoe_hdr *h; | 1330 | struct aoe_hdr *h; |
1331 | struct aoe_cfghdr *ch; | 1331 | struct aoe_cfghdr *ch; |
1332 | struct aoetgt *t; | 1332 | struct aoetgt *t; |
1333 | ulong flags, sysminor, aoemajor; | 1333 | ulong flags, aoemajor; |
1334 | struct sk_buff *sl; | 1334 | struct sk_buff *sl; |
1335 | struct sk_buff_head queue; | 1335 | struct sk_buff_head queue; |
1336 | u16 n; | 1336 | u16 n; |
@@ -1349,18 +1349,15 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
1349 | "Check shelf dip switches.\n"); | 1349 | "Check shelf dip switches.\n"); |
1350 | return; | 1350 | return; |
1351 | } | 1351 | } |
1352 | if (h->minor >= NPERSHELF) { | 1352 | if (aoemajor > AOE_MAXSHELF) { |
1353 | pr_err("aoe: e%ld.%d %s, %d\n", | 1353 | pr_info("aoe: e%ld.%d: shelf number too large\n", |
1354 | aoemajor, h->minor, | 1354 | aoemajor, (int) h->minor); |
1355 | "slot number larger than the maximum", | ||
1356 | NPERSHELF-1); | ||
1357 | return; | 1355 | return; |
1358 | } | 1356 | } |
1359 | 1357 | ||
1360 | sysminor = SYSMINOR(aoemajor, h->minor); | 1358 | d = aoedev_by_aoeaddr(aoemajor, h->minor, 1); |
1361 | if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) { | 1359 | if (d == NULL) { |
1362 | printk(KERN_INFO "aoe: e%ld.%d: minor number too large\n", | 1360 | pr_info("aoe: device allocation failure\n"); |
1363 | aoemajor, (int) h->minor); | ||
1364 | return; | 1361 | return; |
1365 | } | 1362 | } |
1366 | 1363 | ||
@@ -1368,12 +1365,6 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
1368 | if (n > aoe_maxout) /* keep it reasonable */ | 1365 | if (n > aoe_maxout) /* keep it reasonable */ |
1369 | n = aoe_maxout; | 1366 | n = aoe_maxout; |
1370 | 1367 | ||
1371 | d = aoedev_by_sysminor_m(sysminor); | ||
1372 | if (d == NULL) { | ||
1373 | printk(KERN_INFO "aoe: device sysminor_m failure\n"); | ||
1374 | return; | ||
1375 | } | ||
1376 | |||
1377 | spin_lock_irqsave(&d->lock, flags); | 1368 | spin_lock_irqsave(&d->lock, flags); |
1378 | 1369 | ||
1379 | t = gettgt(d, h->src); | 1370 | t = gettgt(d, h->src); |