Lines Matching refs:spc

137 send_with_recon(struct spclient *spc, struct iovec *iov, size_t iovlen)  in send_with_recon()  argument
145 rv = dosend(spc, iov, iovlen); in send_with_recon()
220 cliwaitresp(struct spclient *spc, struct respwait *rw, sigset_t *mask, in cliwaitresp() argument
226 pthread_mutex_lock(&spc->spc_mtx); in cliwaitresp()
228 sendunlockl(spc); in cliwaitresp()
229 mygen = spc->spc_generation; in cliwaitresp()
233 if (__predict_false(spc->spc_generation != mygen || !imalive)) in cliwaitresp()
237 if (spc->spc_istatus == SPCSTATUS_FREE) { in cliwaitresp()
240 spc->spc_istatus = SPCSTATUS_BUSY; in cliwaitresp()
241 pthread_mutex_unlock(&spc->spc_mtx); in cliwaitresp()
298 switch (readframe(spc)) { in cliwaitresp()
309 switch (spc->spc_hdr.rsp_class) { in cliwaitresp()
312 kickwaiter(spc); in cliwaitresp()
313 gotresp = spc->spc_hdr.rsp_reqno == in cliwaitresp()
317 handlereq(spc); in cliwaitresp()
326 pthread_mutex_lock(&spc->spc_mtx); in cliwaitresp()
327 if (spc->spc_istatus == SPCSTATUS_WANTED) in cliwaitresp()
328 kickall(spc); in cliwaitresp()
329 spc->spc_istatus = SPCSTATUS_FREE; in cliwaitresp()
333 pthread_mutex_unlock(&spc->spc_mtx); in cliwaitresp()
336 pthread_mutex_lock(&spc->spc_mtx); in cliwaitresp()
339 spc->spc_istatus = SPCSTATUS_WANTED; in cliwaitresp()
340 pthread_cond_wait(&rw->rw_cv, &spc->spc_mtx); in cliwaitresp()
343 TAILQ_REMOVE(&spc->spc_respwait, rw, rw_entries); in cliwaitresp()
344 pthread_mutex_unlock(&spc->spc_mtx); in cliwaitresp()
347 if (spc->spc_generation != mygen || !imalive) { in cliwaitresp()
354 syscall_req(struct spclient *spc, sigset_t *omask, int sysnum, in syscall_req() argument
371 putwait(spc, &rw, &rhdr); in syscall_req()
372 if ((rv = send_with_recon(spc, iov, __arraycount(iov))) != 0) { in syscall_req()
373 unputwait(spc, &rw); in syscall_req()
377 rv = cliwaitresp(spc, &rw, omask, false); in syscall_req()
387 handshake_req(struct spclient *spc, int type, void *data, in handshake_req() argument
439 putwait_locked(spc, &rw, &rhdr); in handshake_req()
441 putwait(spc, &rw, &rhdr); in handshake_req()
449 rv = send_with_recon(spc, iov, __arraycount(iov)); in handshake_req()
452 unputwait_locked(spc, &rw); in handshake_req()
454 unputwait(spc, &rw); in handshake_req()
459 rv = cliwaitresp(spc, &rw, &omask, haslock); in handshake_req()
473 prefork_req(struct spclient *spc, sigset_t *omask, void **resp) in prefork_req() argument
488 putwait(spc, &rw, &rhdr); in prefork_req()
489 rv = send_with_recon(spc, iov, __arraycount(iov)); in prefork_req()
491 unputwait(spc, &rw); in prefork_req()
495 rv = cliwaitresp(spc, &rw, omask, false); in prefork_req()
508 resp_sendlock(struct spclient *spc) in resp_sendlock() argument
512 pthread_mutex_lock(&spc->spc_mtx); in resp_sendlock()
513 while (spc->spc_ostatus != SPCSTATUS_FREE) { in resp_sendlock()
514 if (__predict_false(spc->spc_reconnecting)) { in resp_sendlock()
518 spc->spc_ostatus = SPCSTATUS_WANTED; in resp_sendlock()
519 pthread_cond_wait(&spc->spc_cv, &spc->spc_mtx); in resp_sendlock()
521 spc->spc_ostatus = SPCSTATUS_BUSY; in resp_sendlock()
524 pthread_mutex_unlock(&spc->spc_mtx); in resp_sendlock()
529 send_copyin_resp(struct spclient *spc, uint64_t reqno, void *data, size_t dlen, in send_copyin_resp() argument
547 if (resp_sendlock(spc) != 0) in send_copyin_resp()
549 (void)SENDIOV(spc, iov); in send_copyin_resp()
550 sendunlock(spc); in send_copyin_resp()
554 send_anonmmap_resp(struct spclient *spc, uint64_t reqno, void *addr) in send_anonmmap_resp() argument
568 if (resp_sendlock(spc) != 0) in send_anonmmap_resp()
570 (void)SENDIOV(spc, iov); in send_anonmmap_resp()
571 sendunlock(spc); in send_anonmmap_resp()
607 handlereq(struct spclient *spc) in handlereq() argument
610 struct rsp_hdr *rhdr = &spc->spc_hdr; in handlereq()
613 int reqtype = spc->spc_hdr.rsp_type; in handlereq()
620 copydata = (struct rsp_copydata *)spc->spc_buf; in handlereq()
623 send_copyin_resp(spc, spc->spc_hdr.rsp_reqno, in handlereq()
630 copydata = (struct rsp_copydata *)spc->spc_buf; in handlereq()
639 maplen = *(size_t *)spc->spc_buf; in handlereq()
645 send_anonmmap_resp(spc, spc->spc_hdr.rsp_reqno, mapaddr); in handlereq()
662 spcfreebuf(spc); in handlereq()