class JournalWriter

Defined at line 51 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.h

The back-end of the journal. This class implements all the blocking operations which transmit

buffers to disk, without providing higher-level guarantees about asynchrony or execution

ordering.

This class is thread-compatible.

This class is not movable or copyable.

Public Methods

void JournalWriter (fs::TransactionHandler * transaction_handler, JournalSuperblock journal_superblock, uint64_t journal_start_block, uint64_t entries_length)

Defined at line 31 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.cc

void JournalWriter (fs::TransactionHandler * transaction_handler)

Defined at line 41 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.cc

fpromise::result<void, zx_status_t> WriteData (JournalWorkItem work)

Writes |work| to disk immediately.

Defined at line 44 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.cc

void JournalWriter (const JournalWriter & )

Defined at line 56 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.h

JournalWriter & operator= (const JournalWriter & )

Defined at line 57 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.h

void JournalWriter (JournalWriter && other)

Defined at line 58 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.h

JournalWriter & operator= (JournalWriter && other)

Defined at line 59 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.h

fpromise::result<void, zx_status_t> WriteMetadata (JournalWorkItem work, std::optional<JournalWorkItem> trim_work)

Writes |work| to disk immediately (possibly also to the journal)

Updating metadata has three phases:

1) Updating the info block (if necessary to make space)

2) Write metadata to the journal itself.

3) Write metadata to the final on-disk location.

This method currently blocks, completing all three phases before returning, but in the future,

could be more fine grained, returning a promise that represents the completion of all phases.

Defined at line 75 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.cc

bool IsWritebackEnabled ()

Returns true if all writeback is "off", and no further data will be written to the

device.

Defined at line 88 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.h

bool HavePendingWork ()

Defined at line 92 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.h

fpromise::result<void, zx_status_t> TrimData (std::vector<storage::BufferedOperation> operations)

Trims |operations| immediately.

fpromise::result<void, zx_status_t> Sync ()

Synchronizes the most up-to-date info block back to disk.

Returns ZX_ERR_IO_REFUSED if writeback is disabled.

Returns an error from the block device if the info block cannot be written. In all other cases,

returns ZX_OK.

Defined at line 148 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.cc

fpromise::result<void, zx_status_t> Flush ()

Defined at line 293 of file ../../src/storage/lib/vfs/cpp/journal/journal_writer.cc