Skip to content

Commit

Permalink
Use devicemapper definition of IEC
Browse files Browse the repository at this point in the history
Eliminate stratisd definition of IEC. These constants should probably
not be in two places, and they are used in devicemapper, the lower level
library, so they might as well be there.

Signed-off-by: mulhern <amulhern@redhat.com>
  • Loading branch information
mulkieran committed Sep 14, 2017
1 parent 7b294fa commit ed0c15c
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 29 deletions.
15 changes: 0 additions & 15 deletions src/engine/consts.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

pub use self::consts::IEC;

pub use self::engine::Dev;
pub use self::engine::Engine;
pub use self::engine::Filesystem;
Expand All @@ -28,7 +26,6 @@ mod macros;
// strat_engine is public so that integration tests can access its internals.
pub mod strat_engine;

mod consts;
#[allow(module_inception)]
pub mod engine;
mod errors;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/sim_engine/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use std::vec::Vec;
use uuid::Uuid;

use devicemapper::Sectors;
use devicemapper::consts::IEC;

use super::super::consts::IEC;
use super::super::engine::{Filesystem, HasName, HasUuid, Pool};
use super::super::errors::{EngineError, EngineResult, ErrorEnum};
use super::super::structures::Table;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/strat_engine/blockdevmgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use rand::{thread_rng, sample};
use uuid::Uuid;

use devicemapper::{Bytes, Device, Sectors, Segment};
use devicemapper::consts::IEC;

use super::super::consts::IEC;
use super::super::errors::{EngineError, EngineResult, ErrorEnum};
use super::super::types::{DevUuid, PoolUuid};

Expand Down
3 changes: 1 addition & 2 deletions src/engine/strat_engine/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ use std::path::Path;

use nix::sys::stat::{S_IFBLK, S_IFMT};

use devicemapper::consts::SECTOR_SIZE;
use devicemapper::consts::{IEC, SECTOR_SIZE};
use devicemapper::{Bytes, Device, Sectors};

use super::super::consts::IEC;
use super::super::errors::{EngineResult, EngineError, ErrorEnum};

ioctl!(read blkgetsize64 with 0x12, 114; u64);
Expand Down
7 changes: 3 additions & 4 deletions src/engine/strat_engine/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ use crc::crc32;
use uuid::Uuid;

use devicemapper::{Bytes, Sectors};
use devicemapper::consts::SECTOR_SIZE;
use devicemapper::consts::{IEC, SECTOR_SIZE};

use super::super::consts::IEC;
use super::super::errors::{EngineResult, EngineError, ErrorEnum};
use super::super::types::{DevUuid, PoolUuid};

Expand Down Expand Up @@ -753,11 +752,11 @@ mod tests {
use std::io::Cursor;

use devicemapper::{Bytes, Sectors};
use devicemapper::consts::IEC;

use quickcheck::{QuickCheck, TestResult};
use uuid::Uuid;

use super::super::super::consts::IEC;

use super::super::engine::DevOwnership;
use super::*;

Expand Down
2 changes: 1 addition & 1 deletion src/engine/strat_engine/thinpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use uuid::Uuid;
use devicemapper as dm;
use devicemapper::{DM, DataBlocks, DmDevice, DmError, LinearDev, MetaBlocks, Sectors, Segment,
ThinDev, ThinDevId, ThinPoolDev, ThinPoolWorkingStatus};
use devicemapper::consts::IEC;
use devicemapper::ErrorEnum::CheckFailed;

use super::super::consts::IEC;
use super::super::engine::{Filesystem, HasName};
use super::super::errors::{EngineError, EngineResult, ErrorEnum};
use super::super::structures::Table;
Expand Down
2 changes: 1 addition & 1 deletion tests/loopbacked_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use loopdev::{LoopControl, LoopDevice};
use tempdir::TempDir;

use devicemapper::{Bytes, Sectors};
use devicemapper::consts::IEC;

use libstratis::engine::IEC;
use libstratis::engine::strat_engine::device::wipe_sectors;

use util::logger::init_logger;
Expand Down
2 changes: 1 addition & 1 deletion tests/real_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use std::path::{Path, PathBuf};
use serde_json::{Value, from_reader};

use self::devicemapper::{Bytes, Sectors};
use self::devicemapper::consts::IEC;

use libstratis::engine::IEC;
use libstratis::engine::strat_engine::device::wipe_sectors;

use util::logger::init_logger;
Expand Down

0 comments on commit ed0c15c

Please sign in to comment.