Skip to content

Commit

Permalink
Update for new devicemapper consts interface.
Browse files Browse the repository at this point in the history
Remove IEC definition in stratisd.
Alphabetize as necessary.

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

This file was deleted.

3 changes: 1 addition & 2 deletions src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// 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 devicemapper::{IEC, SECTOR_SIZE};

pub use self::engine::BlockDev;
pub use self::engine::Engine;
Expand All @@ -28,7 +28,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
3 changes: 1 addition & 2 deletions src/engine/sim_engine/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ use std::vec::Vec;

use uuid::Uuid;

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

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

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

use super::super::consts::IEC;
use super::super::engine::BlockDev;
use super::super::errors::{EngineError, EngineResult, ErrorEnum};
use super::super::types::{DevUuid, PoolUuid};
Expand Down
4 changes: 1 addition & 3 deletions src/engine/strat_engine/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ use std::path::Path;

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

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

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

ioctl!(read blkgetsize64 with 0x12, 114; u64);
Expand Down
4 changes: 2 additions & 2 deletions src/engine/strat_engine/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use std::path::{Path, PathBuf};
use std::process::Command;

use devicemapper::{Bytes, DmDevice, DM, Sectors, ThinDev, ThinDevId, ThinStatus, ThinPoolDev};
use devicemapper::consts::{IEC, SECTOR_SIZE};
use devicemapper::{Bytes, DmDevice, DM, IEC, SECTOR_SIZE, Sectors, ThinDev, ThinDevId, ThinStatus,
ThinPoolDev};

use nix::sys::statvfs::statvfs;
use nix::sys::statvfs::vfs::Statvfs;
Expand Down
8 changes: 2 additions & 6 deletions src/engine/strat_engine/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ use chrono::{DateTime, Utc};
use crc::crc32;
use uuid::Uuid;

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

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

Expand Down Expand Up @@ -752,12 +750,10 @@ mod mda {
mod tests {
use std::io::Cursor;

use devicemapper::{Bytes, Sectors};
use devicemapper::{Bytes, IEC, Sectors};
use quickcheck::{QuickCheck, TestResult};
use uuid::Uuid;

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

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

Expand Down
5 changes: 2 additions & 3 deletions src/engine/strat_engine/thinpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ use std::process::Command;
use uuid::Uuid;

use devicemapper as dm;
use devicemapper::{DM, DataBlocks, DmDevice, DmError, LinearDev, MetaBlocks, Sectors, Segment,
ThinDev, ThinDevId, ThinPoolDev, ThinPoolWorkingStatus};
use devicemapper::{DM, DataBlocks, DmDevice, DmError, IEC, LinearDev, MetaBlocks, Sectors,
Segment, ThinDev, ThinDevId, ThinPoolDev, ThinPoolWorkingStatus};
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
3 changes: 1 addition & 2 deletions tests/util/blockdev_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ use std::path::Path;

use self::uuid::Uuid;

use self::devicemapper::Sectors;
use self::devicemapper::consts::SECTOR_SIZE;
use self::devicemapper::{SECTOR_SIZE, Sectors};

use libstratis::engine::Engine;
use libstratis::engine::strat_engine::blockdevmgr::{BlockDevMgr, initialize};
Expand Down
9 changes: 2 additions & 7 deletions tests/util/dm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,8 @@ use self::nix::mount::{MsFlags, MNT_DETACH, mount, umount2};
use self::tempdir::TempDir;
use self::uuid::Uuid;

use self::devicemapper::Bytes;
use self::devicemapper::consts::IEC;
use self::devicemapper::{DmName, DM};
use self::devicemapper::LinearDev;
use self::devicemapper::Segment;
use self::devicemapper::{DataBlocks, Sectors};
use self::devicemapper::{DmDevice, ThinDev, ThinDevId, ThinPoolDev};
use self::devicemapper::{Bytes, DM, DataBlocks, DmDevice, DmName, IEC, LinearDev, Sectors,
Segment, ThinDev, ThinDevId, ThinPoolDev};

use libstratis::engine::strat_engine::blockdevmgr::{BlockDevMgr, initialize, map_to_dm};
use libstratis::engine::strat_engine::device::{blkdev_size, resolve_devices, wipe_sectors};
Expand Down
4 changes: 1 addition & 3 deletions tests/util/filesystem_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ use self::nix::mount::{MsFlags, mount, umount};

use self::tempdir::TempDir;

use self::devicemapper::consts::IEC;
use self::devicemapper::{Bytes, DM};
use self::devicemapper::consts::SECTOR_SIZE;
use self::devicemapper::{Bytes, DM, IEC, SECTOR_SIZE};

use libstratis::engine::Pool;
use libstratis::engine::Filesystem;
Expand Down
5 changes: 1 addition & 4 deletions tests/util/pool_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ use std::fs::OpenOptions;
use std::io::Write;
use std::path::{Path, PathBuf};

use self::devicemapper::{Device, DmName, DM};
use self::devicemapper::Sectors;
use self::devicemapper::consts::SECTOR_SIZE;
use self::devicemapper::ThinDev;
use self::devicemapper::{Device, DmName, DM, SECTOR_SIZE, Sectors, ThinDev};

use libstratis::engine::{Engine, Pool};
use libstratis::engine::engine::HasUuid;
Expand Down

0 comments on commit 8b526be

Please sign in to comment.