plugins/nbd/nbd.c
/* Find and remove the transaction corresponding to cookie from the list. */
Find and remove the transaction corresponding to cookie from the list.
Find and remove the transaction corresponding to cookie from the list .
static struct transaction *
find_trans_by_cookie (struct handle *h, uint64_t cookie)
{
  struct transaction **ptr;
  struct transaction *trans;
  nbd_lock (h);
  ptr = &h->trans;
  while ((trans = *ptr) != NULL) {
    if (cookie == trans->u.cookie)
      break;
    ptr = &trans->next;
  }
  if (trans)
    *ptr = trans->next;
  nbd_unlock (h);
  return trans;
}
static struct transaction * find_trans_by_cookie ( struct handle * h , uint64_t cookie ) { struct transaction * * ptr ; struct transaction * trans ; nbd_lock ( h ) ; ptr = & h -> trans ; while ( ( trans = * ptr ) != NULL ) { if ( cookie == trans -> u . cookie ) break ; ptr = & trans -> next ; } if ( trans ) * ptr = trans -> next ; nbd_unlock ( h ) ; return trans ; }
Find and remove the transaction corresponding to cookie from the list.
Find and remove the transaction corresponding to cookie from the list .