class Minfs
Defined at line 175 of file ../../src/storage/minfs/minfs_private.h
Used by fsck
Public Members
unique_ptr bc_
Public Methods
void EnqueueAllocation (std::unique_ptr<PendingWork> transaction)
bool AllReservationsBacked (const Transaction & )
Return true if the all outstanding block reservations are backed by persistent storage
(i.e. the volume has already been extended to cover all reservations).
Requires a Transaction to ensure the transaction lock is held.
Defined at line 94 of file ../../src/storage/minfs/minfs_target.cc
zx::result<> BlockingJournalSync ()
Issues a sync to the journal's background thread and waits for it to complete.
Defined at line 101 of file ../../src/storage/minfs/minfs_target.cc
void Minfs (const Minfs & )
Not copyable or movable
Defined at line 178 of file ../../src/storage/minfs/minfs_private.h
Minfs & operator= (const Minfs & )
Defined at line 179 of file ../../src/storage/minfs/minfs_private.h
void Minfs (Minfs && )
Defined at line 180 of file ../../src/storage/minfs/minfs_private.h
Minfs & operator= (Minfs && )
Defined at line 181 of file ../../src/storage/minfs/minfs_private.h
zx::result<> InodeUpdate (PendingWork *transaction,ino_tino,const Inode *inode)
Writes back an inode into the inode table on persistent storage.
Does not modify inode bitmap.
Defined at line 247 of file ../../src/storage/minfs/minfs_private.h
zx::result<Inode> InodeLoad (ino_t ino)
Reads an inode from the inode table into memory.
Defined at line 252 of file ../../src/storage/minfs/minfs_private.h
void ValidateBno (blk_t bno)
Defined at line 254 of file ../../src/storage/minfs/minfs_private.h
size_t WritebackCapacity ()
Returns the capacity of the writeback buffer, in blocks.
Defined at line 285 of file ../../src/storage/minfs/minfs_private.h
MinfsInspectTree * InspectTree ()
Mutable pointer to the MinfsInspectTree this object uses for metrics. Guaranteed non-nullptr.
Defined at line 315 of file ../../src/storage/minfs/minfs_private.h
fs_inspect::NodeOperations * GetNodeOperations ()
Defined at line 317 of file ../../src/storage/minfs/minfs_private.h
fs_inspect::NodeOperations * GetNodeOperations ()
Defined at line 319 of file ../../src/storage/minfs/minfs_private.h
const Superblock & Info ()
Returns an immutable reference to the superblock.
Defined at line 326 of file ../../src/storage/minfs/minfs_private.h
uint64_t BlockSize ()
Defined at line 328 of file ../../src/storage/minfs/minfs_private.h
const InspectableInodeManager * GetInodeManager ()
Gets an immutable reference to the InodeManager.
Defined at line 339 of file ../../src/storage/minfs/minfs_private.h
const Allocator & GetBlockAllocator ()
Gets an immutable reference to the block_allocator.
Defined at line 342 of file ../../src/storage/minfs/minfs_private.h
size_t BlocksAvailable ()
Returns number of blocks available.
Defined at line 344 of file ../../src/storage/minfs/minfs_private.h
size_t BlocksReserved ()
Returns number of reserved blocks but are yet to be allocated.
This helps to determine if we should fail incoming writes because we will
run out of space.
Defined at line 349 of file ../../src/storage/minfs/minfs_private.h
BlockOffsets GetBlockOffsets ()
Gets an immutable copy of offsets_.
Defined at line 353 of file ../../src/storage/minfs/minfs_private.h
const TransactionLimits & Limits ()
Defined at line 356 of file ../../src/storage/minfs/minfs_private.h
fbl::Mutex * GetLock ()
Defined at line 359 of file ../../src/storage/minfs/minfs_private.h
Bcache * GetMutableBcache ()
Defined at line 370 of file ../../src/storage/minfs/minfs_private.h
Allocator & GetBlockAllocator ()
Defined at line 375 of file ../../src/storage/minfs/minfs_private.h
Allocator & GetInodeAllocator ()
Defined at line 376 of file ../../src/storage/minfs/minfs_private.h
const MountOptions & mount_options ()
Defined at line 378 of file ../../src/storage/minfs/minfs_private.h
PlatformVfs * vfs ()
Defined at line 380 of file ../../src/storage/minfs/minfs_private.h
void ~Minfs ()
Defined at line 823 of file ../../src/storage/minfs/minfs.cc
std::unique_ptr<Bcache> Destroy (std::unique_ptr<Minfs> minfs)
Destroys a "minfs" object, but take back ownership of the bcache object.
Defined at line 573 of file ../../src/storage/minfs/minfs.cc
void Terminate ()
Terminates Minfs and joins all background threads. This will not necessarily guarantee all
all data has been flushed. Call Sync first if that matters.
Defined at line 578 of file ../../src/storage/minfs/minfs.cc
zx::result<std::unique_ptr<Minfs>> Create (FuchsiaDispatcherdispatcher,std::unique_ptr<Bcache>bc,const MountOptions &options,PlatformVfs *vfs)
Defined at line 1258 of file ../../src/storage/minfs/minfs.cc
zx::result<std::unique_ptr<Minfs>> Create (FuchsiaDispatcherdispatcher,std::unique_ptr<Bcache>bc,const MountOptions &options,PlatformVfs *vfs)
Defined at line 1258 of file ../../src/storage/minfs/minfs.cc
zx::result<> InitializeJournal (fs::JournalSuperblock journal_superblock)
Initializes the Minfs journal and writeback queue and resolves any pending disk state (e.g.,
resolving unlinked nodes and existing journal entries).
Defined at line 1410 of file ../../src/storage/minfs/minfs.cc
zx_status_t InitializeUnjournalledWriteback ()
Initializes the Minfs writeback queue and resolves any pending disk state (e.g., resolving
unlinked nodes and existing journal entries). Does not enable the journal.
zx::result<fbl::RefPtr<VnodeMinfs>> VnodeGet (ino_t ino)
instantiate a vnode from an inode
the inode must exist in the file system
Defined at line 1107 of file ../../src/storage/minfs/minfs.cc
zx::result<fbl::RefPtr<VnodeMinfs>> VnodeNew (Transaction * transaction, uint32_t type)
instantiate a vnode with a new inode
Defined at line 1060 of file ../../src/storage/minfs/minfs.cc
void VnodeInsert (VnodeMinfs * vn)
Insert, lookup, and remove vnode from hash map.
Defined at line 1080 of file ../../src/storage/minfs/minfs.cc
fbl::RefPtr<VnodeMinfs> VnodeLookup (uint32_t ino)
Defined at line 1090 of file ../../src/storage/minfs/minfs.cc
void VnodeRelease (VnodeMinfs * vn)
Defined at line 1100 of file ../../src/storage/minfs/minfs.cc
zx::result<fbl::RefPtr<VnodeMinfs>> OpenRootNode ()
Opens the root inode. This is a special-case of VnodeGet for filesystem bootstrapping.
Defined at line 1453 of file ../../src/storage/minfs/minfs.cc
void BlockNew (PendingWork * transaction, blk_t * out_bno)
Allocate a new data block.
Defined at line 1137 of file ../../src/storage/minfs/minfs.cc
void UpdateFlags (PendingWork *transaction,uint32_tflags,boolset)
Set/Unset the flags.
Defined at line 1143 of file ../../src/storage/minfs/minfs.cc
void BlockSwap (Transaction *transaction,blk_tin_bno,blk_t *out_bno)
Mark |in_bno| for de-allocation (if it is > 0), and return a new block |*out_bno|.
The swap will not be persisted until the transaction is commited.
Defined at line 1153 of file ../../src/storage/minfs/minfs.cc
zx::result<> InoFree (Transaction * transaction, VnodeMinfs * vn)
Free ino in inode bitmap, release all blocks held by inode.
Defined at line 825 of file ../../src/storage/minfs/minfs.cc
void AddUnlinked (PendingWork * transaction, VnodeMinfs * vn)
Mark |vn| to be unlinked.
Defined at line 845 of file ../../src/storage/minfs/minfs.cc
void RemoveUnlinked (PendingWork * transaction, VnodeMinfs * vn)
Remove |vn| from the list of unlinked vnodes.
Defined at line 871 of file ../../src/storage/minfs/minfs.cc
zx::result<> PurgeUnlinked ()
Free resources of all vnodes marked unlinked.
Defined at line 903 of file ../../src/storage/minfs/minfs.cc
zx::result<std::unique_ptr<Transaction>> BeginTransaction (size_t reserve_inodes, size_t reserve_blocks)
Defined at line 611 of file ../../src/storage/minfs/minfs.cc
zx::result<> ContinueTransaction (size_treserve_blocks,std::unique_ptr<CachedBlockTransaction>cached_transaction,std::unique_ptr<Transaction> *out)
Converts a cached transaction into a Transaction. Extends block reservation
by |reserve_blocks|.
On failure to reserve blocks, returns error but |out| will have a transaction
that was converted.
Defined at line 44 of file ../../src/storage/minfs/minfs_target.cc
void EnqueueCallback (SyncCallback callback)
Defined at line 665 of file ../../src/storage/minfs/minfs.cc
bool IsJournalErrored ()
Defined at line 15 of file ../../src/storage/minfs/minfs_target.cc
void CommitTransaction (std::unique_ptr<Transaction> transaction)
Complete a transaction by enqueueing its WritebackWork to the WritebackQueue.
Defined at line 697 of file ../../src/storage/minfs/minfs.cc
void FsckAtEndOfTransaction ()
Runs fsck at the end of a transaction, just after metadata has been written. Used for testing
to be sure that all transactions leave the file system in a good state.
Defined at line 760 of file ../../src/storage/minfs/minfs.cc
zx::result<fs::FilesystemInfo> GetFilesystemInfo ()
Defined at line 1467 of file ../../src/storage/minfs/minfs.cc
void Sync (SyncCallback closure)
Signals the completion object as soon as the journal has finished synchronizing.
Defined at line 774 of file ../../src/storage/minfs/minfs.cc
zx::result<> ReadDat (blk_t bno, void * data)
The following methods are used to read one block from the specified extent,
from relative block |bno|.
|data| is an out parameter that must be a block in size, provided by the caller
These functions are single-block and synchronous. On Fuchsia, using the batched read
functions is preferred.
Defined at line 1720 of file ../../src/storage/minfs/minfs.cc
fbl::Vector<BlockRegion> GetAllocatedRegions ()
Record the location, size, and number of all non-free block regions.
Defined at line 1811 of file ../../src/storage/minfs/minfs.cc
void StopWriteback ()
Terminates all writeback queues, and flushes pending operations to the underlying device.
If |!IsReadonly()|, also sets the dirty bit to a "clean" status.
Defined at line 1008 of file ../../src/storage/minfs/minfs.cc
zx::result<zx::vmo> LoadVnodeVmo (VnodeIterator iterator, uint64_t block_count)
Reads |block_count| blocks from |iterator| into a VMO and returns it. The returned VMO is
resizable.
An internal VMO is used to read the pages from the block device and the pages are then
transferred to the returned VMO. This avoids registering and unregistering a new VMO for every
request but comes with the downside that this function can't be run concurrently. Minfs is
single threaded so this shouldn't be an issue.
Defined at line 1817 of file ../../src/storage/minfs/minfs.cc