diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-02-03 21:17:57 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-02-03 21:17:57 -0700 |
commit | 2511735ccc4d8bffa66e91d6395957ed0e1e6ee0 (patch) | |
tree | 739399d3cd759e6a69231f02f242f88bf04efc15 /lib9p/srv.c | |
parent | 1e2b67047da4ad0f567ef5956f813b2d33b3cfa6 (diff) | |
parent | 1529d75b21b3e719e15988fb16abc2e02d5ddcb3 (diff) |
Merge branch 'lukeshu/9p-idl-defs'
Diffstat (limited to 'lib9p/srv.c')
-rw-r--r-- | lib9p/srv.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib9p/srv.c b/lib9p/srv.c index f2d1315..7e6402e 100644 --- a/lib9p/srv.c +++ b/lib9p/srv.c @@ -53,13 +53,13 @@ struct _srv_fidinfo { }; #define NAME fidmap -#define KEY_T uint32_t +#define KEY_T lib9p_fid_t #define VAL_T struct _srv_fidinfo #define CAP CONFIG_9P_MAX_FIDS #include "map.h" #define NAME reqmap -#define KEY_T uint32_t +#define KEY_T lib9p_tag_t #define VAL_T struct _lib9p_srv_req * #define CAP CONFIG_9P_MAX_REQS #include "map.h" @@ -818,7 +818,7 @@ static void handle_Tread(struct _lib9p_srv_req *ctx, /* Variables. */ implements_lib9p_srv_file *file = fidinfo->file; - resp->data.dat = (char *)(&resp[1]); + resp->data = (char *)(&resp[1]); /* Do it. */ if (fidinfo->flags & FIDFLAG_ISDIR) { @@ -835,20 +835,20 @@ static void handle_Tread(struct _lib9p_srv_req *ctx, return; } /* Do it. */ - size_t num = VCALL(file, dread, &ctx->ctx, (uint8_t *)resp->data.dat, req->count, idx); + size_t num = VCALL(file, dread, &ctx->ctx, (uint8_t *)resp->data, req->count, idx); /* Translate object-count back to byte-count. */ uint32_t len = 0; for (size_t i = 0; i < num; i++) { uint32_t i_len; - lib9p_stat_validate(&ctx->ctx.basectx, req->count, &((uint8_t *)resp->data.dat)[len], &i_len, NULL); + lib9p_stat_validate(&ctx->ctx.basectx, req->count, &((uint8_t *)resp->data)[len], &i_len, NULL); len += i_len; } - resp->data.len = len; + resp->count = len; /* Remember. */ fidinfo->dir_idx = idx+num; fidinfo->dir_off = req->offset + len; } else - resp->data.len = VCALL(file, pread, &ctx->ctx, resp->data.dat, req->count, req->offset); + resp->count = VCALL(file, pread, &ctx->ctx, resp->data, req->count, req->offset); } static void handle_Twrite(struct _lib9p_srv_req *ctx, @@ -873,7 +873,7 @@ static void handle_Twrite(struct _lib9p_srv_req *ctx, implements_lib9p_srv_file *file = fidinfo->file; /* Do it. */ - resp->count = VCALL(file, pwrite, &ctx->ctx, req->data.dat, req->data.len, req->offset); + resp->count = VCALL(file, pwrite, &ctx->ctx, req->data, req->count, req->offset); } static void handle_Tclunk(struct _lib9p_srv_req *ctx, |