int psmx_wait_wait(struct fid_wait *wait, int timeout) { struct psmx_fid_wait *wait_priv; int err = 0; wait_priv = container_of(wait, struct psmx_fid_wait, wait.fid); psmx_wait_start_progress(wait_priv->fabric->active_domain); switch (wait_priv->type) { case FI_WAIT_UNSPEC: /* TODO: optimized custom wait */ break; case FI_WAIT_FD: err = fi_poll_fd(wait_priv->fd[0], timeout); if (err > 0) err = 0; else if (err == 0) err = -FI_ETIMEDOUT; break; case FI_WAIT_MUTEX_COND: err = fi_wait_cond(&wait_priv->cond, &wait_priv->mutex, timeout); break; default: break; } psmx_wait_stop_progress(); return err; }
static int psmx_wait_wait(struct fid_wait *wait, int timeout) { struct util_wait *wait_priv; struct psmx_fid_fabric *fabric; int err; wait_priv = container_of(wait, struct util_wait, wait_fid); fabric = container_of(wait_priv->fabric, struct psmx_fid_fabric, util_fabric); psmx_wait_start_progress(fabric->active_domain); err = psmx_wait_ops_save->wait(wait, timeout); psmx_wait_stop_progress(); return err; }