Commit 4f0bedec authored by Chris Horn's avatar Chris Horn Committed by Greg Kroah-Hartman

staging: lustre: rename variables in lnet_find_route_locked

Rename several variables in lnet_find_route_locked to make
the code easier to understand. Broken out of patch 7857.
Signed-off-by: default avatarChris Horn <hornc@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3679
Reviewed-on: http://review.whamcloud.com/7857Reviewed-by: default avatarCory Spitz <spitzcor@cray.com>
Reviewed-by: default avatarIsaac Huang <he.huang@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 837f9989
...@@ -1135,9 +1135,9 @@ static lnet_peer_t * ...@@ -1135,9 +1135,9 @@ static lnet_peer_t *
lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid) lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid)
{ {
lnet_remotenet_t *rnet; lnet_remotenet_t *rnet;
lnet_route_t *rtr; lnet_route_t *route;
lnet_route_t *rtr_best; lnet_route_t *best_route;
lnet_route_t *rtr_last; lnet_route_t *last_route;
struct lnet_peer *lp_best; struct lnet_peer *lp_best;
struct lnet_peer *lp; struct lnet_peer *lp;
int rc; int rc;
...@@ -1151,14 +1151,14 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid) ...@@ -1151,14 +1151,14 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid)
return NULL; return NULL;
lp_best = NULL; lp_best = NULL;
rtr_best = NULL; best_route = NULL;
rtr_last = NULL; last_route = NULL;
list_for_each_entry(rtr, &rnet->lrn_routes, lr_list) { list_for_each_entry(route, &rnet->lrn_routes, lr_list) {
lp = rtr->lr_gateway; lp = route->lr_gateway;
if (!lp->lp_alive || /* gateway is down */ if (!lp->lp_alive || /* gateway is down */
((lp->lp_ping_feats & LNET_PING_FEAT_NI_STATUS) && ((lp->lp_ping_feats & LNET_PING_FEAT_NI_STATUS) &&
rtr->lr_downis)) /* NI to target is down */ route->lr_downis)) /* NI to target is down */
continue; continue;
if (ni && lp->lp_ni != ni) if (ni && lp->lp_ni != ni)
...@@ -1168,21 +1168,21 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid) ...@@ -1168,21 +1168,21 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid)
return lp; return lp;
if (!lp_best) { if (!lp_best) {
rtr_best = rtr; best_route = route;
rtr_last = rtr; last_route = route;
lp_best = lp; lp_best = lp;
continue; continue;
} }
/* no protection on below fields, but it's harmless */ /* no protection on below fields, but it's harmless */
if (rtr_last->lr_seq - rtr->lr_seq < 0) if (last_route->lr_seq - route->lr_seq < 0)
rtr_last = rtr; last_route = route;
rc = lnet_compare_routes(rtr, rtr_best); rc = lnet_compare_routes(route, best_route);
if (rc < 0) if (rc < 0)
continue; continue;
rtr_best = rtr; best_route = route;
lp_best = lp; lp_best = lp;
} }
...@@ -1191,8 +1191,8 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid) ...@@ -1191,8 +1191,8 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid)
* so we can round-robin all routers, it's race and inaccurate but * so we can round-robin all routers, it's race and inaccurate but
* harmless and functional * harmless and functional
*/ */
if (rtr_best) if (best_route)
rtr_best->lr_seq = rtr_last->lr_seq + 1; best_route->lr_seq = last_route->lr_seq + 1;
return lp_best; return lp_best;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment