mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 23:12:54 +00:00
Address review comments
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user