summaryrefslogtreecommitdiff
path: root/lib9p/include
diff options
context:
space:
mode:
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);