Skip to content

Commit 0007613

Browse files
Actually write global recompression configuration
Ref: #215
1 parent 5ef051d commit 0007613

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/setup.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ pub fn run_device_setup(device: Option<Device>, device_name: &str) -> Result<()>
9898
})?,
9999
}
100100
}
101+
if !device
102+
.compression_algorithms
103+
.recompression_global
104+
.is_empty()
105+
{
106+
match fs::write(
107+
device_sysfs_path.join("recompress"),
108+
&device.compression_algorithms.recompression_global,
109+
) {
110+
Ok(_) => {}
111+
Err(err) => {
112+
warn!(
113+
"Warning: configuring global recompression with {:?} failed: {}",
114+
device.compression_algorithms.recompression_global, err,
115+
);
116+
}
117+
}
118+
}
101119

102120
if let Some(ref wb_dev) = device.writeback_dev {
103121
let writeback_path = device_sysfs_path.join("backing_dev");

0 commit comments

Comments
 (0)