diff options
Diffstat (limited to 'net/tipc/bearer.c')
-rw-r--r-- | net/tipc/bearer.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 78091375ca12..52ae17b2583e 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -467,6 +467,18 @@ int tipc_bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr) | |||
467 | return res; | 467 | return res; |
468 | } | 468 | } |
469 | 469 | ||
470 | /** | ||
471 | * tipc_bearer_congested - determines if bearer is currently congested | ||
472 | */ | ||
473 | |||
474 | int tipc_bearer_congested(struct bearer *b_ptr, struct link *l_ptr) | ||
475 | { | ||
476 | if (unlikely(b_ptr->publ.blocked)) | ||
477 | return 1; | ||
478 | if (likely(list_empty(&b_ptr->cong_links))) | ||
479 | return 0; | ||
480 | return !tipc_bearer_resolve_congestion(b_ptr, l_ptr); | ||
481 | } | ||
470 | 482 | ||
471 | /** | 483 | /** |
472 | * tipc_enable_bearer - enable bearer with the given name | 484 | * tipc_enable_bearer - enable bearer with the given name |
@@ -493,7 +505,7 @@ int tipc_enable_bearer(const char *name, u32 bcast_scope, u32 priority) | |||
493 | return -EINVAL; | 505 | return -EINVAL; |
494 | } | 506 | } |
495 | if (!tipc_addr_domain_valid(bcast_scope) || | 507 | if (!tipc_addr_domain_valid(bcast_scope) || |
496 | !in_scope(bcast_scope, tipc_own_addr)) { | 508 | !tipc_in_scope(bcast_scope, tipc_own_addr)) { |
497 | warn("Bearer <%s> rejected, illegal broadcast scope\n", name); | 509 | warn("Bearer <%s> rejected, illegal broadcast scope\n", name); |
498 | return -EINVAL; | 510 | return -EINVAL; |
499 | } | 511 | } |
@@ -571,7 +583,7 @@ restart: | |||
571 | spin_lock_init(&b_ptr->publ.lock); | 583 | spin_lock_init(&b_ptr->publ.lock); |
572 | write_unlock_bh(&tipc_net_lock); | 584 | write_unlock_bh(&tipc_net_lock); |
573 | info("Enabled bearer <%s>, discovery domain %s, priority %u\n", | 585 | info("Enabled bearer <%s>, discovery domain %s, priority %u\n", |
574 | name, addr_string_fill(addr_string, bcast_scope), priority); | 586 | name, tipc_addr_string_fill(addr_string, bcast_scope), priority); |
575 | return 0; | 587 | return 0; |
576 | failed: | 588 | failed: |
577 | write_unlock_bh(&tipc_net_lock); | 589 | write_unlock_bh(&tipc_net_lock); |