Module ext2

Source
Expand description

Provides a function to launches 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 initialization steps. Also, we can use different seccomp policy for (b) and (c).

The overall workflow is like the followings:

  1. At (a): launch() is called from (a)
  2. At (a): (b) is forked 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.

Structs§

PmemExt2Option
VirtioPmemExt2Module

Functions§

launch 🔒
Starts a process to create an ext2 filesystem on a given shared memory region.
mkfs_callback 🔒
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.