class Blob
Defined at line 54 of file ../../src/storage/blobfs/blob.h
Public Methods
void Blob (Blobfs & blobfs, const Digest & digest)
Creates a writable blob. Will become readable once all data has been written and verified.
`blobfs` must outlive this blob.
Defined at line 66 of file ../../src/storage/blobfs/blob.cc
void Blob (Blobfs & blobfs, uint32_t node_index, const Inode & inode)
Creates a readable blob from existing data. `blobfs` must outlive this blob.
Defined at line 71 of file ../../src/storage/blobfs/blob.cc
void fbl_recycle ()
Required for memory management, see the class comment above Vnode for more.
Defined at line 79 of file ../../src/storage/blobfs/blob.h
bool DeletionQueued ()
Returned true if this blob is marked for deletion.
This is called outside the lock and so the deletion state might change out from under the
caller. It should not be used by anything requiring exact correctness. Currently this is used
only to skip verifying deleted blobs which can tolerate mistakenly checking deleted blobs
sometimes.
Defined at line 87 of file ../../src/storage/blobfs/blob.h
uint32_t Ino ()
Returns a unique identifier for this blob
This is called outside the lock which means there can be a race for the inode to be assigned.
The inode number changes for newly created blobs from 0 to a nonzero number when we start to
write to it. For blobs just read from disk (most of them) the inode number won't change.
Defined at line 97 of file ../../src/storage/blobfs/blob.h
void ~Blob ()
Defined at line 211 of file ../../src/storage/blobfs/blob.cc
fuchsia_io::NodeProtocolKinds GetProtocols ()
fs::Vnode implementation:
Defined at line 221 of file ../../src/storage/blobfs/blob.cc
zx_status_t Write (const void * data, size_t len, size_t offset, size_t * out_actual)
Defined at line 225 of file ../../src/storage/blobfs/blob.cc
zx_status_t Truncate (size_t len)
Defined at line 261 of file ../../src/storage/blobfs/blob.cc
void VmoRead (uint64_t offset, uint64_t length)
This function will get called on an arbitrary pager worker thread.
Defined at line 291 of file ../../src/storage/blobfs/blob.cc
uint64_t FileSize ()
Size of the blob data (i.e. total number of bytes that can be read).
Defined at line 59 of file ../../src/storage/blobfs/blob.cc
void WillTeardownFilesystem ()
Notification that the associated Blobfs is tearing down. This will clean up any extra
references such that the Blob can be deleted.
Defined at line 355 of file ../../src/storage/blobfs/blob.cc
zx_status_t QueueUnlink ()
Marks the blob as deletable, and attempt to purge it.
Defined at line 135 of file ../../src/storage/blobfs/blob.cc
zx_status_t Verify ()
Reads in and verifies the contents of this Blob.
Defined at line 143 of file ../../src/storage/blobfs/blob.cc
zx::result<zx::vmo> GetVmoForBlobReader ()
Creates a child VMO for the BlobReader protocol.
Defined at line 422 of file ../../src/storage/blobfs/blob.cc
bool IsReadable ()
Returns true is the blob is currently readable.
Defined at line 452 of file ../../src/storage/blobfs/blob.cc
zx::result<> ReplaceBlob (BlobTransaction & transaction, uint32_t map_index, uint64_t block_count, const std::function<zx::result<> ()> & transaction_completion)
Lock and replace this blob with another with the same digest at the inode `map_index` that uses
`block_count` data blocks. The removal of this blob is added to the `transaction` which must be
committed inside `transaction_completion` along with any other operations that need to be done
or verified while this blob is held under lock.
Defined at line 457 of file ../../src/storage/blobfs/blob.cc
zx_status_t SetOverwritingBy (Blob * overwriter)
Sets the blob overwriting this one. Returns ZX_ERR_ALREADY_EXISTS if the flag is
already set.
Defined at line 496 of file ../../src/storage/blobfs/blob.cc
Blob * GetOverwritingBy ()
Return the blob that is overwriting this one. May be nullptr if there is not one active.
Defined at line 515 of file ../../src/storage/blobfs/blob.cc
zx_status_t ClearOverwritingBy ()
Clears the status of being overwritten. Returns ZX_ERR_NOT_FOUND if the flag is not already
set.
Defined at line 505 of file ../../src/storage/blobfs/blob.cc
void SetBlobToOverwrite (fbl::RefPtr<Blob> to_overwrite)
Reference the blob that is being overwritten by this one.
Defined at line 520 of file ../../src/storage/blobfs/blob.cc
void SetBlobWriterHandler (BlobWriter * writer_handler)
the back-reference to the handler for the BlobWriter protocol. Set to nullptr when there is
no valid handler left.
Defined at line 528 of file ../../src/storage/blobfs/blob.cc
BlobWriter * GetBlobWriterHandler ()
Get the back-reference to the handler for the BlobWriter protocol. Returns nullptr when there
is no valid handler.
Defined at line 533 of file ../../src/storage/blobfs/blob.cc
Friends
class BlobTest
class BlobLoaderTest