Enumerations

enum Writability
Name Value
ReadOnlyDisk 0
ReadOnlyFilesystem 1
Writable 2

Defined at line 19 of file ../../src/storage/minfs/mount.h

enum IntegrityCheck
Name Value
kNone 0
kAll 1

Controls the validation-checking performed by minfs when loading

structures from disk.

Defined at line 24 of file ../../src/storage/minfs/minfs.h

enum BlockType
Name Value
kDirect 0
kIndirect 1
kDoubleIndirect 2

Defined at line 28 of file ../../src/storage/minfs/fsck.h

enum UpdateBackupSuperblock
Name Value
kNoUpdate 0
kUpdate 1

Indicates whether to update backup superblock.

Defined at line 35 of file ../../src/storage/minfs/minfs.h

Records

Functions

  • blk_t GetBlockBitmapBlocks (const Superblock & info)

    Calculates and returns the maximum number of block bitmap blocks, based on |info_|.

    Defined at line 19 of file ../../src/storage/minfs/transaction_limits.cc

  • fs_inspect::UsageData CalculateSpaceUsage (const Superblock & superblock, uint64_t reserved_blocks)

    Defined at line 14 of file ../../src/storage/minfs/minfs_inspect_tree.cc

  • zx::result<blk_t> GetRequiredBlockCount (size_t offset, size_t length, size_t block_size)

    Returns the required number of blocks for a write at the given |offset|

    and |length|.

    Defined at line 31 of file ../../src/storage/minfs/transaction_limits.cc

  • zx::result<CreateBcacheResult> CreateBcache (std::unique_ptr<block_client::BlockDevice> device)

    Creates a Bcache using |device|.

    Returns the bcache and a boolean indicating if the underlying device is read-only.

    Defined at line 21 of file ../../src/storage/minfs/mount.cc

  • int LLVMFuzzerTestOneInput (const uint8_t * data, size_t size)

    Defined at line 37 of file ../../src/storage/minfs/test/unit/fuzz.cc

  • zx::result<> Mkfs (Bcache * bc)

    Format the partition backed by |bc| as MinFS.

    Defined at line 46 of file ../../src/storage/minfs/minfs.h

  • zx::result<> Mount (std::unique_ptr<minfs::Bcache> bcache, const MountOptions & options, fidl::ServerEnd<fuchsia_io::Directory> root)

    Start the filesystem on the block device backed by |bcache|, and serve it on |root|. Blocks

    until the filesystem terminates.

    Defined at line 60 of file ../../src/storage/minfs/mount.cc

  • template <typename BlockType, typename F>
    zx::result<> EnumerateBlocks (range::Range<BlockType> range, F callback)

    Helpers that will call |callback| for all the blocks that encompass the range, which

    is in blocks. |callback| is of the form:

    zx::result

    <uint64

    _t> callback(range::Range

    <BlockType

    > range);

    |callback| can modify |block_count| to indicate how many blocks it processed if less than all of

    the blocks, or leave it unchanged if all blocks are processed.

    Defined at line 78 of file ../../src/storage/minfs/block_utils.h

  • zx::result<> StartComponent (fidl::ServerEnd<fuchsia_io::Directory> root, fidl::ServerEnd<fuchsia_process_lifecycle::Lifecycle> lifecycle)

    Defined at line 84 of file ../../src/storage/minfs/mount.cc

  • uint64_t BlocksRequiredForInode (uint64_t inode_count)

    Returns number of blocks required to store inode_count inodes

    Defined at line 92 of file ../../src/storage/minfs/fsck.h

  • template <typename F>
    zx::result<> EnumerateBlocks (ByteRange range, unsigned int block_size, F callback)

    Same, but for bytes rather than blocks. It will enumerate all blocks touched by the range.

    Defined at line 93 of file ../../src/storage/minfs/block_utils.h

  • uint64_t BlocksRequiredForBits (uint64_t bit_count)

    Returns number of blocks required to store bit_count bits

    Defined at line 97 of file ../../src/storage/minfs/fsck.h

  • uint32_t MinfsMagic (uint32_t T)

    clang-format on

    Defined at line 98 of file ../../src/storage/minfs/format.h

  • uint32_t MinfsMagicType (uint32_t n)

    Defined at line 101 of file ../../src/storage/minfs/format.h

  • uint32_t DirentSize (uint8_t namelen)

    Returns the length of the Dirent structure required to hold a name of the given length. See

    also DirentReservedSize().

    Defined at line 268 of file ../../src/storage/minfs/format.h

  • uint32_t DirentReservedSize (Dirent * de, size_t off)

    Returns the data size reserved to this Dirent. For the last one, this will be the size from the

    beginning of it to the max space available for all records in a directory. For others, only

    part of this data may be used, see DirentSize().

    Defined at line 298 of file ../../src/storage/minfs/format.h

  • void SetMinfsFlagFvm (Superblock & info)

    Sets kMinfsFlagFVM for given superblock.

    Defined at line 325 of file ../../src/storage/minfs/format.h

  • uint64_t InodeBitmapBlocks (const Superblock & info)

    Defined at line 327 of file ../../src/storage/minfs/format.h

  • uint64_t BlockBitmapBlocks (const Superblock & info)

    Defined at line 336 of file ../../src/storage/minfs/format.h

  • uint64_t InodeBlocks (const Superblock & info)

    Defined at line 345 of file ../../src/storage/minfs/format.h

  • uint64_t JournalStartBlock (const Superblock & info)

    Defined at line 354 of file ../../src/storage/minfs/format.h

  • uint64_t JournalBlocks (const Superblock & info)

    Defined at line 362 of file ../../src/storage/minfs/format.h

  • void DumpInfo (const Superblock & info)

    Defined at line 370 of file ../../src/storage/minfs/minfs.cc

  • zx_time_t GetTimeUTC ()

    Defined at line 363 of file ../../src/storage/minfs/minfs.cc

  • uint64_t DataBlocks (const Superblock & info)

    Defined at line 371 of file ../../src/storage/minfs/format.h

  • uint64_t NonDataBlocks (const Superblock & info)

    Defined at line 380 of file ../../src/storage/minfs/format.h

  • zx::result<> CheckSuperblock (const Superblock & info, block_client::BlockDevice * device, uint32_t max_blocks)

    Validates header information.

    Defined at line 412 of file ../../src/storage/minfs/minfs.cc

  • zx::result<> Mkfs (const MountOptions & options, Bcache * bc)

    Format the partition backed by |bc| as MinFS.

    Defined at line 1393 of file ../../src/storage/minfs/minfs.cc

  • zx::result<uint64_t> UsedDataSize (std::unique_ptr<Bcache> & bc)

    On success, returns ZX_OK and copies the number of bytes used by data

    within the fs.

    Defined at line 999 of file ../../src/storage/minfs/fsck.cc

  • zx::result<uint64_t> UsedInodes (std::unique_ptr<Bcache> & bc)

    On success, returns ZX_OK and copies the number of allocated

    inodes within the fs.

    Defined at line 1011 of file ../../src/storage/minfs/fsck.cc

  • zx::result<uint64_t> UsedSize (std::unique_ptr<Bcache> & bc)

    On success, returns ZX_OK and copies the number of bytes used by data

    and bytes reserved for superblock, bitmaps, inodes and journal within the fs.

    Defined at line 1021 of file ../../src/storage/minfs/fsck.cc

  • zx::result<uint32_t> CalculateBitsSetBitmap (fs::TransactionHandler * transaction_handler, block_client::BlockDevice * device, blk_t start_block, uint32_t num_blocks)

    Defined at line 1033 of file ../../src/storage/minfs/fsck.cc

  • zx::result<uint32_t> CalculateBitsSetBitmap (fs::TransactionHandler * transaction_handler, blk_t start_block, uint32_t num_blocks)

    Defined at line 1037 of file ../../src/storage/minfs/fsck.cc

  • zx::result<> ReconstructAllocCounts (fs::TransactionHandler * transaction_handler, block_client::BlockDevice * device, Superblock * out_info)

    Reconstructs and updates the alloc_*_counts of superblock.

    Defined at line 1092 of file ../../src/storage/minfs/fsck.cc

  • zx::result<> CheckSuperblock (const Superblock & info, uint32_t max_blocks)

    Validates header information.

    Defined at line 415 of file ../../src/storage/minfs/minfs.cc

  • zx::result<> ReconstructAllocCounts (fs::TransactionHandler * transaction_handler, Superblock * out_info)

    Reconstructs and updates the alloc_*_counts of superblock.

    Defined at line 1095 of file ../../src/storage/minfs/fsck.cc

  • void UpdateChecksum (Superblock * info)

    Updates generation_count and checksum of the superblock.

    Defined at line 404 of file ../../src/storage/minfs/minfs.cc

  • zx::result<Superblock> LoadSuperblock (Bcache * bc)

    Loads superblock from disk and checks it for integrity.

    Defined at line 979 of file ../../src/storage/minfs/fsck.cc

  • zx::result<Superblock> RepairSuperblock (fs::DeviceTransactionHandler * transaction_handler, block_client::BlockDevice * device, uint32_t max_blocks)

    Defined at line 934 of file ../../src/storage/minfs/fsck.cc

  • zx::result<std::unique_ptr<Bcache>> Fsck (std::unique_ptr<Bcache> bc, const FsckOptions & options)

    Run fsck on an unmounted filesystem backed by |bc|.

    Invokes CheckSuperblock, and repairs filesystem if needed.

    On success, returns bcache to |out_bc|, if supplied.

    Defined at line 1134 of file ../../src/storage/minfs/fsck.cc

  • zx::result<std::unique_ptr<minfs::Bcache>> CreateBcacheFromFd (fbl::unique_fd fd, off_t start, off_t end, const fbl::Vector<size_t> & extent_lengths)

    Defined at line 1636 of file ../../src/storage/minfs/minfs.cc

  • zx_status_t SparseUsedDataSize (fbl::unique_fd fd, off_t start, off_t end, const fbl::Vector<size_t> & extent_lengths, uint64_t * out_size)

    Copies into |out_size| the number of bytes used by data in fs contained in a partition between

    bytes |start| and |end| in fd. extent_lengths is lengths of each extent (in bytes).

  • zx::result<uint64_t> SparseUsedDataSize (fbl::unique_fd fd, off_t start, off_t end, const fbl::Vector<size_t> & extent_lengths)

    Defined at line 1675 of file ../../src/storage/minfs/minfs.cc

  • zx_status_t SparseUsedInodes (fbl::unique_fd fd, off_t start, off_t end, const fbl::Vector<size_t> & extent_lengths, uint64_t * out_inodes)

    Copies into |out_inodes| the number of allocated inodes in fs contained in a partition

    between bytes |start| and |end| fd. extent_lengths is lengths of each extent (in bytes).

  • zx::result<fs::JournalSuperblock> ReplayJournal (Bcache * bc, const Superblock & info)

    Replay the minfs journal, given the sizes provided within the superblock.

    Defined at line 1290 of file ../../src/storage/minfs/minfs.cc

  • void DumpInode (const Inode * inode, ino_t ino)

    Defined at line 397 of file ../../src/storage/minfs/minfs.cc

  • void InitializeDirectory (void * bdata, ino_t ino_self, ino_t ino_parent)

    Defined at line 1069 of file ../../src/storage/minfs/minfs.cc

  • zx::result<uint64_t> SparseUsedInodes (fbl::unique_fd fd, off_t start, off_t end, const fbl::Vector<size_t> & extent_lengths)

    Defined at line 1684 of file ../../src/storage/minfs/minfs.cc

  • zx::result<uint64_t> SparseUsedSize (fbl::unique_fd fd, off_t start, off_t end, const fbl::Vector<size_t> & extent_lengths)

    Defined at line 1693 of file ../../src/storage/minfs/minfs.cc

  • zx_status_t SparseUsedSize (fbl::unique_fd fd, off_t start, off_t end, const fbl::Vector<size_t> & extent_lengths, uint64_t * out_size)

    Copies into |out_size| the number of bytes used by data and bytes reserved for superblock,

    bitmaps, inodes and journal on fs contained in a partition between bytes |start| and |end| in fd.

    extent_lengths is lengths of each extent (in bytes).

  • void SyncVnode (fbl::RefPtr<VnodeMinfs> vnuint32_t flags)

    write the inode data of this vnode to disk (default does not update time values)