summaryrefslogtreecommitdiff
path: root/src/backend/storage/aio/read_stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/aio/read_stream.c')
-rw-r--r--src/backend/storage/aio/read_stream.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/backend/storage/aio/read_stream.c b/src/backend/storage/aio/read_stream.c
index a6c50b2ae24..9b962c301bf 100644
--- a/src/backend/storage/aio/read_stream.c
+++ b/src/backend/storage/aio/read_stream.c
@@ -732,6 +732,20 @@ read_stream_next_buffer(ReadStream *stream, void **per_buffer_data)
}
/*
+ * Transitional support for code that would like to perform or skip reads
+ * itself, without using the stream. Returns, and consumes, the next block
+ * number that would be read by the stream's look-ahead algorithm, or
+ * InvalidBlockNumber if the end of the stream is reached. Also reports the
+ * strategy that would be used to read it.
+ */
+BlockNumber
+read_stream_next_block(ReadStream *stream, BufferAccessStrategy *strategy)
+{
+ *strategy = stream->ios[0].op.strategy;
+ return read_stream_get_block(stream, NULL);
+}
+
+/*
* Reset a read stream by releasing any queued up buffers, allowing the stream
* to be used again for different blocks. This can be used to clear an
* end-of-stream condition and start again, or to throw away blocks that were