summary refs log tree commit diff
path: root/seccomp
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 /seccomp
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 'seccomp')
-rw-r--r--seccomp/arm/block_device.policy2
-rw-r--r--seccomp/x86_64/block_device.policy2
2 files changed, 4 insertions, 0 deletions
diff --git a/seccomp/arm/block_device.policy b/seccomp/arm/block_device.policy
index 1ec4053..fad0cc0 100644
--- a/seccomp/arm/block_device.policy
+++ b/seccomp/arm/block_device.policy
@@ -10,7 +10,9 @@ fstat64: 1
 fsync: 1
 ftruncate64: 1
 _llseek: 1
+pread64: 1
 preadv: 1
+pwrite64: 1
 pwritev: 1
 timerfd_create: 1
 timerfd_gettime: 1
diff --git a/seccomp/x86_64/block_device.policy b/seccomp/x86_64/block_device.policy
index 6bb5c32..c1ddf26 100644
--- a/seccomp/x86_64/block_device.policy
+++ b/seccomp/x86_64/block_device.policy
@@ -10,7 +10,9 @@ fstat: 1
 fsync: 1
 ftruncate: 1
 lseek: 1
+pread64: 1
 preadv: 1
+pwrite64: 1
 pwritev: 1
 timerfd_create: 1
 timerfd_gettime: 1