Staging: Pohmelfs: Add load balancing between network states with the same priority.
authorEvgeniy Polyakov <zbr@ioremap.net>
Fri, 27 Mar 2009 12:04:30 +0000 (15:04 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 17 Apr 2009 18:06:31 +0000 (11:06 -0700)
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/pohmelfs/lock.c
drivers/staging/pohmelfs/trans.c

index ad4a18559bddd050550d150fb230bfe0d7d9b1b3..22fef18cae90565ee9b4e7659905260586b865f8 100644 (file)
@@ -41,7 +41,8 @@ static int pohmelfs_send_lock_trans(struct pohmelfs_inode *pi,
        path_len = err;
 
        err = -ENOMEM;
-       t = netfs_trans_alloc(psb, path_len + sizeof(struct netfs_lock) + isize, 0, 0);
+       t = netfs_trans_alloc(psb, path_len + sizeof(struct netfs_lock) + isize,
+                       NETFS_TRANS_SINGLE_DST, 0);
        if (!t)
                goto err_out_exit;
 
index 168fc8998c3228c7cb8354ccbedd78c621206f09..fef5f9bd69200014d7d17ba48d13787f927ea3ea 100644 (file)
@@ -467,6 +467,9 @@ int netfs_trans_finish_send(struct netfs_trans *t, struct pohmelfs_sb *psb)
                                continue;
                }
 
+               if (psb->active_state && (psb->active_state->state.ctl.prio >= st->ctl.prio))
+                       st = &psb->active_state->state;
+
                err = netfs_trans_push(t, st);
                if (!err && (t->flags & NETFS_TRANS_SINGLE_DST))
                        break;