class Bcache

Defined at line 131 of file ../../src/storage/minfs/bcache.h

Public Members

Array extent_lengths_

Public Methods

std::unique_ptr<block_client::BlockDevice> Destroy (std::unique_ptr<Bcache> bcache)

Destroys a "bcache" object, but take back ownership of the underlying block device.

Defined at line 34 of file ../../src/storage/minfs/bcache.cc

zx_status_t RunRequests (const std::vector<storage::BufferedOperation> & operations)

/////////////

fs::TransactionHandler interface.

Defined at line 26 of file ../../src/storage/minfs/bcache_host.cc

void ~Bcache ()

Defined at line 51 of file ../../src/storage/minfs/bcache.h

void DieOnMutationFailure (bool setting)

Set whether to die on mutation failures in transactions.

Defined at line 58 of file ../../src/storage/minfs/bcache.cc

zx::result<> Readblk (blk_t bno, void * data)

Raw block read functions.

These do not track blocks (or attempt to access the block cache)

NOTE: Not marked as final, since these are overridden methods on host,

but not on __Fuchsia__.

Defined at line 56 of file ../../src/storage/minfs/bcache_host.cc

block_client::BlockDevice * GetDevice ()

Defined at line 68 of file ../../src/storage/minfs/bcache.h

zx::result<> Writeblk (blk_t bno, const void * data)

Defined at line 71 of file ../../src/storage/minfs/bcache_host.cc

zx_status_t BlockAttachVmo (const zx::vmo & vmo, storage::Vmoid * out)

TODO(rvargas): Move this to BlockDevice.

VmoidRegistry interface:

Defined at line 98 of file ../../src/storage/minfs/bcache.cc

block_client::BlockDevice * device ()

Defined at line 99 of file ../../src/storage/minfs/bcache.h

const block_client::BlockDevice * device ()

Defined at line 100 of file ../../src/storage/minfs/bcache.h

zx_status_t BlockDetachVmo (storage::Vmoid vmoid)

Defined at line 102 of file ../../src/storage/minfs/bcache.cc

zx::result<std::unique_ptr<Bcache>> Create (std::unique_ptr<block_client::BlockDevice> device, uint32_t max_blocks)

This factory allows building this object from a BlockDevice. Bcache can take ownership of the

device (the first Create method), or not (the second Create method).

Defined at line 112 of file ../../src/storage/minfs/bcache.cc

zx::result<std::unique_ptr<Bcache>> Create (block_client::BlockDevice * device, uint32_t max_blocks)

Defined at line 121 of file ../../src/storage/minfs/bcache.cc

zx::result<> Sync ()

Defined at line 87 of file ../../src/storage/minfs/bcache_host.cc

zx::result<std::unique_ptr<Bcache>> Create (fbl::unique_fd fd, uint32_t max_blocks)

static

Defined at line 93 of file ../../src/storage/minfs/bcache_host.cc

zx::result<> SetOffset (off_t offset)

Tell Bcache to look for Minfs partition starting at |offset| bytes

Defined at line 100 of file ../../src/storage/minfs/bcache_host.cc

zx::result<> SetSparse (off_t offset, const fbl::Vector<size_t> & extent_lengths)

Tell the Bcache it is pointing at a sparse file

|offset| indicates where the minfs partition begins within the file

|extent_lengths| contains the length of each extent (in bytes)

Defined at line 108 of file ../../src/storage/minfs/bcache_host.cc

void Bcache (const Bcache & )

Not copyable or movable

Defined at line 134 of file ../../src/storage/minfs/bcache.h

Bcache & operator= (const Bcache & )

Defined at line 135 of file ../../src/storage/minfs/bcache.h

void Bcache (Bcache && )

Defined at line 136 of file ../../src/storage/minfs/bcache.h

Bcache & operator= (Bcache && )

Defined at line 137 of file ../../src/storage/minfs/bcache.h

uint32_t DeviceBlockSize ()

Defined at line 138 of file ../../src/storage/minfs/bcache.cc

uint64_t BlockNumberToDevice (uint64_t block_num)

/////////////

fs::TransactionHandler interface.

Defined at line 142 of file ../../src/storage/minfs/bcache.h

void Pause ()

Blocks all I/O operations to the underlying device (that go via the RunRequests method). This

does *not* block operations that go directly to the device.

Defined at line 159 of file ../../src/storage/minfs/bcache.cc

uint32_t Maxblk ()

Returns the maximum number of available blocks,

assuming the filesystem is non-resizable.

Defined at line 160 of file ../../src/storage/minfs/bcache.h

void Resume ()

Resumes all I/O operations paused by the Pause method.

Defined at line 162 of file ../../src/storage/minfs/bcache.cc

Friends

class BlockNode