Enumerations

enum DiskFormat
Name Value
kDiskFormatUnknown 0
kDiskFormatGpt 1
kDiskFormatMbr 2
kDiskFormatMinfs 3
kDiskFormatFat 4
kDiskFormatBlobfs 5
kDiskFormatFvm 6
kDiskFormatZxcrypt 7
kDiskFormatFactoryfs 8
kDiskFormatBlockVerity 9
kDiskFormatVbmeta 10
kDiskFormatFxfs 11
kDiskFormatF2fs 12
kDiskFormatNandBroker 13
kDiskFormatCount 14

Defined at line 24 of file ../../src/storage/lib/fs_management/cpp/format.h

Records

Functions

  • zx::result<bool> PartitionMatches (fidl::UnownedClientEnd<fuchsia_device::Controller> channel, const PartitionMatcher & matcher)

    Checks that |channel| is a partition which matches |matcher|.

    Defined at line 118 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • zx::result<> MkfsWithDefault (const char * device_path, FsComponent & component, const MkfsOptions & options, fidl::ClientEnd<fuchsia_fxfs::Crypt> crypt_client)

    Like Mkfs but creates a "default" volume (which will only work on multi-volume filesystems)

    and will be encrypted using `crypt_client`, if set.

    This should only be used for testing.

    Defined at line 19 of file ../../src/storage/lib/fs_management/cpp/mkfs_with_default.cc

  • zx::result<> CreateVolume (fidl::UnownedClientEnd<fuchsia_io::Directory> exposed_dir, std::string_view name, fidl::ServerEnd<fuchsia_io::Directory> outgoing_dir, fuchsia_fs_startup::wire::CreateOptions create_options, fuchsia_fs_startup::wire::MountOptions options)

    Adds volume |name| to the filesystem instance. |options.crypt| is an optional channel to a Crypt

    service, in which case the volume will be encrypted.

    On success, |outgoing_dir| will be passed to the filesystem and bound to the volume's outgoing

    directory. The channel will be closed on failure.

    Currently this is only supported for Fxfs.

    Defined at line 49 of file ../../src/storage/lib/fs_management/cpp/volumes.cc

  • zx_status_t FvmInit (fidl::UnownedClientEnd<fuchsia_storage_block::Block> device, size_t slice_size)

    Format a block device to be an empty FVM.

    Defined at line 281 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • zx_status_t FvmInitWithSize (fidl::UnownedClientEnd<fuchsia_storage_block::Block> device, uint64_t disk_size, size_t slice_size)

    Format a block device to be an empty FVM of |disk_size| size.

    Defined at line 275 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • zx_status_t Fsck (std::string_view device_path, FsComponent & component, const FsckOptions & options)

    Check and repair a device with a requested disk format.

    Defined at line 55 of file ../../src/storage/lib/fs_management/cpp/fsck.cc

  • zx_status_t FvmInitPreallocated (fidl::UnownedClientEnd<fuchsia_storage_block::Block> device, uint64_t initial_volume_size, uint64_t max_volume_size, size_t slice_size)

    Format a block device to be an empty FVM. The FVM will initially be formatted as if the block

    device had |initial_volume_size| and leave gap for metadata extension up to |max_volume_size|.

    Note: volume sizes are assumed to be multiples of the underlying block device block size.

    Defined at line 220 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • zx::result<fidl::ClientEnd<fuchsia_io::Directory>> FsRootHandle (fidl::UnownedClientEnd<fuchsia_io::Directory> export_root, fuchsia_io::wire::Flags flags)

    Get a connection to the root of the filesystem, given a filesystem outgoing directory.

    Defined at line 20 of file ../../src/storage/lib/fs_management/cpp/admin.cc

  • zx_status_t Mkfs (fidl::ClientEnd<fuchsia_storage_block::Block> device, FsComponent & component, const MkfsOptions & options)

    Defined at line 58 of file ../../src/storage/lib/fs_management/cpp/mkfs.cc

  • zx_status_t Mkfs (const char * device_path, FsComponent & component, const MkfsOptions & options)

    Defined at line 68 of file ../../src/storage/lib/fs_management/cpp/mkfs.cc

  • zx::result<> OpenVolume (fidl::UnownedClientEnd<fuchsia_io::Directory> exposed_dir, std::string_view name, fidl::ServerEnd<fuchsia_io::Directory> outgoing_dir, fuchsia_fs_startup::wire::MountOptions options)

    Opens volume |name| in the filesystem instance. |crypt_client| is an optional channel to

    a Crypt service instance, in which case the volume is decrypted using that service.

    On success, |outgoing_dir| will be passed to the filesystem and bound to the volume's outgoing

    directory. The channel will be closed on failure.

    Currently this is only supported for Fxfs.

    Defined at line 70 of file ../../src/storage/lib/fs_management/cpp/volumes.cc

  • std::string_view DiskFormatString (DiskFormat fs_type)

    Defined at line 187 of file ../../src/storage/lib/fs_management/cpp/format.cc

  • zx::result<fidl::ClientEnd<fuchsia_device::Controller>> FvmAllocatePartition (fidl::UnownedClientEnd<fuchsia_storage_block::VolumeManager> fvm, uint64_t slice_count, uuid::Uuid type_guid, uuid::Uuid instance_guid, std::string_view name, uint32_t flags)

    Allocates a new vpartition in the fvm, and waits for it to become accessible.

    Defined at line 302 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • DiskFormat DiskFormatFromString (std::string_view str)

    Defined at line 228 of file ../../src/storage/lib/fs_management/cpp/format.cc

  • zx::result<> CheckVolume (fidl::UnownedClientEnd<fuchsia_io::Directory> exposed_dir, std::string_view name, fidl::ClientEnd<fuchsia_fxfs::Crypt> crypt_client)

    Checks volume |name| in the filesystem instance. |crypt_client| is an optional channel to

    a Crypt service instance, in which case the volume is decrypted using that service.

    Currently this is only supported for Fxfs.

    Defined at line 91 of file ../../src/storage/lib/fs_management/cpp/volumes.cc

  • zx::result<fidl::ClientEnd<fuchsia_device::Controller>> FvmAllocatePartitionWithDevfs (fidl::UnownedClientEnd<fuchsia_io::Directory> devfs_root, fidl::UnownedClientEnd<fuchsia_storage_block::VolumeManager> fvm, uint64_t slice_count, uuid::Uuid type_guid, uuid::Uuid instance_guid, std::string_view name, uint32_t flags)

    Defined at line 327 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • std::string_view DiskFormatComponentUrl (DiskFormat fs_type)

    Get the component url for the disk format, if it's known. If it's not known (i.e. the format

    doesn't run as a component), this returns an empty string.

    Defined at line 246 of file ../../src/storage/lib/fs_management/cpp/format.cc

  • zx::result<> RemoveVolume (fidl::UnownedClientEnd<fuchsia_io::Directory> exposed_dir, std::string_view name)

    Defined at line 114 of file ../../src/storage/lib/fs_management/cpp/volumes.cc

  • zx::result<fuchsia_storage_block::wire::VolumeManagerInfo> FvmQuery (fidl::UnownedClientEnd<fuchsia_storage_block::VolumeManager> fvm)

    Query the volume manager for info.

    Defined at line 353 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • bool HasVolume (fidl::UnownedClientEnd<fuchsia_io::Directory> exposed_dir, std::string_view name)

    Checks if |name| exists in the filesystem instance.

    Currently this is only supported for Fxfs.

    Defined at line 129 of file ../../src/storage/lib/fs_management/cpp/volumes.cc

  • zx::result<fidl::ClientEnd<fuchsia_io::Directory>> ConnectFsComponent (std::string_view component_url, std::string_view component_child_name, std::optional<std::string_view> component_collection_name)

    Connect to a filesystem component in our realm with the given |component_child_name|, optionally

    a dynamic component in the collection named |component_collection_name|. |component_child_name|

    is required. If |component_collection_name| is unset, it's assumed that the component is a

    static child.

    If it fails to find a component with the INSTANCE_NOT_FOUND error, and the component is a

    dynamic child (i.e. |component_collection_name| is set), then it attempts to launch a new

    instance of the component using the provided |component_url|.

    In all successful cases, it returns the exposed directory associated with the launched component

    instance.

    Defined at line 72 of file ../../src/storage/lib/fs_management/cpp/component.cc

  • zx::result<> DestroyFsComponent (std::string_view component_child_name, std::string_view component_collection_name)

    Destroy a filesystem component in our realm, named |component_child_name| in the collection

    |component_collection_name|. Destruction only works on dynamic components, so the collection

    name is required. If it tries to destroy a component and gets an INSTANCE_NOT_FOUND error, it

    still returns success - the end goal of having no component with this moniker is achieved.

    Defined at line 141 of file ../../src/storage/lib/fs_management/cpp/component.cc

  • zx::result<fidl::ClientEnd<fuchsia_device::Controller>> OpenPartition (const PartitionMatcher & matcher, bool wait)

    Waits for a partition to appear which matches |matcher|, and opens it.

    Defined at line 367 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • zx::result<fidl::ClientEnd<fuchsia_device::Controller>> OpenPartitionWithDevfs (fidl::UnownedClientEnd<fuchsia_io::Directory> devfs_root, const PartitionMatcher & matcher, bool wait)

    Defined at line 378 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • zx::result<> DestroyPartition (const PartitionMatcher & matcher, bool wait)

    Finds and destroys the first partition that matches |matcher|, if any.

    Defined at line 390 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • zx::result<> DestroyPartitionWithDevfs (int devfs_root_fd, const PartitionMatcher & matcher, bool wait)

    Defined at line 409 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • DiskFormat DetectDiskFormat (fidl::UnownedClientEnd<fuchsia_storage_block::Block> device)

    Defined at line 169 of file ../../src/storage/lib/fs_management/cpp/format.cc

  • DiskFormat DetectDiskFormatLogUnknown (fidl::UnownedClientEnd<fuchsia_storage_block::Block> device)

    Defined at line 174 of file ../../src/storage/lib/fs_management/cpp/format.cc

  • zx_status_t FvmActivate (int fvm_fd, fuchsia_storage_block::wire::Guid deactivate, fuchsia_storage_block::wire::Guid activate)

    Marks one partition as active and optionally another as inactive in one atomic operation.

    If both partition GUID are the same, the partition will be activated and

    no partition will be marked inactive.

    Defined at line 430 of file ../../src/storage/lib/fs_management/cpp/fvm.cc

  • zx::result<StartedSingleVolumeFilesystem> Mount (fidl::ClientEnd<fuchsia_storage_block::Block> device, FsComponent & component, const MountOptions & options)

    Mounts a filesystem.

    device_fd : the device containing the filesystem.

    df : the format of the filesystem.

    options : mount options.

    See //src/storage/docs/launching.md for more information.

    Defined at line 259 of file ../../src/storage/lib/fs_management/cpp/mount.cc

  • zx::result<StartedMultiVolumeFilesystem> MountMultiVolume (fidl::ClientEnd<fuchsia_storage_block::Block> device, FsComponent & component, const MountOptions & options)

    Mounts a multi-volume filesystem.

    device_fd : the device containing the filesystem.

    df : the format of the filesystem.

    options : mount options.

    See //src/storage/docs/launching.md for more information.

    Defined at line 280 of file ../../src/storage/lib/fs_management/cpp/mount.cc

  • zx::result<StartedSingleVolumeMultiVolumeFilesystem> MountMultiVolumeWithDefault (fidl::ClientEnd<fuchsia_storage_block::Block> deviceFsComponent & componentconst MountOptions & optionsconst char * volume_name)

    Mounts a multi-volume filesystem using a default singular volume. Generally this is used for

    testing and production use should favour |MountMultiVolume|.

    device_fd : the device containing the filesystem.

    df : the format of the filesystem.

    options : mount options.

    volume_name : the volume to open.

    See //src/storage/docs/launching.md for more information.

    Defined at line 301 of file ../../src/storage/lib/fs_management/cpp/mount.cc

Variables

const std::string_view kPathData

Defined at line 19 of file ../../src/storage/lib/fs_management/cpp/admin.h

const std::string_view kPathInstall

Defined at line 20 of file ../../src/storage/lib/fs_management/cpp/admin.h

const std::string_view kPathDurable

Defined at line 21 of file ../../src/storage/lib/fs_management/cpp/admin.h

const std::string_view kPathSystem

Defined at line 22 of file ../../src/storage/lib/fs_management/cpp/admin.h

const std::string_view kPathBlob

Defined at line 23 of file ../../src/storage/lib/fs_management/cpp/admin.h

const std::string_view kPathFactory

Defined at line 24 of file ../../src/storage/lib/fs_management/cpp/admin.h

const std::string_view kPathVolume

Defined at line 25 of file ../../src/storage/lib/fs_management/cpp/admin.h

const std::string_view kPathDevBlock

Defined at line 26 of file ../../src/storage/lib/fs_management/cpp/admin.h

const int kHeaderSize

Defined at line 49 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[16] kMinfsMagic

Defined at line 51 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[16] kBlobfsMagic

Defined at line 55 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[16] kGptMagic

Defined at line 59 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[8] kFvmMagic

Defined at line 63 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[16] kZxcryptMagic

Defined at line 67 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[16] kBlockVerityMagic

Defined at line 71 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[4] kVbmetaMagic

Defined at line 74 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[4] kF2fsMagic

Defined at line 81 of file ../../src/storage/lib/fs_management/cpp/format.h

const uint8_t[8] kFxfsMagic

Defined at line 88 of file ../../src/storage/lib/fs_management/cpp/format.h