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:
Hans Petter Selasky 2016-05-11 17:20:20 +00:00
parent 30de20448d
commit dacb734ea8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299469

View File

@ -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