diff --git a/db/src/kvdb.rs b/db/src/kvdb.rs index 4d4d8226..64cc74c9 100644 --- a/db/src/kvdb.rs +++ b/db/src/kvdb.rs @@ -6,12 +6,6 @@ use elastic_array::*; use std::default::Default; use rocksdb::{DB, Writable, WriteBatch, WriteOptions, IteratorMode, DBIterator, Options, DBCompactionStyle, BlockBasedOptions, Cache, Column, ReadOptions}; -#[cfg(target_os = "linux")] -use regex::Regex; -#[cfg(target_os = "linux")] -use std::process::Command; -#[cfg(target_os = "linux")] -use std::fs::File; use std::collections::HashMap; use byteorder::{LittleEndian, ByteOrder}; //use std::path::Path; @@ -129,25 +123,6 @@ impl Default for CompactionProfile { } } -/// Given output of df command return Linux rotational flag file path. -#[cfg(target_os = "linux")] -pub fn rotational_from_df_output(df_out: Vec) -> Option { - str::from_utf8(df_out.as_slice()) - .ok() - // Get the drive name. - .and_then(|df_str| Regex::new(r"/dev/(sd[:alpha:]{1,2})") - .ok() - .and_then(|re| re.captures(df_str)) - .and_then(|captures| captures.at(1))) - // Generate path e.g. /sys/block/sda/queue/rotational - .map(|drive_path| { - let mut p = PathBuf::from("/sys/block"); - p.push(drive_path); - p.push("queue/rotational"); - p - }) -} - impl CompactionProfile { /// Default profile suitable for SSD storage