Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-13210 lnet: gcc8 add implicit-fallthrough decorator
[fs/lustre-release.git]
/
lnet
/
lnet
/
net_fault.c
diff --git
a/lnet/lnet/net_fault.c
b/lnet/lnet/net_fault.c
index
4f1bc30
..
56365fd
100644
(file)
--- a/
lnet/lnet/net_fault.c
+++ b/
lnet/lnet/net_fault.c
@@
-202,12
+202,10
@@
lnet_drop_rule_del(lnet_nid_t src, lnet_nid_t dst)
{
struct lnet_drop_rule *rule;
struct lnet_drop_rule *tmp;
-
struct list_head zombies
;
- int
n = 0;
+
LIST_HEAD(zombies)
;
+ int n = 0;
ENTRY;
- INIT_LIST_HEAD(&zombies);
-
lnet_net_lock(LNET_LOCK_EX);
list_for_each_entry_safe(rule, tmp, &the_lnet.ln_drop_rules, dr_link) {
if (rule->dr_attr.fa_src != src && src != 0)
@@
-487,8
+485,8
@@
struct lnet_delay_rule {
time64_t dl_delay_time;
/** baseline to caculate dl_delay_time */
time64_t dl_time_base;
- /**
jiffies to
send the next delayed message */
-
unsigned long
dl_msg_send;
+ /**
seconds until we
send the next delayed message */
+
time64_t
dl_msg_send;
/** delayed message list */
struct list_head dl_msg_list;
/** statistic of delayed messages */
@@
-593,7
+591,8
@@
delay_rule_match(struct lnet_delay_rule *rule, lnet_nid_t src,
msg->msg_delay_send = ktime_get_seconds() + attr->u.delay.la_latency;
if (rule->dl_msg_send == -1) {
rule->dl_msg_send = msg->msg_delay_send;
- mod_timer(&rule->dl_timer, rule->dl_msg_send);
+ mod_timer(&rule->dl_timer,
+ jiffies + cfs_time_seconds(rule->dl_msg_send));
}
spin_unlock(&rule->dl_lock);
@@
-661,7
+660,8
@@
delayed_msg_check(struct lnet_delay_rule *rule, bool all,
msg = list_entry(rule->dl_msg_list.next,
struct lnet_msg, msg_list);
rule->dl_msg_send = msg->msg_delay_send;
- mod_timer(&rule->dl_timer, rule->dl_msg_send);
+ mod_timer(&rule->dl_timer,
+ jiffies + cfs_time_seconds(rule->dl_msg_send));
}
spin_unlock(&rule->dl_lock);
}
@@
-701,6
+701,7
@@
delayed_msg_process(struct list_head *msg_list, bool drop)
case LNET_CREDIT_OK:
lnet_ni_recv(ni, msg->msg_private, msg, 0,
0, msg->msg_len, msg->msg_len);
+ /* fallthrough */
case LNET_CREDIT_WAIT:
continue;
default: /* failures */
@@
-721,10
+722,9
@@
delayed_msg_process(struct list_head *msg_list, bool drop)
void
lnet_delay_rule_check(void)
{
- struct lnet_delay_rule
*rule;
-
struct list_head msgs
;
+ struct lnet_delay_rule *rule;
+
LIST_HEAD(msgs)
;
- INIT_LIST_HEAD(&msgs);
while (1) {
if (list_empty(&delay_dd.dd_sched_rules))
break;
@@
-886,16
+886,13
@@
int
lnet_delay_rule_del(lnet_nid_t src, lnet_nid_t dst, bool shutdown)
{
struct lnet_delay_rule *rule;
- struct lnet_delay_rule
*tmp;
-
struct list_head rule_list
;
-
struct list_head msg_list
;
- int
n = 0;
- bool
cleanup;
+ struct lnet_delay_rule *tmp;
+
LIST_HEAD(rule_list)
;
+
LIST_HEAD(msg_list)
;
+ int n = 0;
+ bool cleanup;
ENTRY;
- INIT_LIST_HEAD(&rule_list);
- INIT_LIST_HEAD(&msg_list);
-
if (shutdown)
src = dst = 0;
@@
-1078,10
+1075,10
@@
lnet_fault_ctl(int opc, struct libcfs_ioctl_data *data)
int
lnet_fault_init(void)
{
-
CLASSERT(LNET_PUT_BIT =
= 1 << LNET_MSG_PUT);
-
CLASSERT(LNET_ACK_BIT =
= 1 << LNET_MSG_ACK);
-
CLASSERT(LNET_GET_BIT =
= 1 << LNET_MSG_GET);
-
CLASSERT(LNET_REPLY_BIT =
= 1 << LNET_MSG_REPLY);
+
BUILD_BUG_ON(LNET_PUT_BIT !
= 1 << LNET_MSG_PUT);
+
BUILD_BUG_ON(LNET_ACK_BIT !
= 1 << LNET_MSG_ACK);
+
BUILD_BUG_ON(LNET_GET_BIT !
= 1 << LNET_MSG_GET);
+
BUILD_BUG_ON(LNET_REPLY_BIT !
= 1 << LNET_MSG_REPLY);
mutex_init(&delay_dd.dd_mutex);
spin_lock_init(&delay_dd.dd_lock);