mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-01 07:47:15 +00:00
Merge pull request #4644 from bookinabox/optimize-get-paths
cgroups: remove unnecessary get_paths()
This commit is contained in:
commit
0b4a91ec1a
@ -911,9 +911,8 @@ pub fn get_paths() -> Result<HashMap<String, String>> {
|
||||
Ok(m)
|
||||
}
|
||||
|
||||
pub fn get_mounts() -> Result<HashMap<String, String>> {
|
||||
pub fn get_mounts(paths: &HashMap<String, String>) -> Result<HashMap<String, String>> {
|
||||
let mut m = HashMap::new();
|
||||
let paths = get_paths()?;
|
||||
|
||||
for l in fs::read_to_string(MOUNTS)?.lines() {
|
||||
let p: Vec<&str> = l.splitn(2, " - ").collect();
|
||||
@ -951,7 +950,7 @@ impl Manager {
|
||||
let mut m = HashMap::new();
|
||||
|
||||
let paths = get_paths()?;
|
||||
let mounts = get_mounts()?;
|
||||
let mounts = get_mounts(&paths)?;
|
||||
|
||||
for key in paths.keys() {
|
||||
let mnt = mounts.get(key);
|
||||
|
Loading…
Reference in New Issue
Block a user