From c08e4d3e5d7a95e091180f22dc9fde850feea327 Mon Sep 17 00:00:00 2001 From: Levente Kurusa Date: Thu, 4 Oct 2018 12:51:21 -0400 Subject: [PATCH] blkio: parse leaf_weight_device --- src/blkio.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/blkio.rs b/src/blkio.rs index 6864df3..db879e3 100644 --- a/src/blkio.rs +++ b/src/blkio.rs @@ -237,7 +237,7 @@ pub struct BlkIo { /// control group's tasks. pub leaf_weight: u64, /// Same as `leaf_weight`, but per-block-device. - pub leaf_weight_device: String, + pub leaf_weight_device: Vec, /// Total number of sectors transferred between the block devices and the control group's /// tasks. pub sectors: String, @@ -479,8 +479,9 @@ impl BlkIoController { .unwrap_or(0u64), leaf_weight_device: self .open_path("blkio.leaf_weight_device", false) - .and_then(|file| read_string_from(file)) - .unwrap_or("".to_string()), + .and_then(read_string_from) + .and_then(parse_blkio_data) + .unwrap_or(Vec::new()), sectors: self .open_path("blkio.sectors", false) .and_then(|file| read_string_from(file))