summaryrefslogtreecommitdiff
path: root/lib9p/tests/test_server/fs_flush.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-07 15:23:29 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-12 02:28:40 -0600
commit2d7f2350559dde046e95bcc28c1f89f41f5a6d75 (patch)
tree374571661ef53086e6a9e025b9b344bf80451cb4 /lib9p/tests/test_server/fs_flush.c
parent4109b15224b08fe49297097d9891e4c584712400 (diff)
lib9p_srv: Adopt a pread_to-like interface
Diffstat (limited to 'lib9p/tests/test_server/fs_flush.c')
-rw-r--r--lib9p/tests/test_server/fs_flush.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib9p/tests/test_server/fs_flush.c b/lib9p/tests/test_server/fs_flush.c
index 41156ba..0ae905f 100644
--- a/lib9p/tests/test_server/fs_flush.c
+++ b/lib9p/tests/test_server/fs_flush.c
@@ -93,8 +93,8 @@ static uint32_t_or_error flush_fio_pwrite(struct flush_fio *LM_UNUSED(self),
assert_notreached("not writable");
}
-static iovec_or_error flush_fio_pread(struct flush_fio *self, struct lib9p_srv_ctx *ctx,
- uint32_t byte_count, uint64_t LM_UNUSED(byte_offset)) {
+static error flush_fio_pread(struct flush_fio *self, struct lib9p_srv_ctx *ctx,
+ lo_interface io_writer dst, uint64_t LM_UNUSED(src_offset), uint32_t byte_count) {
assert(self);
assert(ctx);
@@ -114,14 +114,11 @@ static iovec_or_error flush_fio_pread(struct flush_fio *self, struct lib9p_srv_c
/* Return */
switch (self->parent->flush_behavior) {
case FLUSH_READ:
- return ERROR_NEW_VAL(iovec, ((struct iovec){
- .iov_base = "Sloth\n",
- .iov_len = 6 < byte_count ? 6 : byte_count,
- }));
+ return io_write(dst, "Sloth\n", 6 < byte_count ? 6 : byte_count).err;
case FLUSH_ERROR:
- return ERROR_NEW_ERR(iovec, error_new(E_POSIX_EAGAIN, "request canceled by flush"));
+ return error_new(E_POSIX_EAGAIN, "request canceled by flush");
case FLUSH_SILENT:
- return ERROR_NEW_ERR(iovec, error_new(E_POSIX_ECANCELED, "request canceled by flush"));
+ return error_new(E_POSIX_ECANCELED, "request canceled by flush");
default:
assert_notreached("invalid flush_behavior");
}