Commit e3d2716c authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: change lnet_route_t to proper structure

Change lnet_route_t from typedef to proper structure.
Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831Reviewed-by: default avatarOlaf Weber <olaf@sgi.com>
Reviewed-by: default avatarDoug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5716397a
......@@ -65,7 +65,7 @@ extern lnet_t the_lnet; /* THE network */
/** exclusive lock */
#define LNET_LOCK_EX CFS_PERCPT_LOCK_EX
static inline int lnet_is_route_alive(lnet_route_t *route)
static inline int lnet_is_route_alive(struct lnet_route *route)
{
/* gateway is down */
if (!route->lr_gateway->lp_alive)
......
......@@ -340,7 +340,7 @@ struct lnet_peer {
lnet_nid_t lp_nid; /* peer's NID */
int lp_refcount; /* # refs */
int lp_cpt; /* CPT this peer attached on */
/* # refs from lnet_route_t::lr_gateway */
/* # refs from lnet_route::lr_gateway */
int lp_rtr_refcount;
/* returned RC ping features */
unsigned int lp_ping_feats;
......@@ -369,7 +369,7 @@ struct lnet_peer_table {
#define lnet_peer_aliveness_enabled(lp) (the_lnet.ln_routing && \
(lp)->lp_ni->ni_peertimeout > 0)
typedef struct {
struct lnet_route {
struct list_head lr_list; /* chain on net */
struct list_head lr_gwlist; /* chain on gateway */
struct lnet_peer *lr_gateway; /* router node */
......@@ -378,7 +378,7 @@ typedef struct {
unsigned int lr_downis; /* number of down NIs */
__u32 lr_hops; /* how far I am */
unsigned int lr_priority; /* route priority */
} lnet_route_t;
};
#define LNET_REMOTE_NETS_HASH_DEFAULT (1U << 7)
#define LNET_REMOTE_NETS_HASH_MAX (1U << 16)
......
......@@ -957,7 +957,7 @@ lnet_return_rx_credits_locked(struct lnet_msg *msg)
}
static int
lnet_compare_routes(lnet_route_t *r1, lnet_route_t *r2)
lnet_compare_routes(struct lnet_route *r1, struct lnet_route *r2)
{
struct lnet_peer *p1 = r1->lr_gateway;
struct lnet_peer *p2 = r2->lr_gateway;
......@@ -999,9 +999,9 @@ lnet_find_route_locked(struct lnet_ni *ni, lnet_nid_t target,
lnet_nid_t rtr_nid)
{
lnet_remotenet_t *rnet;
lnet_route_t *route;
lnet_route_t *best_route;
lnet_route_t *last_route;
struct lnet_route *route;
struct lnet_route *best_route;
struct lnet_route *last_route;
struct lnet_peer *lp_best;
struct lnet_peer *lp;
int rc;
......@@ -2351,8 +2351,8 @@ LNetDist(lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp)
rnet = list_entry(e, lnet_remotenet_t, lrn_list);
if (rnet->lrn_net == dstnet) {
lnet_route_t *route;
lnet_route_t *shortest = NULL;
struct lnet_route *route;
struct lnet_route *shortest = NULL;
__u32 shortest_hops = LNET_UNDEFINED_HOPS;
__u32 route_hops;
......
......@@ -268,7 +268,7 @@ static void lnet_shuffle_seed(void)
/* NB expects LNET_LOCK held */
static void
lnet_add_route_to_rnet(lnet_remotenet_t *rnet, lnet_route_t *route)
lnet_add_route_to_rnet(lnet_remotenet_t *rnet, struct lnet_route *route)
{
unsigned int len = 0;
unsigned int offset = 0;
......@@ -301,7 +301,7 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway,
struct list_head *e;
lnet_remotenet_t *rnet;
lnet_remotenet_t *rnet2;
lnet_route_t *route;
struct lnet_route *route;
struct lnet_ni *ni;
int add_route;
int rc;
......@@ -368,8 +368,9 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t gateway,
/* Search for a duplicate route (it's a NOOP if it is) */
add_route = 1;
list_for_each(e, &rnet2->lrn_routes) {
lnet_route_t *route2 = list_entry(e, lnet_route_t, lr_list);
struct lnet_route *route2;
route2 = list_entry(e, struct lnet_route, lr_list);
if (route2->lr_gateway == route->lr_gateway) {
add_route = 0;
break;
......@@ -416,8 +417,8 @@ int
lnet_check_routes(void)
{
lnet_remotenet_t *rnet;
lnet_route_t *route;
lnet_route_t *route2;
struct lnet_route *route;
struct lnet_route *route2;
struct list_head *e1;
struct list_head *e2;
int cpt;
......@@ -437,7 +438,7 @@ lnet_check_routes(void)
lnet_nid_t nid2;
int net;
route = list_entry(e2, lnet_route_t, lr_list);
route = list_entry(e2, struct lnet_route, lr_list);
if (!route2) {
route2 = route;
......@@ -472,7 +473,7 @@ lnet_del_route(__u32 net, lnet_nid_t gw_nid)
{
struct lnet_peer *gateway;
lnet_remotenet_t *rnet;
lnet_route_t *route;
struct lnet_route *route;
struct list_head *e1;
struct list_head *e2;
int rc = -ENOENT;
......@@ -501,7 +502,7 @@ lnet_del_route(__u32 net, lnet_nid_t gw_nid)
continue;
list_for_each(e2, &rnet->lrn_routes) {
route = list_entry(e2, lnet_route_t, lr_list);
route = list_entry(e2, struct lnet_route, lr_list);
gateway = route->lr_gateway;
if (!(gw_nid == LNET_NID_ANY ||
......@@ -588,7 +589,7 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops,
struct list_head *e1;
struct list_head *e2;
lnet_remotenet_t *rnet;
lnet_route_t *route;
struct lnet_route *route;
int cpt;
int i;
struct list_head *rn_list;
......@@ -601,7 +602,8 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops,
rnet = list_entry(e1, lnet_remotenet_t, lrn_list);
list_for_each(e2, &rnet->lrn_routes) {
route = list_entry(e2, lnet_route_t, lr_list);
route = list_entry(e2, struct lnet_route,
lr_list);
if (!idx--) {
*net = rnet->lrn_net;
......@@ -646,7 +648,7 @@ lnet_parse_rc_info(struct lnet_rc_data *rcd)
{
struct lnet_ping_info *info = rcd->rcd_pinginfo;
struct lnet_peer *gw = rcd->rcd_gateway;
lnet_route_t *rte;
struct lnet_route *rte;
if (!gw->lp_alive)
return;
......@@ -823,7 +825,7 @@ lnet_wait_known_routerstate(void)
void
lnet_router_ni_update_locked(struct lnet_peer *gw, __u32 net)
{
lnet_route_t *rte;
struct lnet_route *rte;
if ((gw->lp_ping_feats & LNET_PING_FEAT_NI_STATUS)) {
list_for_each_entry(rte, &gw->lp_routes, lr_gwlist) {
......
......@@ -171,7 +171,7 @@ static int proc_lnet_routes(struct ctl_table *table, int write,
} else {
struct list_head *n;
struct list_head *r;
lnet_route_t *route = NULL;
struct lnet_route *route = NULL;
lnet_remotenet_t *rnet = NULL;
int skip = off - 1;
struct list_head *rn_list;
......@@ -197,8 +197,9 @@ static int proc_lnet_routes(struct ctl_table *table, int write,
r = rnet->lrn_routes.next;
while (r != &rnet->lrn_routes) {
lnet_route_t *re =
list_entry(r, lnet_route_t,
struct lnet_route *re;
re = list_entry(r, struct lnet_route,
lr_list);
if (!skip) {
route = re;
......@@ -331,7 +332,7 @@ static int proc_lnet_routers(struct ctl_table *table, int write,
int last_ping = cfs_duration_sec(cfs_time_sub(now,
peer->lp_ping_timestamp));
int down_ni = 0;
lnet_route_t *rtr;
struct lnet_route *rtr;
if ((peer->lp_ping_feats &
LNET_PING_FEAT_NI_STATUS)) {
......
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