Commit 4fc29989 authored by Yajun Deng's avatar Yajun Deng Committed by David S. Miller
Browse files

net: rtnetlink: convert rcu_assign_pointer to RCU_INIT_POINTER



It no need barrier when assigning a NULL value to an RCU protected
pointer. So use RCU_INIT_POINTER() instead for more fast.

Signed-off-by: default avatarYajun Deng <yajun.deng@linux.dev>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9ce4e3d6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -301,7 +301,7 @@ int rtnl_unregister(int protocol, int msgtype)
	}

	link = rtnl_dereference(tab[msgindex]);
	rcu_assign_pointer(tab[msgindex], NULL);
	RCU_INIT_POINTER(tab[msgindex], NULL);
	rtnl_unlock();

	kfree_rcu(link, rcu);
@@ -337,7 +337,7 @@ void rtnl_unregister_all(int protocol)
		if (!link)
			continue;

		rcu_assign_pointer(tab[msgindex], NULL);
		RCU_INIT_POINTER(tab[msgindex], NULL);
		kfree_rcu(link, rcu);
	}
	rtnl_unlock();