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>
This commit is contained in:
committed by
David S. Miller
parent
43608edc2d
commit
b274f4ab8e
@@ -467,6 +467,18 @@ int tipc_bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tipc_bearer_congested - determines if bearer is currently congested
|
||||||
|
*/
|
||||||
|
|
||||||
|
int tipc_bearer_congested(struct bearer *b_ptr, struct link *l_ptr)
|
||||||
|
{
|
||||||
|
if (unlikely(b_ptr->publ.blocked))
|
||||||
|
return 1;
|
||||||
|
if (likely(list_empty(&b_ptr->cong_links)))
|
||||||
|
return 0;
|
||||||
|
return !tipc_bearer_resolve_congestion(b_ptr, l_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tipc_enable_bearer - enable bearer with the given name
|
* tipc_enable_bearer - enable bearer with the given name
|
||||||
|
@@ -125,6 +125,7 @@ void tipc_bearer_remove_dest(struct bearer *b_ptr, u32 dest);
|
|||||||
void tipc_bearer_schedule(struct bearer *b_ptr, struct link *l_ptr);
|
void tipc_bearer_schedule(struct bearer *b_ptr, struct link *l_ptr);
|
||||||
struct bearer *tipc_bearer_find_interface(const char *if_name);
|
struct bearer *tipc_bearer_find_interface(const char *if_name);
|
||||||
int tipc_bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr);
|
int tipc_bearer_resolve_congestion(struct bearer *b_ptr, struct link *l_ptr);
|
||||||
|
int tipc_bearer_congested(struct bearer *b_ptr, struct link *l_ptr);
|
||||||
int tipc_bearer_init(void);
|
int tipc_bearer_init(void);
|
||||||
void tipc_bearer_stop(void);
|
void tipc_bearer_stop(void);
|
||||||
void tipc_bearer_lock_push(struct bearer *b_ptr);
|
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,
|
|||||||
return !b_ptr->media->send_msg(buf, &b_ptr->publ, dest);
|
return !b_ptr->media->send_msg(buf, &b_ptr->publ, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#endif /* _TIPC_BEARER_H */
|
||||||
* tipc_bearer_congested - determines if bearer is currently congested
|
|
||||||
*/
|
|
||||||
|
|
||||||
static inline int tipc_bearer_congested(struct bearer *b_ptr, struct link *l_ptr)
|
|
||||||
{
|
|
||||||
if (unlikely(b_ptr->publ.blocked))
|
|
||||||
return 1;
|
|
||||||
if (likely(list_empty(&b_ptr->cong_links)))
|
|
||||||
return 0;
|
|
||||||
return !tipc_bearer_resolve_congestion(b_ptr, l_ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
Reference in New Issue
Block a user