1.1 --- a/docs/wiki/Components Sat May 11 00:10:59 2024 +0200
1.2 +++ b/docs/wiki/Components Sat May 11 00:49:24 2024 +0200
1.3 @@ -348,7 +348,7 @@
1.4 Directory -> Reader1;
1.5 Reader1 -> Client2;
1.6
1.7 - Client3 -> Reader2 [label="current_region()"];
1.8 + Client3 -> Reader2 [label="refresh()"];
1.9 Reader3 -> Memory -> Client4;
1.10 }
1.11 }}}
1.12 @@ -360,7 +360,7 @@
1.13
1.14 {{{
1.15 reader = directory.opendir()
1.16 -reader.current_region()
1.17 +reader.refresh()
1.18 entries = reader.read() # this being a memory access operation
1.19 }}}
1.20
1.21 @@ -397,14 +397,13 @@
1.22 fully populated region. Naturally, the reader may not advance ahead of the
1.23 writer.
1.24
1.25 -Pipes implement the `Pipe` interface and a number of operations to support
1.26 -this interaction mechanism.
1.27 +Pipes implement a number of operations to support this interaction mechanism.
1.28
1.29 The details of an endpoint's current region can be queried using the following
1.30 -operation:
1.31 +operation from the `Flush` interface:
1.32
1.33 {{{
1.34 -current_region(inout offset_t position, out offset_t populated_size, out offset_t size)
1.35 +refresh(out offset_t position, out offset_t size, out offset_t region_size)
1.36 }}}
1.37
1.38 This provides details of the recorded access position in a region, the
1.39 @@ -413,7 +412,7 @@
1.40 the same.
1.41
1.42 Navigation to the next available region of the pipe is performed using the
1.43 -following operation:
1.44 +following operation from the `Pipe` interface:
1.45
1.46 {{{
1.47 next_region(inout offset_t populated_size, out offset_t size)
2.1 --- a/libfsclient/lib/src/file.cc Sat May 11 00:10:59 2024 +0200
2.2 +++ b/libfsclient/lib/src/file.cc Sat May 11 00:49:24 2024 +0200
2.3 @@ -681,9 +681,9 @@
2.4
2.5 long pipe_current(file_t *pipe, int sync)
2.6 {
2.7 - client_Pipe _pipe(pipe->ref);
2.8 + client_Flush _pipe(pipe->ref);
2.9 offset_t data_current;
2.10 - long err = _pipe.current_region(&data_current, &pipe->size, &pipe->end_pos);
2.11 + long err = _pipe.refresh(&data_current, &pipe->size, &pipe->end_pos);
2.12
2.13 if (err)
2.14 return err;
3.1 --- a/libfsserver/include/fsserver/pipe_pager.h Sat May 11 00:10:59 2024 +0200
3.2 +++ b/libfsserver/include/fsserver/pipe_pager.h Sat May 11 00:49:24 2024 +0200
3.3 @@ -1,7 +1,7 @@
3.4 /*
3.5 * A pipe pager providing access to pipe content and navigation support.
3.6 *
3.7 - * Copyright (C) 2021, 2022, 2023 Paul Boddie <paul@boddie.org.uk>
3.8 + * Copyright (C) 2021, 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
3.9 *
3.10 * This program is free software; you can redistribute it and/or
3.11 * modify it under the terms of the GNU General Public License as
3.12 @@ -66,14 +66,14 @@
3.13
3.14 virtual long closed(int *closed);
3.15
3.16 - virtual long current_region(offset_t *position, offset_t *populated_size, offset_t *size);
3.17 -
3.18 virtual long next_region(offset_t *populated_size, offset_t *size);
3.19
3.20 /* Flushing/synchronisation. */
3.21
3.22 virtual long flush(offset_t position, offset_t *size);
3.23
3.24 + virtual long refresh(offset_t *position, offset_t *populated_size, offset_t *size);
3.25 +
3.26 /* Notification methods. */
3.27
3.28 virtual long subscribe(l4_cap_idx_t notifier, notify_flags_t flags);
4.1 --- a/libfsserver/lib/pipes/pipe_pager.cc Sat May 11 00:10:59 2024 +0200
4.2 +++ b/libfsserver/lib/pipes/pipe_pager.cc Sat May 11 00:49:24 2024 +0200
4.3 @@ -96,7 +96,7 @@
4.4
4.5 /* Return details of the current region. */
4.6
4.7 -long PipePager::current_region(offset_t *position, offset_t *populated_size, offset_t *size)
4.8 +long PipePager::refresh(offset_t *position, offset_t *populated_size, offset_t *size)
4.9 {
4.10 if (_mapper != NULL)
4.11 {
4.12 @@ -133,7 +133,7 @@
4.13 _mapper = mapper;
4.14 _data_current = 0;
4.15
4.16 - return current_region(NULL, populated_size, size);
4.17 + return refresh(NULL, populated_size, size);
4.18 }
4.19
4.20 long PipePager::next_region_for_writer(offset_t *populated_size, offset_t *size)
4.21 @@ -153,7 +153,7 @@
4.22 _mapper = mapper;
4.23 _data_current = 0;
4.24
4.25 - return current_region(NULL, populated_size, size);
4.26 + return refresh(NULL, populated_size, size);
4.27 }
4.28
4.29 long PipePager::pipe_error()
5.1 --- a/libsystypes/idl/flush.idl Sat May 11 00:10:59 2024 +0200
5.2 +++ b/libsystypes/idl/flush.idl Sat May 11 00:49:24 2024 +0200
5.3 @@ -9,4 +9,10 @@
5.4 indicates the point from which data is being consumed by a client. */
5.5
5.6 [opcode(5)] void flush(in offset_t position, out offset_t size);
5.7 +
5.8 + /* Refresh any recorded position and size information, also obtaining the span
5.9 + of the mapped region used to access the file or pipe. */
5.10 +
5.11 + [opcode(16)] void refresh(out offset_t position, out offset_t size,
5.12 + out offset_t region_size);
5.13 };
6.1 --- a/libsystypes/idl/pipe.idl Sat May 11 00:10:59 2024 +0200
6.2 +++ b/libsystypes/idl/pipe.idl Sat May 11 00:49:24 2024 +0200
6.3 @@ -4,12 +4,11 @@
6.4
6.5 interface Pipe
6.6 {
6.7 - /* Obtain details of the current region of shared memory. */
6.8 + /* Advance to the next region of shared memory, indicating and obtaining the
6.9 + populated limit of the region and obtaining the region size.
6.10
6.11 - [opcode(16)] void current_region(out offset_t position, out offset_t populated_size, out offset_t size);
6.12 -
6.13 - /* Advance to the next region of shared memory, indicating and obtaining the
6.14 - populated limit of the region and obtaining the region size. */
6.15 + The current region details are available via the Flush interface's refresh
6.16 + operation. */
6.17
6.18 [opcode(17)] void next_region(inout offset_t populated_size, out offset_t size);
6.19