diff options
Diffstat (limited to 'drivers/staging/lustre/lnet/lnet/router_proc.c')
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/router_proc.c | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index c055afc..ee902dc 100644 --- a/drivers/staging/lustre/lnet/lnet/router_proc.c +++ b/drivers/staging/lustre/lnet/lnet/router_proc.c @@ -112,11 +112,11 @@ static int proc_call_handler(void *data, int write, loff_t *ppos, static int __proc_lnet_stats(void *data, int write, loff_t pos, void __user *buffer, int nob) { - int rc; + int rc; lnet_counters_t *ctrs; - int len; - char *tmpstr; - const int tmpsiz = 256; /* 7 %u and 4 %llu */ + int len; + char *tmpstr; + const int tmpsiz = 256; /* 7 %u and 4 %llu */ if (write) { lnet_counters_reset(); @@ -167,13 +167,13 @@ static int proc_lnet_stats(struct ctl_table *table, int write, static int proc_lnet_routes(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - const int tmpsiz = 256; - char *tmpstr; - char *s; - int rc = 0; - int len; - int ver; - int off; + const int tmpsiz = 256; + char *tmpstr; + char *s; + int rc = 0; + int len; + int ver; + int off; CLASSERT(sizeof(loff_t) >= 4); @@ -205,13 +205,13 @@ static int proc_lnet_routes(struct ctl_table *table, int write, lnet_net_unlock(0); *ppos = LNET_PROC_POS_MAKE(0, ver, 0, off); } else { - struct list_head *n; - struct list_head *r; - lnet_route_t *route = NULL; - lnet_remotenet_t *rnet = NULL; - int skip = off - 1; - struct list_head *rn_list; - int i; + struct list_head *n; + struct list_head *r; + lnet_route_t *route = NULL; + lnet_remotenet_t *rnet = NULL; + int skip = off - 1; + struct list_head *rn_list; + int i; lnet_net_lock(0); @@ -251,11 +251,11 @@ static int proc_lnet_routes(struct ctl_table *table, int write, } if (route != NULL) { - __u32 net = rnet->lrn_net; - unsigned int hops = route->lr_hops; - unsigned int priority = route->lr_priority; - lnet_nid_t nid = route->lr_gateway->lp_nid; - int alive = route->lr_gateway->lp_alive; + __u32 net = rnet->lrn_net; + unsigned int hops = route->lr_hops; + unsigned int priority = route->lr_priority; + lnet_nid_t nid = route->lr_gateway->lp_nid; + int alive = route->lr_gateway->lp_alive; s += snprintf(s, tmpstr + tmpsiz - s, "%-8s %4u %8u %7s %s\n", @@ -293,13 +293,13 @@ static int proc_lnet_routes(struct ctl_table *table, int write, static int proc_lnet_routers(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - int rc = 0; - char *tmpstr; - char *s; - const int tmpsiz = 256; - int len; - int ver; - int off; + int rc = 0; + char *tmpstr; + char *s; + const int tmpsiz = 256; + int len; + int ver; + int off; off = LNET_PROC_HOFF_GET(*ppos); ver = LNET_PROC_VER_GET(*ppos); @@ -328,9 +328,9 @@ static int proc_lnet_routers(struct ctl_table *table, int write, lnet_net_unlock(0); *ppos = LNET_PROC_POS_MAKE(0, ver, 0, off); } else { - struct list_head *r; - struct lnet_peer *peer = NULL; - int skip = off - 1; + struct list_head *r; + struct lnet_peer *peer = NULL; + int skip = off - 1; lnet_net_lock(0); @@ -360,14 +360,14 @@ static int proc_lnet_routers(struct ctl_table *table, int write, lnet_nid_t nid = peer->lp_nid; unsigned long now = cfs_time_current(); unsigned long deadline = peer->lp_ping_deadline; - int nrefs = peer->lp_refcount; - int nrtrrefs = peer->lp_rtr_refcount; + int nrefs = peer->lp_refcount; + int nrtrrefs = peer->lp_rtr_refcount; int alive_cnt = peer->lp_alive_count; - int alive = peer->lp_alive; - int pingsent = !peer->lp_ping_notsent; + int alive = peer->lp_alive; + int pingsent = !peer->lp_ping_notsent; int last_ping = cfs_duration_sec(cfs_time_sub(now, peer->lp_ping_timestamp)); - int down_ni = 0; + int down_ni = 0; lnet_route_t *rtr; if ((peer->lp_ping_feats & @@ -428,16 +428,16 @@ static int proc_lnet_routers(struct ctl_table *table, int write, static int proc_lnet_peers(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - const int tmpsiz = 256; - struct lnet_peer_table *ptable; - char *tmpstr; - char *s; - int cpt = LNET_PROC_CPT_GET(*ppos); - int ver = LNET_PROC_VER_GET(*ppos); - int hash = LNET_PROC_HASH_GET(*ppos); - int hoff = LNET_PROC_HOFF_GET(*ppos); - int rc = 0; - int len; + const int tmpsiz = 256; + struct lnet_peer_table *ptable; + char *tmpstr; + char *s; + int cpt = LNET_PROC_CPT_GET(*ppos); + int ver = LNET_PROC_VER_GET(*ppos); + int hash = LNET_PROC_HASH_GET(*ppos); + int hoff = LNET_PROC_HOFF_GET(*ppos); + int rc = 0; + int len; CLASSERT(LNET_PROC_HASH_BITS >= LNET_PEER_HASH_BITS); LASSERT(!write); @@ -465,9 +465,9 @@ static int proc_lnet_peers(struct ctl_table *table, int write, hoff++; } else { - struct lnet_peer *peer; - struct list_head *p; - int skip; + struct lnet_peer *peer; + struct list_head *p; + int skip; again: p = NULL; peer = NULL; @@ -521,23 +521,23 @@ static int proc_lnet_peers(struct ctl_table *table, int write, } if (peer != NULL) { - lnet_nid_t nid = peer->lp_nid; - int nrefs = peer->lp_refcount; - int lastalive = -1; - char *aliveness = "NA"; - int maxcr = peer->lp_ni->ni_peertxcredits; - int txcr = peer->lp_txcredits; - int mintxcr = peer->lp_mintxcredits; - int rtrcr = peer->lp_rtrcredits; - int minrtrcr = peer->lp_minrtrcredits; - int txqnob = peer->lp_txqnob; + lnet_nid_t nid = peer->lp_nid; + int nrefs = peer->lp_refcount; + int lastalive = -1; + char *aliveness = "NA"; + int maxcr = peer->lp_ni->ni_peertxcredits; + int txcr = peer->lp_txcredits; + int mintxcr = peer->lp_mintxcredits; + int rtrcr = peer->lp_rtrcredits; + int minrtrcr = peer->lp_minrtrcredits; + int txqnob = peer->lp_txqnob; if (lnet_isrouter(peer) || lnet_peer_aliveness_enabled(peer)) aliveness = peer->lp_alive ? "up" : "down"; if (lnet_peer_aliveness_enabled(peer)) { - unsigned long now = cfs_time_current(); + unsigned long now = cfs_time_current(); long delta; delta = cfs_time_sub(now, peer->lp_last_alive); @@ -595,13 +595,13 @@ static int proc_lnet_peers(struct ctl_table *table, int write, static int __proc_lnet_buffers(void *data, int write, loff_t pos, void __user *buffer, int nob) { - char *s; - char *tmpstr; - int tmpsiz; - int idx; - int len; - int rc; - int i; + char *s; + char *tmpstr; + int tmpsiz; + int idx; + int len; + int rc; + int i; LASSERT(!write); @@ -660,11 +660,11 @@ static int proc_lnet_buffers(struct ctl_table *table, int write, static int proc_lnet_nis(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { - int tmpsiz = 128 * LNET_CPT_NUMBER; - int rc = 0; - char *tmpstr; - char *s; - int len; + int tmpsiz = 128 * LNET_CPT_NUMBER; + int rc = 0; + char *tmpstr; + char *s; + int len; LASSERT(!write); @@ -684,9 +684,9 @@ static int proc_lnet_nis(struct ctl_table *table, int write, "rtr", "max", "tx", "min"); LASSERT(tmpstr + tmpsiz - s > 0); } else { - struct list_head *n; - lnet_ni_t *ni = NULL; - int skip = *ppos - 1; + struct list_head *n; + lnet_ni_t *ni = NULL; + int skip = *ppos - 1; lnet_net_lock(0); @@ -705,12 +705,12 @@ static int proc_lnet_nis(struct ctl_table *table, int write, } if (ni != NULL) { - struct lnet_tx_queue *tq; - char *stat; - long now = get_seconds(); - int last_alive = -1; - int i; - int j; + struct lnet_tx_queue *tq; + char *stat; + long now = get_seconds(); + int last_alive = -1; + int i; + int j; if (the_lnet.ln_routing) last_alive = now - ni->ni_last_alive; @@ -777,9 +777,9 @@ static int proc_lnet_nis(struct ctl_table *table, int write, } struct lnet_portal_rotors { - int pr_value; - const char *pr_name; - const char *pr_desc; + int pr_value; + const char *pr_name; + const char *pr_desc; }; static struct lnet_portal_rotors portal_rotors[] = { @@ -815,11 +815,11 @@ extern int portal_rotor; static int __proc_lnet_portal_rotor(void *data, int write, loff_t pos, void __user *buffer, int nob) { - const int buf_len = 128; - char *buf; - char *tmp; - int rc; - int i; + const int buf_len = 128; + char *buf; + char *tmp; + int rc; + int i; LIBCFS_ALLOC(buf, buf_len); if (buf == NULL) @@ -887,38 +887,38 @@ static struct ctl_table lnet_table[] = { * to go via /proc for portability. */ { - .procname = "stats", - .mode = 0644, + .procname = "stats", + .mode = 0644, .proc_handler = &proc_lnet_stats, }, { - .procname = "routes", - .mode = 0444, + .procname = "routes", + .mode = 0444, .proc_handler = &proc_lnet_routes, }, { - .procname = "routers", - .mode = 0444, + .procname = "routers", + .mode = 0444, .proc_handler = &proc_lnet_routers, }, { - .procname = "peers", - .mode = 0444, + .procname = "peers", + .mode = 0444, .proc_handler = &proc_lnet_peers, }, { - .procname = "buffers", - .mode = 0444, + .procname = "buffers", + .mode = 0444, .proc_handler = &proc_lnet_buffers, }, { - .procname = "nis", - .mode = 0444, + .procname = "nis", + .mode = 0444, .proc_handler = &proc_lnet_nis, }, { - .procname = "portal_rotor", - .mode = 0644, + .procname = "portal_rotor", + .mode = 0644, .proc_handler = &proc_lnet_portal_rotor, }, { |