mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
net: netpoll: extract core of netpoll_cleanup
Extract the core part of netpoll_cleanup(), so, it could be called from a caller that has the rtnl lock already. Netconsole uses this in a weird way right now: __netpoll_cleanup(&nt->np); spin_lock_irqsave(&target_list_lock, flags); netdev_put(nt->np.dev, &nt->np.dev_tracker); nt->np.dev = NULL; nt->enabled = false; This will be replaced by do_netpoll_cleanup() as the locking situation is overhauled. Signed-off-by: Breno Leitao <leitao@debian.org> Reviewed-by: Rik van Riel <riel@surriel.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
2bbf1aedd6
commit
1ef33652d2
@ -64,6 +64,7 @@ int netpoll_setup(struct netpoll *np);
|
||||
void __netpoll_cleanup(struct netpoll *np);
|
||||
void __netpoll_free(struct netpoll *np);
|
||||
void netpoll_cleanup(struct netpoll *np);
|
||||
void do_netpoll_cleanup(struct netpoll *np);
|
||||
netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
|
||||
|
||||
#ifdef CONFIG_NETPOLL
|
||||
|
@ -853,14 +853,20 @@ void __netpoll_free(struct netpoll *np)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__netpoll_free);
|
||||
|
||||
void do_netpoll_cleanup(struct netpoll *np)
|
||||
{
|
||||
__netpoll_cleanup(np);
|
||||
netdev_put(np->dev, &np->dev_tracker);
|
||||
np->dev = NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(do_netpoll_cleanup);
|
||||
|
||||
void netpoll_cleanup(struct netpoll *np)
|
||||
{
|
||||
rtnl_lock();
|
||||
if (!np->dev)
|
||||
goto out;
|
||||
__netpoll_cleanup(np);
|
||||
netdev_put(np->dev, &np->dev_tracker);
|
||||
np->dev = NULL;
|
||||
do_netpoll_cleanup(np);
|
||||
out:
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user