Lines Matching refs:head
229 aio_lio_t *_lio_head_freelist = NULL; /* free list of lio head structures */
237 * Allocate a listio head structure.
242 aio_lio_t *head;
249 if ((head = _lio_head_freelist) == NULL) {
259 for (i = 0, head = _lio_head_freelist; i < nelem; i++, head++)
260 head->lio_next = head + 1;
261 _lio_head_freelast = head - 1;
265 head = _lio_head_freelist;
267 if ((_lio_head_freelist = head->lio_next) == NULL)
272 ASSERT(head->lio_nent == 0 && head->lio_refcnt == 0);
273 head->lio_next = NULL;
274 head->lio_port = -1;
275 (void) mutex_init(&head->lio_mutex, USYNC_THREAD, NULL);
276 (void) cond_init(&head->lio_cond_cv, USYNC_THREAD, NULL);
278 return (head);
282 * Free a listio head structure.
285 _aio_lio_free(aio_lio_t *head)
287 ASSERT(head->lio_nent == 0 && head->lio_refcnt == 0);
288 (void) mutex_destroy(&head->lio_mutex);
289 (void) cond_destroy(&head->lio_cond_cv);
290 (void) memset(head, 0, sizeof (*head));
294 _lio_head_freelist = _lio_head_freelast = head;
296 _lio_head_freelast->lio_next = head;
297 _lio_head_freelast = head;