In the current implementation, the data structure of superblock is
allocated on heap first and written into MemoryMapping area at the
end.
Instead, this CL implements an arena allocator over MemoryMapping
so we can prepare MemoryMapping first and allocate superblock and
other data structures on the area.
BUG=b:331531953
TEST=cargo test
Change-Id: Ie292d448f1c7bce7a23c8194b9e30e5f278ba2c6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5490599
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Add a logic to create a valid superblock.
This crate is supposed to be used for implementing virito-pmem-ext2,
which is a virtio-pmem where ext2 file system is constructed at
boot time. See go/virtio-pmem-ext2 for the details.
BUG=b:329359333
TEST=cargo test
Change-Id: Ib86c0c8e9562e885266d3b321f9f2e302581b90a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5404370
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>