mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-22 20:36:38 +00:00
refactor(ecstore): add mmap copy disk read name (#4061)
This commit is contained in:
@@ -149,7 +149,7 @@ async fn open_disk_reader(
|
||||
) -> disk::error::Result<FileReader> {
|
||||
if use_mmap_read && disk.is_local() {
|
||||
let start = Instant::now();
|
||||
match disk.read_file_zero_copy(bucket, path, offset, length).await {
|
||||
match disk.read_file_mmap_copy(bucket, path, offset, length).await {
|
||||
Ok(bytes) => {
|
||||
let duration_ms = start.elapsed().as_secs_f64() * 1000.0;
|
||||
|
||||
@@ -201,7 +201,7 @@ fn bitrot_encoded_range(offset: usize, length: usize, shard_size: usize, checksu
|
||||
/// * `shard_size` - Shard size for erasure coding
|
||||
/// * `checksum_algo` - Hash algorithm for bitrot verification
|
||||
/// * `skip_verify` - If true, skip checksum verification
|
||||
/// * `use_mmap_read` - If true, use zero-copy read (mmap on Unix)
|
||||
/// * `use_mmap_read` - If true, use mmap-copy read (mmap on Unix)
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn create_bitrot_reader(
|
||||
inline_data: Option<&[u8]>,
|
||||
@@ -360,7 +360,7 @@ mod tests {
|
||||
let shard_size = 16;
|
||||
let checksum_algo = HashAlgorithm::HighwayHash256S;
|
||||
|
||||
// Test with zero-copy enabled (should work the same for inline data)
|
||||
// Test with mmap-copy enabled (should work the same for inline data)
|
||||
let result = create_bitrot_reader(
|
||||
Some(test_data),
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user