summaryrefslogtreecommitdiff
path: root/drivers/block/aoe/aoedev.c
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2012-10-05 04:16:33 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 22:05:27 +0400
commit64a80f5ac78a289f66c373ace61973205d960ee7 (patch)
tree3a8b9f5c1860acd8bab6d022dbbca32985e228ee /drivers/block/aoe/aoedev.c
parent6583303c5e324a918ee1d57201acd9869f3be6da (diff)
downloadlinux-64a80f5ac78a289f66c373ace61973205d960ee7.tar.xz
aoe: associate frames with the AoE storage target
In the driver code, "target" and aoetgt refer to a particular remote interface on the AoE storage target. The latter is identified by its AoE major and minor addresses. Commands that are being sent to an AoE storage target {major, minor} can be sent or retransmitted to any of the remote MAC addresses associated with the AoE storage target. That is, frames are naturally associated with not an aoetgt (AoE major, AoE minor, remote MAC address) but an aoedev (AoE major, AoE minor). Making the code reflect that reality simplifies the driver, especially when the path to a remote MAC address becomes unusable. 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/aoedev.c')
-rw-r--r--drivers/block/aoe/aoedev.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 635dc986cf77..3968fe6c0077 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -103,22 +103,23 @@ aoedev_downdev(struct aoedev *d)
d->flags &= ~DEVFL_UP;
- /* clean out active buffers on all targets */
+ /* clean out active buffers */
+ for (i = 0; i < NFACTIVE; i++) {
+ head = &d->factive[i];
+ list_for_each_safe(pos, nx, head) {
+ f = list_entry(pos, struct frame, head);
+ list_del(pos);
+ if (f->buf) {
+ f->buf->nframesout--;
+ aoe_failbuf(d, f->buf);
+ }
+ aoe_freetframe(f);
+ }
+ }
+ /* reset window dressings */
tt = d->targets;
te = tt + NTARGETS;
for (; tt < te && (t = *tt); tt++) {
- for (i = 0; i < NFACTIVE; i++) {
- head = &t->factive[i];
- list_for_each_safe(pos, nx, head) {
- list_del(pos);
- f = list_entry(pos, struct frame, head);
- if (f->buf) {
- f->buf->nframesout--;
- aoe_failbuf(d, f->buf);
- }
- aoe_freetframe(f);
- }
- }
t->maxout = t->nframes;
t->nout = 0;
}
@@ -250,6 +251,7 @@ struct aoedev *
aoedev_by_sysminor_m(ulong sysminor)
{
struct aoedev *d;
+ int i;
ulong flags;
spin_lock_irqsave(&devlist_lock, flags);
@@ -275,6 +277,8 @@ aoedev_by_sysminor_m(ulong sysminor)
d->bufpool = NULL; /* defer to aoeblk_gdalloc */
d->tgt = d->targets;
d->ref = 1;
+ for (i = 0; i < NFACTIVE; i++)
+ INIT_LIST_HEAD(&d->factive[i]);
d->sysminor = sysminor;
d->aoemajor = AOEMAJOR(sysminor);
d->aoeminor = AOEMINOR(sysminor);