class TransactionLimits

Defined at line 27 of file ../../src/storage/minfs/transaction_limits.h

Calculates and tracks the number of Minfs metadata / data blocks that can be modified within one

transaction, as well as the corresponding Journal sizes.

Once we can grow the block bitmap, we will need to be able to recalculate these limits.

Public Members

static const blk_t kMaxSuperblockBlocks
static const blk_t kMaxInodeBitmapBlocks
static const blk_t kMaxInodeTableBlocks
static const size_t kMaxWriteBytes
static const blk_t kJournalMetadataBlocks
static const blk_t kDefaultJournalBlocks

Public Methods

blk_t GetMaximumMetaDataBlocks ()

Returns the maximum number of metadata blocks that we expect to be modified in the data

section within one transaction. For data vnodes, based on a max write size of 64kb, this is

currently expected to be 3 indirect blocks (would be 4 with the introduction of more doubly

indirect blocks). For directories, with a max dirent size of 268b, this is expected to be 5

blocks.

Defined at line 36 of file ../../src/storage/minfs/transaction_limits.h

blk_t GetMaximumDataBlocks ()

Returns the maximum number of data blocks (including indirects) that we expect to be

modified within one transaction. Based on a max write size of 64kb, this is currently

expected to be 9 direct blocks + 3 indirect blocks = 11 total blocks. With the addition of

more doubly indirect blocks, this would increase to 4 indirect blocks for a total of 12

blocks.

Defined at line 43 of file ../../src/storage/minfs/transaction_limits.h

blk_t GetMaximumEntryDataBlocks ()

Returns the maximum number of data blocks that can be included in a journal entry,

i.e. the total number of blocks that can be held in a transaction enqueued to the journal.

Defined at line 47 of file ../../src/storage/minfs/transaction_limits.h

blk_t GetMaximumEntryBlocks ()

Returns the total number of blocks required for the maximum size journal entry.

Defined at line 50 of file ../../src/storage/minfs/transaction_limits.h

blk_t GetMinimumIntegrityBlocks ()

Returns the minimum number of blocks required to create a journal guaranteed large enough to

hold at least a single journal entry of maximum size, as well as the backup superblock.

Defined at line 54 of file ../../src/storage/minfs/transaction_limits.h

blk_t GetRecommendedIntegrityBlocks ()

Returns the ideal number of blocks to allocate to the integrity section, provided enough space

is available.

Defined at line 58 of file ../../src/storage/minfs/transaction_limits.h

void TransactionLimits (const Superblock & info)

Defined at line 80 of file ../../src/storage/minfs/transaction_limits.cc