mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
inet: prepare inet_base_seq() to run without RTNL
In the following patch, inet_base_seq() will no longer be called with RTNL held. Add READ_ONCE()/WRITE_ONCE() annotations in dev_base_seq_inc() and inet_base_seq(). Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3ddc2231c8
commit
590e92cdc8
@@ -180,8 +180,9 @@ static DECLARE_RWSEM(devnet_rename_sem);
|
||||
|
||||
static inline void dev_base_seq_inc(struct net *net)
|
||||
{
|
||||
while (++net->dev_base_seq == 0)
|
||||
;
|
||||
unsigned int val = net->dev_base_seq + 1;
|
||||
|
||||
WRITE_ONCE(net->dev_base_seq, val ?: 1);
|
||||
}
|
||||
|
||||
static inline struct hlist_head *dev_name_hash(struct net *net, const char *name)
|
||||
|
||||
Reference in New Issue
Block a user