summaryrefslogtreecommitdiff
path: root/lib9p/include
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/include')
-rw-r--r--lib9p/include/lib9p/srv.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib9p/include/lib9p/srv.h b/lib9p/include/lib9p/srv.h
index 6a6fed0..55bcba0 100644
--- a/lib9p/include/lib9p/srv.h
+++ b/lib9p/include/lib9p/srv.h
@@ -2,28 +2,32 @@
#define _LIB9P_SRV_H_
#include <libcr/coroutine.h>
+#include <libcr_ipc/rpc.h>
#include <libcr_ipc/chan.h>
#include <lib9p/9p.h>
+CR_RPC_DECLARE(_lib9p_srv_reqch, struct lib9p_req *, bool)
+CR_CHAN_DECLARE(_lib9p_srv_flushch, bool)
+
struct lib9p_srv_reqctx {
struct lib9p_ctx *base;
uint32_t uid;
char *uname;
- cr_chan_t(bool) _flushch;
+ _lib9p_srv_flushch_t _flushch;
};
-static inline bool flush_requested(struct lib9p_srv_reqctx *ctx) {
+static inline bool lib9p_srv_flush_requested(struct lib9p_srv_reqctx *ctx) {
assert(ctx);
- return cr_chan_can_send(&ctx->_flushch);
+ return _lib9p_srv_flushch_can_send(&ctx->_flushch);
}
-static inline int acknowledge_flush(struct lib9p_srv_reqctx *ctx) {
+static inline int lib9p_srv_acknowledge_flush(struct lib9p_srv_reqctx *ctx) {
assert(ctx);
- assert(cr_chan_can_send(&ctx->_flushch));
+ assert(_lib9p_srv_flushch_can_send(&ctx->_flushch));
lib9p_error(ctx->base, LINUX_ECANCELED, "request canceled by flush");
- cr_chan_send(&ctx->_flushch, (bool)true);
+ _lib9p_srv_flushch_send(&ctx->_flushch, true);
return -1;
}
@@ -89,7 +93,7 @@ struct lib9p_srv {
struct lib9p_srv_file (*rootdir)(struct lib9p_srv_reqctx *ctx, char *treename);
/* For internal use */
- cr_chan_t(struct lib9p_req *) reqch;
+ _lib9p_srv_reqch_t _reqch;
};
/**