mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-10-23 12:49:55 +00:00
1cad723426
https://crrev.com/c/5019243 added a `once_cell::unsync::OnceCell` to `IoSource`, making it `!Sync`, which, by definition, makes `&IoSource` `!Send` and so (nearly) any future that does IO will be `!Send`. This commit removes the `OnceCell` from `IoSource`, making it `Sync` again. Instead, we eagerly check whether a backing file is a block device when the file is converted to an `AsyncDisk` so that the result is a plain `bool` and move the branch into `SingleDiskFile::punch_hole`. The other `AsyncDisk` implementors don't need this logic. "android_sparse" is read-only (i.e. you can't punch a hole). "composite_disk" delegates hole punching to the backing disk. "qcow" might benefit from it, but it doesn't use async yet, so there is no regression. BUG=b:271297810 Change-Id: Ifd1d2361adabfd4db1b48e71d3a3a31e57a0cfb1 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5086673 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |