summary refs log tree commit diff
path: root/sys_util/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2019-11-12 14:02:16 -0800
committerCommit Bot <commit-bot@chromium.org>2019-11-27 21:22:37 +0000
commit6eadef77a349127a013f22f58518a6bf7852d4f5 (patch)
tree4cd532a90018aa90283c22bcd28a9ef9a939ac4d /sys_util/src/lib.rs
parent3064a7164a504e1e096e6021683d6cc2282147c4 (diff)
downloadcrosvm-6eadef77a349127a013f22f58518a6bf7852d4f5.tar
crosvm-6eadef77a349127a013f22f58518a6bf7852d4f5.tar.gz
crosvm-6eadef77a349127a013f22f58518a6bf7852d4f5.tar.bz2
crosvm-6eadef77a349127a013f22f58518a6bf7852d4f5.tar.lz
crosvm-6eadef77a349127a013f22f58518a6bf7852d4f5.tar.xz
crosvm-6eadef77a349127a013f22f58518a6bf7852d4f5.tar.zst
crosvm-6eadef77a349127a013f22f58518a6bf7852d4f5.zip
sys_util: add WriteZeroesAt trait
Add a variant of WriteZeroes that allows the caller to specify the
offset explicitly instead of using the file's cursor.  This gets rid of
one of the last bits of shared state between disk file users, which will
help in implementing multi-queue support.

Additionally, modify the WriteZeroes trait to use a generic
implementation based on WriteZeroesAt + Seek when possible.

BUG=chromium:858815
TEST=Boot Termina in crosvm

Change-Id: If710159771aeeb55f4f7746dd4354b6c042144e8
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1913519
Diffstat (limited to 'sys_util/src/lib.rs')
-rw-r--r--sys_util/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys_util/src/lib.rs b/sys_util/src/lib.rs
index 331dbac..31b1662 100644
--- a/sys_util/src/lib.rs
+++ b/sys_util/src/lib.rs
@@ -70,7 +70,7 @@ pub use crate::guest_memory::Error as GuestMemoryError;
 pub use crate::mmap::Error as MmapError;
 pub use crate::seek_hole::SeekHole;
 pub use crate::signalfd::Error as SignalFdError;
-pub use crate::write_zeroes::{PunchHole, WriteZeroes};
+pub use crate::write_zeroes::{PunchHole, WriteZeroes, WriteZeroesAt};
 
 use std::ffi::CStr;
 use std::fs::{remove_file, File};