diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2010-05-11 10:30:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-13 02:02:28 -0400 |
commit | b274f4ab8e674db1757371a21e7217e0766cb574 (patch) | |
tree | fec9504a6f3e617c4df0f0281067e68a72464949 /net/tipc | |
parent | 43608edc2dbe83057544cf76b765ecdf63d59e8c (diff) |
tipc: Reduce footprint by un-inlining bearer congestion routine
Convert bearer congestion inline routine that is more than one line into
a standard function, thereby eliminating some repeated code.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bearer.c | 12 | ||||
-rw-r--r-- | net/tipc/bearer.h | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index ccec12f0ccc9..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 |
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 000228e93f9e..a850b389663e 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
@@ -125,6 +125,7 @@ void tipc_bearer_remove_dest(struct bearer *b_ptr, u32 dest); | |||
125 | void tipc_bearer_schedule(struct bearer *b_ptr, struct link *l_ptr); | 125 | void tipc_bearer_schedule(struct bearer *b_ptr, struct link *l_ptr); |
126 | struct bearer *tipc_bearer_find_interface(const char *if_name); | 126 | struct bearer *tipc_bearer_find_interface(const char *if_name); |
127 | int tipc_bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr); | 127 | int tipc_bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr); |
128 | int tipc_bearer_congested(struct bearer *b_ptr, struct link *l_ptr); | ||
128 | int tipc_bearer_init(void); | 129 | int tipc_bearer_init(void); |
129 | void tipc_bearer_stop(void); | 130 | void tipc_bearer_stop(void); |
130 | void tipc_bearer_lock_push(struct bearer *b_ptr); | 131 | void tipc_bearer_lock_push(struct bearer *b_ptr); |
@@ -154,17 +155,4 @@ static inline int tipc_bearer_send(struct bearer *b_ptr, struct sk_buff *buf, | |||
154 | return !b_ptr->media->send_msg(buf, &b_ptr->publ, dest); | 155 | return !b_ptr->media->send_msg(buf, &b_ptr->publ, dest); |
155 | } | 156 | } |
156 | 157 | ||
157 | /** | 158 | #endif /* _TIPC_BEARER_H */ |
158 | * tipc_bearer_congested - determines if bearer is currently congested | ||
159 | */ | ||
160 | |||
161 | static inline int tipc_bearer_congested(struct bearer *b_ptr, struct link *l_ptr) | ||
162 | { | ||
163 | if (unlikely(b_ptr->publ.blocked)) | ||
164 | return 1; | ||
165 | if (likely(list_empty(&b_ptr->cong_links))) | ||
166 | return 0; | ||
167 | return !tipc_bearer_resolve_congestion(b_ptr, l_ptr); | ||
168 | } | ||
169 | |||
170 | #endif | ||