FreeBSD/sys/dev/isci/scil/sci_abstract_list.c
/**
 * This method will erase (remove) all instances of the supplied object from
 * anywhere in the list.
 */
This method will erase (remove) all instances of the supplied object from
anywhere in the list.
This method will erase ( remove ) all instances of the supplied object from anywhere in the list .
void sci_abstract_list_erase(
   SCI_ABSTRACT_LIST_T * list_p,
   void * obj_p
)
{
   SCI_ABSTRACT_ELEMENT_LIST_T * elem_list = &(list_p)->elements;
   SCI_ABSTRACT_ELEMENT_T      * alElement_p;
   while ((alElement_p = private_find(elem_list, (obj_p))) != NULL)
   {
      if (alElement_p == elem_list->front_p)
      {
         sci_abstract_list_popfront(list_p);
      }
      else if (alElement_p == elem_list->back_p)
      {
         sci_abstract_list_popback(list_p);
      }
      else
      {
         alElement_p->previous_p->next_p = alElement_p->next_p;
         alElement_p->next_p->previous_p = alElement_p->previous_p;
         elem_list->size--;
         private_pool_free((list_p)->free_pool, alElement_p);
      }
   }
   return;
}
void sci_abstract_list_erase ( SCI_ABSTRACT_LIST_T * list_p , void * obj_p ) { SCI_ABSTRACT_ELEMENT_LIST_T * elem_list = & ( list_p ) -> elements ; SCI_ABSTRACT_ELEMENT_T * alElement_p ; while ( ( alElement_p = private_find ( elem_list , ( obj_p ) ) ) != NULL ) { if ( alElement_p == elem_list -> front_p ) { sci_abstract_list_popfront ( list_p ) ; } else if ( alElement_p == elem_list -> back_p ) { sci_abstract_list_popback ( list_p ) ; } else { alElement_p -> previous_p -> next_p = alElement_p -> next_p ; alElement_p -> next_p -> previous_p = alElement_p -> previous_p ; elem_list -> size -- ; private_pool_free ( ( list_p ) -> free_pool , alElement_p ) ; } } return ; }
This method will erase (remove) all instances of the supplied object from
 anywhere in the list.
This method will erase ( remove ) all instances of the supplied object from anywhere in the list .