diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-17 12:42:25 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-18 11:26:44 -0600 |
commit | 740bffed4da51c4d46a1295baabe3bd249cf9138 (patch) | |
tree | b38e30e3eef47ecc58f7162e2bfa84bbb885cde3 /lib9p/tests/test_server/fs_shutdown.c | |
parent | b44e1813b9a39827ebe5b8ade6dd68713925c58b (diff) |
lib9p_srv: Set Twrite->byte_offset to zero if append-only
Diffstat (limited to 'lib9p/tests/test_server/fs_shutdown.c')
-rw-r--r-- | lib9p/tests/test_server/fs_shutdown.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib9p/tests/test_server/fs_shutdown.c b/lib9p/tests/test_server/fs_shutdown.c index e7375ef..af2a989 100644 --- a/lib9p/tests/test_server/fs_shutdown.c +++ b/lib9p/tests/test_server/fs_shutdown.c @@ -24,7 +24,7 @@ static void shutdown_file_free(struct shutdown_file *self) { static struct lib9p_qid shutdown_file_qid(struct shutdown_file *self) { assert(self); return (struct lib9p_qid){ - .type = LIB9P_QT_FILE, + .type = LIB9P_QT_FILE | LIB9P_QT_APPEND, .vers = 1, .path = self->pathnum, }; @@ -37,7 +37,7 @@ static struct lib9p_stat shutdown_file_stat(struct shutdown_file *self, struct l .kern_type = 0, .kern_dev = 0, .file_qid = shutdown_file_qid(self), - .file_mode = 0222, + .file_mode = 0222 | LIB9P_DM_APPEND, .file_atime = UTIL9P_ATIME, .file_mtime = UTIL9P_MTIME, .file_size = 0, @@ -91,10 +91,11 @@ static uint32_t shutdown_fio_iounit(struct shutdown_fio *self) { return 0; } -static uint32_t shutdown_fio_pwrite(struct shutdown_fio *self, struct lib9p_srv_ctx *ctx, void *buf, uint32_t byte_count, uint64_t LM_UNUSED(offset)) { +static uint32_t shutdown_fio_pwrite(struct shutdown_fio *self, struct lib9p_srv_ctx *ctx, void *buf, uint32_t byte_count, uint64_t offset) { assert(self); assert(ctx); assert(buf); + assert(offset == 0); if (byte_count == 0) return 0; for (size_t i = 0; i < self->parent->nlisteners; i++) |