mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Match Linux behaviour and iterate the IDR tree unlocked. The caller is
responsible the IDR tree stays unmodified while iterating. MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
30de20448d
commit
dacb734ea8
1 changed files with 2 additions and 6 deletions
|
|
@ -593,15 +593,11 @@ idr_for_each_layer(struct idr_layer *il, int layer,
|
|||
return (0);
|
||||
}
|
||||
|
||||
/* NOTE: It is not allowed to modify the IDR tree while it is being iterated */
|
||||
int
|
||||
idr_for_each(struct idr *idp, int (*f)(int id, void *p, void *data), void *data)
|
||||
{
|
||||
int err;
|
||||
|
||||
mtx_lock(&idp->lock);
|
||||
err = idr_for_each_layer(idp->top, idp->layers - 1, f, data);
|
||||
mtx_unlock(&idp->lock);
|
||||
return (err);
|
||||
return (idr_for_each_layer(idp->top, idp->layers - 1, f, data));
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Reference in a new issue