Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-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 7f0e07d9586..b8ea1180e25 100644
--- a/src/backend/storage/aio/read_stream.c
+++ b/src/backend/storage/aio/read_stream.c
@@ -798,6 +798,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