From d335a48ee2b2d2bb87408b557345af2166e7085d Mon Sep 17 00:00:00 2001 From: Monthon Klongklaew Date: Fri, 14 Jul 2023 15:18:22 +0100 Subject: [PATCH] Remove the temporary checksum feature (#378) Signed-off-by: Monthon Klongklaew --- mountpoint-s3/Cargo.toml | 2 -- mountpoint-s3/src/prefetch/checksummed_bytes.rs | 5 ----- 2 files changed, 7 deletions(-) diff --git a/mountpoint-s3/Cargo.toml b/mountpoint-s3/Cargo.toml index 012d1f180..3d889d910 100644 --- a/mountpoint-s3/Cargo.toml +++ b/mountpoint-s3/Cargo.toml @@ -59,8 +59,6 @@ fuse_tests = [] s3_tests = [] shuttle = [] delete = [] -# A temporary feature flag to enable read-path checksums while we are working to improve its performance -checksum = [] [build-dependencies] built = { version = "0.6.0", features = ["git2"] } diff --git a/mountpoint-s3/src/prefetch/checksummed_bytes.rs b/mountpoint-s3/src/prefetch/checksummed_bytes.rs index 91ac6124c..7bf6dea13 100644 --- a/mountpoint-s3/src/prefetch/checksummed_bytes.rs +++ b/mountpoint-s3/src/prefetch/checksummed_bytes.rs @@ -25,7 +25,6 @@ impl ChecksummedBytes { /// /// Return `IntegrityError` on data corruption. pub fn into_bytes(self) -> Result { - #[cfg(feature = "checksum")] self.validate()?; Ok(self.curr_slice) @@ -72,7 +71,6 @@ impl ChecksummedBytes { let new_checksummed_bytes = ChecksummedBytes::new(new_bytes, new_checksum); // Validate data integrity with checksum bracketing. - #[cfg(feature = "checksum")] { // 1. repeat the operation, which means copying into a new buffer in this case. let mut bytes_mut_dup = BytesMut::with_capacity(total_len); @@ -145,7 +143,6 @@ mod tests { assert_eq!(expected, actual); } - #[cfg(feature = "checksum")] #[test] fn test_into_bytes_integrity_error() { let bytes = Bytes::from_static(b"some bytes"); @@ -210,7 +207,6 @@ mod tests { assert_eq!(expected, actual); } - #[cfg(feature = "checksum")] #[test] fn test_extend_self_corrupted() { let bytes = Bytes::from_static(b"some bytes"); @@ -228,7 +224,6 @@ mod tests { assert!(matches!(result, Err(IntegrityError::ChecksumMismatch(_, _)))); } - #[cfg(feature = "checksum")] #[test] fn test_extend_other_corrupted() { let bytes = Bytes::from_static(b"some bytes");