mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
[RTNETLINK]: Remove unnecessary locking in dump callbacks
Since we're now holding the rtnl during the entire dump operation, we can remove additional locking for rtnl protected data. This patch does that for all simple cases (dev_base_lock for dev_base walking, RCU protection for FIB rule dumping). Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1c2d670f36
commit
6313c1e099
6 changed files with 3 additions and 22 deletions
|
@ -543,7 +543,6 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
|
|||
int s_idx = cb->args[0];
|
||||
struct net_device *dev;
|
||||
|
||||
read_lock(&dev_base_lock);
|
||||
for (dev=dev_base, idx=0; dev; dev = dev->next, idx++) {
|
||||
if (idx < s_idx)
|
||||
continue;
|
||||
|
@ -552,7 +551,6 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
|
|||
cb->nlh->nlmsg_seq, 0, NLM_F_MULTI) <= 0)
|
||||
break;
|
||||
}
|
||||
read_unlock(&dev_base_lock);
|
||||
cb->args[0] = idx;
|
||||
|
||||
return skb->len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue