summaryrefslogtreecommitdiff
path: root/lib9p/include
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-02-04 08:57:14 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-02-09 19:20:07 -0700
commita25ab8432dcf15d7d43adbc429a7cd9b493b3d91 (patch)
tree2a933b3e4451e3d82b8f9a779fe9bf3a9a3cf501 /lib9p/include
parent4efc7582a255439a574f577272d8be11f6491fe4 (diff)
lib9p: srv: Use a separate pathmap
Diffstat (limited to 'lib9p/include')
-rw-r--r--lib9p/include/lib9p/srv.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/lib9p/include/lib9p/srv.h b/lib9p/include/lib9p/srv.h
index d45d9a4..e9d2d7b 100644
--- a/lib9p/include/lib9p/srv.h
+++ b/lib9p/include/lib9p/srv.h
@@ -37,29 +37,18 @@ int lib9p_srv_acknowledge_flush(struct lib9p_srv_ctx *ctx);
struct lib9p_srv_file_vtable;
-struct __lib9p_srv_file;
-typedef struct __lib9p_srv_file {
+typedef struct {
struct lib9p_srv_file_vtable *vtable;
-
- BEGIN_PRIVATE(LIB9P_SRV_H)
- /* Managed by srv.c, but should be cloned by ->vtable->clone(). */
- struct __lib9p_srv_file *_parent_dir; /* clone this
-
- /* Managed by srv.c, but should be initialized to 0 by ->vtable->clone(). */
- /* ref type 1: an entry in fidmap
- * ref type 2: ->_parent_dir of another file */
- unsigned int _refcount;
- END_PRIVATE(LIB9P_SRV_H)
} implements_lib9p_srv_file;
struct lib9p_srv_file_vtable {
/* all - resource management */
- implements_lib9p_srv_file *(*clone )(implements_lib9p_srv_file *, struct lib9p_srv_ctx *);
- void (*free )(implements_lib9p_srv_file *, struct lib9p_srv_ctx *);
+ void (*free )(implements_lib9p_srv_file *); /* must not error */
+ struct lib9p_qid (*qid )(implements_lib9p_srv_file *); /* must not error */
+ uint32_t (*chio )(implements_lib9p_srv_file *, struct lib9p_srv_ctx *,
+ bool rd, bool wr, bool trunc);
/* all - syscalls */
- uint32_t (*io )(implements_lib9p_srv_file *, struct lib9p_srv_ctx *,
- lib9p_o_t flags);
struct lib9p_stat (*stat )(implements_lib9p_srv_file *, struct lib9p_srv_ctx *);
void (*wstat )(implements_lib9p_srv_file *, struct lib9p_srv_ctx *,
struct lib9p_stat new);