mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
devlink: add instance lock assertion in devl_is_registered()
After region and linecard lock removals, this helper is always supposed to be called with instance lock held. So put the assertion here and remove the comment which is no longer accurate. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
543753d9e2
commit
63ba54a52c
1 changed files with 1 additions and 3 deletions
|
@ -85,9 +85,7 @@ struct devlink *devlinks_xa_find_get(struct net *net, unsigned long *indexp);
|
|||
|
||||
static inline bool devl_is_registered(struct devlink *devlink)
|
||||
{
|
||||
/* To prevent races the caller must hold the instance lock
|
||||
* or another lock taken during unregistration.
|
||||
*/
|
||||
devl_assert_locked(devlink);
|
||||
return xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue