Module crosvm::crosvm::sys::linux::ext2

source ·
Expand description

Provides a function to lanunches a process of creating ext2 filesystem on memory region asynchronously for pmem-ext2 device.

The ext2 file system is created in the memory area for pmem by the following three processes: (a). The main process (b). ext2 process launched by the launch() below. (c). The virtio-pmem process

By executing mkfs in the multiple processes, mkfs won’t block other initalization steps. Also, we can use different seccopm poliy for (b) and (c).

The overall workflow is like the followings:

  1. At (a): launch() is called from (a)
  2. At (a): (b) is foked from (a) in launch()
  3. At (b): The given directory is traversed and metadata is constructed.
  4. At (b): File descriptors are sent to (a) with VmMemoryRequest::MmapAndRegisterMemory.
  5. At (a): mmap() for the file descriptors are called. The reply is sent to (b).
  6. At (b): memory slot number is sent to (c).
  7. At (c): device activation finished.

Functions§

  • Starts a process to create an ext2 filesystem on a given shared memory region.
  • A callback to create a ext2 file system on shm. This is supposed to be run in a jailed child process so operations are sandboxed and limited.