diff options
author | Xin Long <lucien.xin@gmail.com> | 2021-05-18 10:09:08 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-18 13:22:09 -0700 |
commit | be07f056396d6bb40963c45a02951c566ddeef8e (patch) | |
tree | 1c1d17db20a5f2977b5d796565e80ab651220855 /net/tipc/net.c | |
parent | 1dde47a66d4fb181830d6fa000e5ea86907b639e (diff) | |
download | linux-be07f056396d6bb40963c45a02951c566ddeef8e.tar.gz linux-be07f056396d6bb40963c45a02951c566ddeef8e.tar.bz2 linux-be07f056396d6bb40963c45a02951c566ddeef8e.zip |
tipc: simplify the finalize work queue
This patch is to use "struct work_struct" for the finalize work queue
instead of "struct tipc_net_work", as it can get the "net" and "addr"
from tipc_net's other members and there is no need to add extra net
and addr in tipc_net by defining "struct tipc_net_work".
Note that it's safe to get net from tn->bcl as bcl is always released
after the finalize work queue is done.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r-- | net/tipc/net.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c index a130195af188..0e95572e56b4 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -41,6 +41,7 @@ #include "socket.h" #include "node.h" #include "bcast.h" +#include "link.h" #include "netlink.h" #include "monitor.h" @@ -142,19 +143,9 @@ static void tipc_net_finalize(struct net *net, u32 addr) void tipc_net_finalize_work(struct work_struct *work) { - struct tipc_net_work *fwork; + struct tipc_net *tn = container_of(work, struct tipc_net, work); - fwork = container_of(work, struct tipc_net_work, work); - tipc_net_finalize(fwork->net, fwork->addr); -} - -void tipc_sched_net_finalize(struct net *net, u32 addr) -{ - struct tipc_net *tn = tipc_net(net); - - tn->final_work.net = net; - tn->final_work.addr = addr; - schedule_work(&tn->final_work.work); + tipc_net_finalize(tipc_link_net(tn->bcl), tn->trial_addr); } void tipc_net_stop(struct net *net) |