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 73 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 78 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
void ~Blob ()
Defined at line 218 of file ../../src/storage/blobfs/blob.cc
fuchsia_io::NodeProtocolKinds GetProtocols ()
fs::Vnode implementation:
Defined at line 228 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 232 of file ../../src/storage/blobfs/blob.cc
zx_status_t Truncate (size_t len)
Defined at line 268 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 298 of file ../../src/storage/blobfs/blob.cc
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 59 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 66 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 362 of file ../../src/storage/blobfs/blob.cc
zx_status_t QueueUnlink ()
Marks the blob as deletable, and attempt to purge it.
Defined at line 142 of file ../../src/storage/blobfs/blob.cc
zx_status_t Verify ()
Reads in and verifies the contents of this Blob.
Defined at line 150 of file ../../src/storage/blobfs/blob.cc
zx::result<zx::vmo> GetVmoForBlobReader ()
Creates a child VMO for the BlobReader protocol.
Defined at line 429 of file ../../src/storage/blobfs/blob.cc
bool IsReadable ()
Returns true is the blob is currently readable.
Defined at line 459 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 464 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 503 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 522 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 512 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 527 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 535 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 540 of file ../../src/storage/blobfs/blob.cc
Friends
class BlobTest
class BlobLoaderTest