!lnet_fault_nid_match(attr->fa_local_nid, local_nid))
return false;
- if (!(attr->fa_msg_mask & (1 << type)))
+ if (!(attr->fa_msg_mask & BIT(type)))
return false;
/* NB: ACK and REPLY have no portal, but they should have been
{
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)
return;
}
- if (mask & (1 << choice)) {
+ if (mask & BIT(choice)) {
*hstatus = choice;
return;
}
i = HSTATUS_END;
best_delta = HSTATUS_END;
while (i > 0) {
- if (mask & (1 << i)) {
+ if (mask & BIT(i)) {
delta = choice - i;
if (delta < 0)
delta *= -1;
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 */
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;
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;
int
lnet_fault_init(void)
{
- 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);
+ BUILD_BUG_ON(LNET_PUT_BIT != BIT(LNET_MSG_PUT));
+ BUILD_BUG_ON(LNET_ACK_BIT != BIT(LNET_MSG_ACK));
+ BUILD_BUG_ON(LNET_GET_BIT != BIT(LNET_MSG_GET));
+ BUILD_BUG_ON(LNET_REPLY_BIT != BIT(LNET_MSG_REPLY));
mutex_init(&delay_dd.dd_mutex);
spin_lock_init(&delay_dd.dd_lock);