class Blobfs
Defined at line 72 of file ../../src/storage/blobfs/blobfs.h
Public Methods
void Blobfs (Blobfs && )
Defined at line 74 of file ../../src/storage/blobfs/blobfs.h
void Blobfs (const Blobfs & )
Defined at line 74 of file ../../src/storage/blobfs/blobfs.h
Blobfs & operator= (const Blobfs & )
Defined at line 74 of file ../../src/storage/blobfs/blobfs.h
Blobfs & operator= (Blobfs && )
Defined at line 74 of file ../../src/storage/blobfs/blobfs.h
fs_inspect::NodeOperations & node_operations ()
Defined at line 118 of file ../../src/storage/blobfs/blobfs.h
zx::result<std::unique_ptr<Blobfs>> Create (async_dispatcher_t * dispatcher, std::unique_ptr<BlockDevice> device, fs::PagedVfs * vfs, const MountOptions & options)
Creates a blobfs object.
The dispatcher should be for the current thread that blobfs is running on. The vfs is required
for paging but can be null in host configurations.
Defined at line 129 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t LoadAndVerifyBlob (uint32_t node_index)
Loads the blob with inode |node_index| and verifies that the contents of the blob are valid.
Discards the blob's data after performing verification.
fs::PagedVfs * vfs ()
The Vfs object associated with this Blobfs instance, if any. The Vfs will exist only when
running on the target and will be null otherwise.
Defined at line 91 of file ../../src/storage/blobfs/blobfs.h
uint64_t BlockNumberToDevice (uint64_t block_num)
TransactionManager's fs::TransactionHandler interface.
Allows transmitting read and write transactions directly to the underlying storage.
Defined at line 96 of file ../../src/storage/blobfs/blobfs.h
block_client::BlockDevice * GetDevice ()
Defined at line 99 of file ../../src/storage/blobfs/blobfs.h
const Superblock & Info ()
TransactionManager's SpaceManager interface.
Allows viewing and controlling the size of the underlying volume.
Defined at line 104 of file ../../src/storage/blobfs/blobfs.h
const std::shared_ptr<BlobfsMetrics> & GetMetrics ()
TODO(https://fxbug.dev/42160612): Move ownership of metrics_ to inspect_tree_, and remove use
of shared ownership (all uses of this function take mutable pointers to this object already, or
bypass the use of shared ownership entirely by calling |get()| on the shared_ptr.
Defined at line 123 of file ../../src/storage/blobfs/blobfs.h
fs::Journal * GetJournal ()
TransactionManager interface.
Allows attaching VMOs, controlling the underlying volume, and sending transactions to the
underlying storage (optionally through the journal).
Defined at line 129 of file ../../src/storage/blobfs/blobfs.h
size_t WriteBufferBlockCount ()
Defined at line 136 of file ../../src/storage/blobfs/blobfs.h
Writability writability ()
Defined at line 142 of file ../../src/storage/blobfs/blobfs.h
async_dispatcher_t * dispatcher ()
Returns the dispatcher for the current thread that blobfs uses.
Defined at line 145 of file ../../src/storage/blobfs/blobfs.h
bool CheckBlocksAllocated (uint64_t start_block, uint64_t end_block, uint64_t * first_unset)
Defined at line 147 of file ../../src/storage/blobfs/blobfs.h
NodeFinder * GetNodeFinder ()
Defined at line 152 of file ../../src/storage/blobfs/blobfs.h
Allocator * GetAllocator ()
Defined at line 154 of file ../../src/storage/blobfs/blobfs.h
zx::result<InodePtr> GetNode (uint32_t node_index)
Defined at line 156 of file ../../src/storage/blobfs/blobfs.h
BlobCache & GetCache ()
Defined at line 162 of file ../../src/storage/blobfs/blobfs.h
BlockDevice * Device ()
Defined at line 166 of file ../../src/storage/blobfs/blobfs.h
BlobLoader & loader ()
Defined at line 186 of file ../../src/storage/blobfs/blobfs.h
PageLoader & page_loader ()
Defined at line 187 of file ../../src/storage/blobfs/blobfs.h
DecompressorCreatorConnector * decompression_connector ()
Defined at line 206 of file ../../src/storage/blobfs/blobfs.h
std::unique_ptr<BlockDevice> Destroy (std::unique_ptr<Blobfs> blobfs)
Defined at line 429 of file ../../src/storage/blobfs/blobfs.cc
void ~Blobfs ()
Defined at line 433 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t BlockAttachVmo (const zx::vmo & vmo, storage::Vmoid * out)
Defined at line 637 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t BlockDetachVmo (storage::Vmoid vmoid)
Defined at line 646 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t AddInodes (Allocator * allocator)
Defined at line 650 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t AddBlocks (size_t nblocks, RawBitmap * block_map)
Defined at line 713 of file ../../src/storage/blobfs/blobfs.cc
zx::result<fs::FilesystemInfo> GetFilesystemInfo ()
Returns filesystem specific information.
Defined at line 780 of file ../../src/storage/blobfs/blobfs.cc
BlobLayoutFormat BlobWriteFormat ()
Defined at line 384 of file ../../src/storage/blobfs/blobfs.cc
BlobOverwriteConfig OverwriteConfig ()
Defined at line 395 of file ../../src/storage/blobfs/blobfs.cc
void SetOverwriteConfig (BlobOverwriteConfig config)
Defined at line 397 of file ../../src/storage/blobfs/blobfs.cc
zx::result<BlockIterator> BlockIteratorByNodeIndex (uint32_t node_index)
BlockIteratorProvider interface.
Allows clients to acquire a block iterator for a given node index.
Defined at line 805 of file ../../src/storage/blobfs/blobfs.cc
zx::result<std::unique_ptr<Blobfs>> Create (fbl::unique_fd blockfd, off_t offset, const info_block_t & info_block, const fbl::Array<size_t> & extent_lengths)
Creates an instance of Blobfs from the file at |blockfd|. The blobfs partition is expected to
start at |offset| bytes into the file.
Defined at line 528 of file ../../src/storage/blobfs/host.cc
zx::result<> AddBlob (const BlobInfo & blob_info)
Adds a blob to the filesystem.
Defined at line 609 of file ../../src/storage/blobfs/host.cc
uint64_t GetBlockSize ()
Defined at line 928 of file ../../src/storage/blobfs/host.cc
zx_status_t OpenRootNode (fbl::RefPtr<fs::Vnode> * out)
Invokes "open" on the root directory.
Acts as a special-case to bootstrap filesystem mounting.
Defined at line 1085 of file ../../src/storage/blobfs/blobfs.cc
fpromise::result<void, std::string> VisitBlobs (BlobVisitor visitor)
Calls |visitor| on each of the existing blobs. Errors on |visitor| will be forwarded to the
caller, and will stop the iteration.
Defined at line 930 of file ../../src/storage/blobfs/host.cc
zx_status_t Readdir (fs::VdirCookie * cookie, void * dirents, size_t len, size_t * out_actual)
Defined at line 600 of file ../../src/storage/blobfs/blobfs.cc
zx::result<std::unique_ptr<Superblock>> ReadBackupSuperblock ()
Defined at line 989 of file ../../src/storage/blobfs/host.cc
void Sync (SyncCallback cb)
Defined at line 814 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t FreeInode (uint32_t node_index, BlobTransaction & transaction)
Frees an inode, from both the reserved map and the inode table. If the
inode was allocated in the inode table, write the deleted inode out to
disk. Returns an error if the inode could not be freed.
Defined at line 484 of file ../../src/storage/blobfs/blobfs.cc
void PersistNode (uint32_t node_index, BlobTransaction & transaction)
Writes node data to the inode table and updates disk.
Defined at line 525 of file ../../src/storage/blobfs/blobfs.cc
void PersistBlocks (const ReservedExtent & reserved_extent, BlobTransaction & transaction)
Adds reserved blocks to allocated bitmap and writes the bitmap out to disk.
Defined at line 445 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t RunRequests (const std::vector<storage::BufferedOperation> & operations)
Defined at line 1172 of file ../../src/storage/blobfs/blobfs.cc
void CalculateFragmentationMetrics (FragmentationMetrics & fragmentation_metrics, FragmentationStats * out_stats)
Updates fragmentation metric properties in |out_metrics|. The calculated statistics can also be
obtained directly providing |out_stats|.
**NOTE**: This function is not thread-safe, and is computationally expensive. It scans through
all inodes, extents, and data bitmap entries. Errors are logged but ignored in an attempt to
provide as much information as possible (i.e. corrupted extents are skipped).
Defined at line 1002 of file ../../src/storage/blobfs/blobfs.cc
Protected Methods
zx_status_t ReloadSuperblock ()
Reloads metadata from disk. Useful when metadata on disk
may have changed due to journal playback.
Defined at line 1063 of file ../../src/storage/blobfs/blobfs.cc
Records
Friends
class BlobfsChecker