Address review comments

This commit is contained in:
Victor Polevoy
2025-07-15 11:41:53 +02:00
parent 005d274c22
commit 561cbb3282
2 changed files with 7 additions and 6 deletions

View File

@@ -45,8 +45,8 @@ pub enum NeonIOResult {
/// the result pages are written to the shared memory addresses given in the request
GetPageV,
/// The result is written to the shared memory address given in the
/// request. The [`u64`] value here is the number of blocks.
/// The result is written to the file, path to which is provided
/// in the request. The [`u64`] value here is the number of blocks.
ReadSlruSegment(u64),
/// A prefetch request returns as soon as the request has been received by the communicator.
@@ -194,7 +194,8 @@ pub struct CReadSlruSegmentRequest {
}
impl CReadSlruSegmentRequest {
/// Returns the path to the file where the segment is read into.
/// Returns the file path where the communicator will write the
/// SLRU segment.
pub(crate) fn destination_file_path(&self) -> String {
unsafe { CStr::from_ptr(self.destination_file_path.as_mut_ptr() as *const _) }
.to_string_lossy()

View File

@@ -1015,15 +1015,15 @@ communicator_new_read_slru_segment(
}
};
int nblocks = -1;
char *abs_path = bounce_buf();
char *temp_path = bounce_buf();
if (path == NULL) {
elog(ERROR, "read_slru_segment called with NULL path");
return -1;
}
strlcpy(abs_path, path, Min(PATH_MAX, strlen(path) + 1));
request.read_slru_segment.destination_file_path.ptr = (uint8_t *) abs_path;
strlcpy(temp_path, path, Min(PATH_MAX, strlen(path) + 1));
request.read_slru_segment.destination_file_path.ptr = (uint8_t *) temp_path;
elog(DEBUG5, "readslrusegment called for kind=%u, segno=%u, file_path=\"%s\"",
kind, segno, request.read_slru_segment.destination_file_path.ptr);