Lines Matching defs:anchor
901 struct cl_sync_io *anchor = &cl_env_info(env)->clt_anchor;
907 pg->cp_sync_io = anchor;
910 cl_sync_io_init(anchor, queue->c2_qin.pl_nr);
921 cl_sync_io_note(anchor, +1);
926 anchor, timeout);
1596 * Initialize synchronous io wait anchor, for transfer of \a nrpages pages.
1598 void cl_sync_io_init(struct cl_sync_io *anchor, int nrpages)
1600 init_waitqueue_head(&anchor->csi_waitq);
1601 atomic_set(&anchor->csi_sync_nr, nrpages);
1602 atomic_set(&anchor->csi_barrier, nrpages > 0);
1603 anchor->csi_sync_rc = 0;
1612 struct cl_page_list *queue, struct cl_sync_io *anchor,
1621 rc = l_wait_event(anchor->csi_waitq,
1622 atomic_read(&anchor->csi_sync_nr) == 0,
1627 rc, atomic_read(&anchor->csi_sync_nr));
1632 (void)l_wait_event(anchor->csi_waitq,
1633 atomic_read(&anchor->csi_sync_nr) == 0,
1636 rc = anchor->csi_sync_rc;
1638 LASSERT(atomic_read(&anchor->csi_sync_nr) == 0);
1642 while (unlikely(atomic_read(&anchor->csi_barrier) != 0)) {
1646 POISON(anchor, 0x5a, sizeof(*anchor));
1654 void cl_sync_io_note(struct cl_sync_io *anchor, int ioret)
1656 if (anchor->csi_sync_rc == 0 && ioret < 0)
1657 anchor->csi_sync_rc = ioret;
1663 LASSERT(atomic_read(&anchor->csi_sync_nr) > 0);
1664 if (atomic_dec_and_test(&anchor->csi_sync_nr)) {
1665 wake_up_all(&anchor->csi_waitq);
1666 /* it's safe to nuke or reuse anchor now */
1667 atomic_set(&anchor->csi_barrier, 0);