summaryrefslogtreecommitdiff
path: root/lib9p/srv.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-15 08:42:24 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-15 08:42:24 -0600
commit802ed1e3cd0252cafd1be2aada0addf4d3f7eb2e (patch)
tree70f49ed30f0f9839709a093c6af54661eeaad4ee /lib9p/srv.c
parent0450e14b3a86e4448537c03253eeebf509f8909e (diff)
parent32a1b710b40ce9d53cd0a7bc0c183da87e07f397 (diff)
Merge branch 'lukeshu/generics'
Diffstat (limited to 'lib9p/srv.c')
-rw-r--r--lib9p/srv.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c
index 7e2bab0..dae73ea 100644
--- a/lib9p/srv.c
+++ b/lib9p/srv.c
@@ -45,14 +45,14 @@ static_assert(CONFIG_9P_SRV_MAX_HOSTMSG_SIZE <= SSIZE_MAX);
bool lib9p_srv_flush_requested(struct lib9p_srv_ctx *ctx) {
assert(ctx);
- return _lib9p_srv_flushch_can_send(&ctx->flushch);
+ return cr_chan_can_send(&ctx->flushch);
}
void lib9p_srv_acknowledge_flush(struct lib9p_srv_ctx *ctx) {
assert(ctx);
- assert(_lib9p_srv_flushch_can_send(&ctx->flushch));
+ assert(cr_chan_can_send(&ctx->flushch));
lib9p_error(&ctx->basectx, LIB9P_ERRNO_L_ECANCELED, "request canceled by flush");
- _lib9p_srv_flushch_send(&ctx->flushch, true);
+ cr_chan_send(&ctx->flushch, true);
}
/* structs ********************************************************************/
@@ -443,7 +443,7 @@ void lib9p_srv_accept_and_read_loop(struct lib9p_srv *srv, lo_interface net_stre
srv->readers--;
if (srv->readers == 0)
while (srv->writers > 0)
- _lib9p_srv_reqch_send_req(&srv->_reqch, NULL);
+ cr_rpc_send_req(&srv->_reqch, NULL);
return;
}
lib9p_srv_read(srv, conn);
@@ -514,7 +514,7 @@ void lib9p_srv_read(struct lib9p_srv *srv, lo_interface net_stream_conn _conn) {
handle_message(&req);
else
/* ...but usually in another coroutine. */
- _lib9p_srv_reqch_send_req(&srv->_reqch, &req);
+ cr_rpc_send_req(&srv->_reqch, &req);
}
if (map_len(&sess.reqs) == 0)
io_close(conn.fd);
@@ -560,10 +560,10 @@ void lib9p_srv_worker_loop(struct lib9p_srv *srv) {
for (;;) {
/* Receive the request from the reader coroutine. ************/
- rpc_handle = _lib9p_srv_reqch_recv_req(&srv->_reqch);
+ rpc_handle = cr_rpc_recv_req(&srv->_reqch);
if (!rpc_handle.req) {
srv->writers--;
- _lib9p_srv_reqch_send_resp(rpc_handle, 0);
+ cr_rpc_send_resp(rpc_handle, 0);
return;
}
/* Copy the request from the reader coroutine's
@@ -574,14 +574,14 @@ void lib9p_srv_worker_loop(struct lib9p_srv *srv) {
assert(reqpp && *reqpp == &req);
/* Notify the reader coroutine that we're done with
* its data. */
- _lib9p_srv_reqch_send_resp(rpc_handle, 0);
+ cr_rpc_send_resp(rpc_handle, 0);
/* Process the request. **************************************/
handle_message(&req);
/* Release resources. ****************************************/
- while (_lib9p_srv_flushch_can_send(&req.flushch))
- _lib9p_srv_flushch_send(&req.flushch, false);
+ while (cr_chan_can_send(&req.flushch))
+ cr_chan_send(&req.flushch, false);
map_del(&req.parent_sess->reqs, req.tag);
if (req.parent_sess->closing && !map_len(&req.parent_sess->reqs))
cr_unpause(req.parent_sess->parent_conn->reader);
@@ -868,7 +868,7 @@ static void handle_Tflush(struct srv_req *ctx,
struct srv_req **oldreqp = map_load(&ctx->parent_sess->reqs, req->oldtag);
if (oldreqp)
- _lib9p_srv_flushch_recv(&((*oldreqp)->flushch));
+ cr_chan_recv(&((*oldreqp)->flushch));
}
static void handle_Twalk(struct srv_req *ctx,