Skip to content

Commit

Permalink
Try #1591:
Browse files Browse the repository at this point in the history
  • Loading branch information
mayastor-bors committed Feb 21, 2024
2 parents ccd3b14 + 7d5b4d9 commit abdd88e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 29 deletions.
25 changes: 3 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion io-engine-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ nix = "0.27.1"
once_cell = "1.18.0"
parking_lot = "0.12.1"
pin-utils = "0.1.0"
proc-mounts = "0.3.0"
prost = "0.12.1"
prost-derive = "0.12.1"
rand = "0.8.5"
Expand Down
2 changes: 1 addition & 1 deletion io-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ nix = { version = "0.27.1", default-features = false, features = [ "hostname", "
once_cell = "1.18.0"
parking_lot = "0.12.1"
pin-utils = "0.1.0"
proc-mounts = "0.3.0"
prost = "0.12.1"
prost-derive = "0.12.1"
rand = "0.8.5"
Expand All @@ -98,6 +97,7 @@ async-process = { version = "1.8.1" }
rstack = { version = "0.3.3" }
tokio-stream = "0.1.14"

devinfo = { path = "../utils/dependencies/devinfo" }
jsonrpc = { path = "../jsonrpc"}
io-engine-api = { path = "../utils/dependencies/apis/io-engine" }
spdk-rs = { path = "../spdk-rs" }
Expand Down
12 changes: 7 additions & 5 deletions io-engine/src/host/blk_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
//! of consistency, the mount table is also checked to ENSURE that the device
//! is not mounted)

use crate::constants::{NEXUS_CAS_DRIVER, NVME_CONTROLLER_MODEL_ID};
use devinfo::mountinfo::{MountInfo, SafeMountIter};
use std::{
collections::HashMap,
ffi::{OsStr, OsString},
io::Error,
io::{Error, ErrorKind},
};

use crate::constants::{NEXUS_CAS_DRIVER, NVME_CONTROLLER_MODEL_ID};
use proc_mounts::{MountInfo, MountIter};
use udev::{Device, Enumerator};

// Struct representing a property value in a udev::Device struct (and possibly
Expand Down Expand Up @@ -278,7 +277,10 @@ fn new_device(
fn get_mounts() -> Result<HashMap<OsString, Vec<MountInfo>>, Error> {
let mut table: HashMap<OsString, Vec<MountInfo>> = HashMap::new();

for mount in (MountIter::new()?).flatten() {
for mount in SafeMountIter::get()
.map_err(|err| Error::new(ErrorKind::Other, err))?
.flatten()
{
let mount_source = OsString::from(mount.source.clone());
if !table.contains_key(&mount_source) {
table.insert(mount_source.clone(), Vec::new());
Expand Down

0 comments on commit abdd88e

Please sign in to comment.