From 03a517a310294cc1c3d4f085f88d058e41180aad Mon Sep 17 00:00:00 2001 From: bootandy Date: Thu, 22 Mar 2018 14:29:59 -0400 Subject: [PATCH] block size is always 512 on rust --- src/utils/platform.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/utils/platform.rs b/src/utils/platform.rs index bf876f1..402d8ae 100644 --- a/src/utils/platform.rs +++ b/src/utils/platform.rs @@ -1,12 +1,8 @@ use std; -#[cfg(not(any(target_os = "macos", target_os = "linux")))] -pub fn get_block_size() -> u64 { - 1024 -} - -#[cfg(any(target_os = "macos", target_os = "linux"))] -pub fn get_block_size() -> u64 { +fn get_block_size() -> u64 { + // All os specific implementations of MetatdataExt seem to define a block as 512 bytes + // https://doc.rust-lang.org/std/os/linux/fs/trait.MetadataExt.html#tymethod.st_blocks 512 }