int i;
int islo;
lnet_ni_t *ni;
+ lnet_ni_t *temp;
/*
* Now wait for the NI's I just nuked to show up on ln_zombie_nis
* and shut them down in guaranteed thread context
*/
i = 2;
- while (!list_empty(&the_lnet.ln_nis_zombie)) {
+ list_for_each_entry_safe(ni, temp, &the_lnet.ln_nis_zombie, ni_list) {
int *ref;
int j;
- ni = list_entry(the_lnet.ln_nis_zombie.next,
- lnet_ni_t, ni_list);
list_del_init(&ni->ni_list);
cfs_percpt_for_each(ref, j, ni->ni_refs) {
if (!*ref)
lnet_shutdown_lndnis(void)
{
lnet_ni_t *ni;
+ lnet_ni_t *temp;
int i;
/* NB called holding the global mutex */
the_lnet.ln_shutdown = 1; /* flag shutdown */
/* Unlink NIs from the global table */
- while (!list_empty(&the_lnet.ln_nis)) {
- ni = list_entry(the_lnet.ln_nis.next,
- lnet_ni_t, ni_list);
+ list_for_each_entry_safe(ni, temp, &the_lnet.ln_nis, ni_list) {
lnet_ni_unlink_locked(ni);
}