summaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorYing Xue2014-02-13 23:29:06 +0100
committerDavid S. Miller2014-02-13 23:57:05 +0100
commite0ca2c30b1e9c1ed8b58bccb95c33d25763a4311 (patch)
tree2f59736a810a5ca9493a2d2648caaafdf1857874 /net/tipc/link.c
parenttipc: stricter behavior of message reassembly function (diff)
downloadkernel-qcow2-linux-e0ca2c30b1e9c1ed8b58bccb95c33d25763a4311.tar.gz
kernel-qcow2-linux-e0ca2c30b1e9c1ed8b58bccb95c33d25763a4311.tar.xz
kernel-qcow2-linux-e0ca2c30b1e9c1ed8b58bccb95c33d25763a4311.zip
tipc: move code for resetting links from bearer.c to link.c
We break out the code for resetting attached links in the function tipc_reset_bearer(), and define a new function named tipc_link_reset_list() to do this job. This commit incurs no functional changes, but makes the code of function tipc_reset_bearer() cleaner. It is also a preparation for a more important change to the bearer code, in a subsequent commit in this series. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 17fbd15fcad8..3ff34e8a37d7 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -461,6 +461,18 @@ void tipc_link_reset(struct tipc_link *l_ptr)
link_reset_statistics(l_ptr);
}
+void tipc_link_reset_list(struct tipc_bearer *b_ptr)
+{
+ struct tipc_link *l_ptr;
+
+ list_for_each_entry(l_ptr, &b_ptr->links, link_list) {
+ struct tipc_node *n_ptr = l_ptr->owner;
+
+ spin_lock_bh(&n_ptr->lock);
+ tipc_link_reset(l_ptr);
+ spin_unlock_bh(&n_ptr->lock);
+ }
+}
static void link_activate(struct tipc_link *l_ptr)
{