summaryrefslogtreecommitdiff
path: root/lib9p/tests/test_server/fs_flush.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-19 09:14:20 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-19 12:53:42 -0600
commit09cac1d04e106b70ad4afde3b24df6d294d191b1 (patch)
tree602a9e60791f06dfa978824d819ede0b2977e9e5 /lib9p/tests/test_server/fs_flush.c
parentd81b0e1036aedb127c4033a187b671deaaca54c4 (diff)
lib9p_srv: Separate the stat API from the network format
Diffstat (limited to 'lib9p/tests/test_server/fs_flush.c')
-rw-r--r--lib9p/tests/test_server/fs_flush.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/lib9p/tests/test_server/fs_flush.c b/lib9p/tests/test_server/fs_flush.c
index 821f32d..e6408d7 100644
--- a/lib9p/tests/test_server/fs_flush.c
+++ b/lib9p/tests/test_server/fs_flush.c
@@ -31,28 +31,23 @@ static struct lib9p_qid flush_file_qid(struct flush_file *self) {
};
}
-static struct lib9p_stat flush_file_stat(struct flush_file *self, struct lib9p_srv_ctx *ctx) {
+static struct lib9p_srv_stat flush_file_stat(struct flush_file *self, struct lib9p_srv_ctx *ctx) {
assert(self);
assert(ctx);
- return (struct lib9p_stat){
- .fstype = 0,
- .fsdev = 0,
+ return (struct lib9p_srv_stat){
.qid = flush_file_qid(self),
.mode = 0444,
- .atime = UTIL9P_ATIME,
- .mtime = UTIL9P_MTIME,
- .length = 6,
+ .atime_sec = UTIL9P_ATIME,
+ .mtime_sec = UTIL9P_MTIME,
+ .size = 6,
.name = lib9p_str(self->name),
- .owner_uname = lib9p_str("root"),
- .owner_unum = 0,
- .owner_gname = lib9p_str("root"),
- .owner_gnum = 0,
- .last_modifier_uname = lib9p_str("root"),
- .last_modifier_unum = 0,
+ .owner_uid = { .name = lib9p_str("root"), .num = 0 },
+ .owner_gid = { .name = lib9p_str("root"), .num = 0 },
+ .last_modifier_uid = { .name = lib9p_str("root"), .num = 0 },
.extension = lib9p_str(NULL),
};
}
-static void flush_file_wstat(struct flush_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_stat) {
+static void flush_file_wstat(struct flush_file *self, struct lib9p_srv_ctx *ctx, struct lib9p_srv_stat) {
assert(self);
assert(ctx);
lib9p_error(&ctx->basectx, LIB9P_ERRNO_L_EROFS, "cannot wstat API file");