Skip to content

Commit

Permalink
blockdev: Use --direct-io=on for losetup
Browse files Browse the repository at this point in the history
This is what other projects do; it avoids double buffering
and is generally a good idea.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Mar 6, 2024
1 parent 5f58cb3 commit 61de519
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/blockdev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl LoopbackDevice {
// Create a new loopback block device targeting the provided file path.
pub(crate) fn new(path: &Path) -> Result<Self> {
let dev = Task::new("losetup", "losetup")
.args(["--show", "-P", "--find"])
.args(["--show", "--direct-io=on", "-P", "--find"])
.arg(path)
.quiet()
.read()?;
Expand Down

0 comments on commit 61de519

Please sign in to comment.