From af6ed48e39502b77d86efe4e4d337b7ae33c5876 Mon Sep 17 00:00:00 2001 From: Levente Kurusa Date: Sat, 29 Sep 2018 09:41:36 -0400 Subject: [PATCH] blkio: use BlkIoData for weight_device, too Signed-off-by: Levente Kurusa --- src/blkio.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/blkio.rs b/src/blkio.rs index f32e4d4..1d42111 100644 --- a/src/blkio.rs +++ b/src/blkio.rs @@ -252,7 +252,7 @@ pub struct BlkIo { /// The weight of this control group. pub weight: u64, /// Same as `weight`, but per-block-device. - pub weight_device: String, + pub weight_device: Vec, } impl Controller for BlkIoController { @@ -510,9 +510,10 @@ impl BlkIoController { weight: self.open_path("blkio.weight", false).and_then(|file| { read_u64_from(file) }).unwrap_or(0u64), - weight_device: self.open_path("blkio.weight_device", false).and_then(|file| { - read_string_from(file) - }).unwrap_or("".to_string()), + weight_device: self.open_path("blkio.weight_device", false) + .and_then(read_string_from) + .and_then(parse_blkio_data) + .unwrap_or(Vec::new()), } }