mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
sfc: Assert filter_sem write locked when required
Based on a patch by Andrew Rybchenko <Andrew.Rybchenko@oktetlabs.ru> Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ebfcd0fd90
commit
dd98708cf6
2 changed files with 24 additions and 1 deletions
|
@ -274,4 +274,13 @@ static inline void efx_device_detach_sync(struct efx_nic *efx)
|
|||
netif_tx_unlock_bh(dev);
|
||||
}
|
||||
|
||||
static inline bool efx_rwsem_assert_write_locked(struct rw_semaphore *sem)
|
||||
{
|
||||
if (WARN_ON(down_read_trylock(sem))) {
|
||||
up_read(sem);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* EFX_EFX_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue