]> git.baikalelectronics.ru Git - kernel.git/commit
net-sysfs: move the rtnl unlock up in the xps show helpers
authorAntoine Tenart <atenart@kernel.org>
Thu, 18 Mar 2021 18:37:49 +0000 (19:37 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Mar 2021 21:56:22 +0000 (14:56 -0700)
commit6cc6ddd0f3addffd3a9c7f8a5c0eb46e75c76ad0
treeb7711f58915ba8992b995d2be1ac8001c6215c6d
parent7ba0bcd38f3c3be5b6c8e6ac069639c64efbda1d
net-sysfs: move the rtnl unlock up in the xps show helpers

Now that nr_ids and num_tc are stored in the xps dev_maps, which are RCU
protected, we do not have the need to protect the maps in the rtnl lock.
Move the rtnl unlock up so we reduce the rtnl locking section.

We also increase the reference count on the subordinate device if any,
as we don't want this device to be freed while we use it (now that the
rtnl lock isn't protecting it in the whole function).

Signed-off-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net-sysfs.c