class Blobfs
Defined at line 71 of file ../../src/storage/blobfs/blobfs.h
Public Methods
void Blobfs (const Blobfs & )
Defined at line 73 of file ../../src/storage/blobfs/blobfs.h
void Blobfs (Blobfs && )
Defined at line 73 of file ../../src/storage/blobfs/blobfs.h
Blobfs & operator= (const Blobfs & )
Defined at line 73 of file ../../src/storage/blobfs/blobfs.h
Blobfs & operator= (Blobfs && )
Defined at line 73 of file ../../src/storage/blobfs/blobfs.h
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 90 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 95 of file ../../src/storage/blobfs/blobfs.h
block_client::BlockDevice * GetDevice ()
Defined at line 98 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 103 of file ../../src/storage/blobfs/blobfs.h
fs_inspect::NodeOperations & node_operations ()
Defined at line 117 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 122 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 128 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
size_t WriteBufferBlockCount ()
Defined at line 135 of file ../../src/storage/blobfs/blobfs.h
Writability writability ()
Defined at line 141 of file ../../src/storage/blobfs/blobfs.h
async_dispatcher_t * dispatcher ()
Returns the dispatcher for the current thread that blobfs uses.
Defined at line 144 of file ../../src/storage/blobfs/blobfs.h
bool CheckBlocksAllocated (uint64_tstart_block,uint64_tend_block,uint64_t *first_unset)
Defined at line 146 of file ../../src/storage/blobfs/blobfs.h
NodeFinder * GetNodeFinder ()
Defined at line 151 of file ../../src/storage/blobfs/blobfs.h
Allocator * GetAllocator ()
Defined at line 153 of file ../../src/storage/blobfs/blobfs.h
zx::result<InodePtr> GetNode (uint32_t node_index)
Defined at line 155 of file ../../src/storage/blobfs/blobfs.h
BlobCache & GetCache ()
Defined at line 161 of file ../../src/storage/blobfs/blobfs.h
BlockDevice * Device ()
Defined at line 165 of file ../../src/storage/blobfs/blobfs.h
BlobLoader & loader ()
Defined at line 185 of file ../../src/storage/blobfs/blobfs.h
PageLoader & page_loader ()
Defined at line 186 of file ../../src/storage/blobfs/blobfs.h
std::unique_ptr<BlockDevice> Destroy (std::unique_ptr<Blobfs> blobfs)
Defined at line 419 of file ../../src/storage/blobfs/blobfs.cc
void ~Blobfs ()
Defined at line 423 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t BlockAttachVmo (const zx::vmo & vmo, storage::Vmoid * out)
Defined at line 626 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t BlockDetachVmo (storage::Vmoid vmoid)
Defined at line 635 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t AddInodes (Allocator * allocator)
Defined at line 639 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t AddBlocks (size_t nblocks, RawBitmap * block_map)
Defined at line 702 of file ../../src/storage/blobfs/blobfs.cc
zx::result<fs::FilesystemInfo> GetFilesystemInfo ()
Returns filesystem specific information.
Defined at line 769 of file ../../src/storage/blobfs/blobfs.cc
BlobLayoutFormat BlobWriteFormat ()
Defined at line 374 of file ../../src/storage/blobfs/blobfs.cc
BlobOverwriteConfig OverwriteConfig ()
Defined at line 385 of file ../../src/storage/blobfs/blobfs.cc
void SetOverwriteConfig (BlobOverwriteConfig config)
Defined at line 387 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 794 of file ../../src/storage/blobfs/blobfs.cc
zx::result<std::unique_ptr<Blobfs>> Create (fbl::unique_fdblockfd,off_toffset,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 529 of file ../../src/storage/blobfs/host.cc
zx::result<> AddBlob (const BlobInfo & blob_info)
Adds a blob to the filesystem.
Defined at line 610 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 1064 of file ../../src/storage/blobfs/blobfs.cc
uint64_t GetBlockSize ()
Defined at line 929 of file ../../src/storage/blobfs/host.cc
zx_status_t Readdir (fs::VdirCookie *cookie,void *dirents,size_tlen,size_t *out_actual)
Defined at line 589 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 931 of file ../../src/storage/blobfs/host.cc
void Sync (SyncCallback cb)
Defined at line 803 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 474 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 515 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 435 of file ../../src/storage/blobfs/blobfs.cc
zx_status_t RunRequests (const std::vector<storage::BufferedOperation> & operations)
Defined at line 1151 of file ../../src/storage/blobfs/blobfs.cc
zx::result<std::unique_ptr<Superblock>> ReadBackupSuperblock ()
Defined at line 990 of file ../../src/storage/blobfs/host.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 981 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.
DecompressorCreatorConnector * decompression_connector ()
Defined at line 205 of file ../../src/storage/blobfs/blobfs.h
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 1042 of file ../../src/storage/blobfs/blobfs.cc
Records
Friends
class BlobfsChecker