/* * Low level disk format * * Bitmap btree * ------------ * * Each value stored in the btree is an index_entry. This points to a * block that is used as a bitmap. Within the bitmap hold 2 bits per * entry, which represent UNUSED = 0, REF_COUNT = 1, REF_COUNT = 2 and * REF_COUNT = many. * * Refcount btree * -------------- * * Any entry that has a ref count higher than 2 gets entered in the ref * count tree. The leaf values for this tree is the 32-bit ref count.
*/
/* * A lot of time can be wasted reading and writing the same * index entry. So we cache a few entries.
*/ #define IE_CACHE_SIZE 64 #define IE_CACHE_MASK (IE_CACHE_SIZE - 1)
int sm_ll_extend(struct ll_disk *ll, dm_block_t extra_blocks); int sm_ll_lookup_bitmap(struct ll_disk *ll, dm_block_t b, uint32_t *result); int sm_ll_lookup(struct ll_disk *ll, dm_block_t b, uint32_t *result); int sm_ll_find_free_block(struct ll_disk *ll, dm_block_t begin,
dm_block_t end, dm_block_t *result); int sm_ll_find_common_free_block(struct ll_disk *old_ll, struct ll_disk *new_ll,
dm_block_t begin, dm_block_t end, dm_block_t *result);
/* * The next three functions return (via nr_allocations) the net number of * allocations that were made. This number may be negative if there were * more frees than allocs.
*/ int sm_ll_insert(struct ll_disk *ll, dm_block_t b, uint32_t ref_count, int32_t *nr_allocations); int sm_ll_inc(struct ll_disk *ll, dm_block_t b, dm_block_t e, int32_t *nr_allocations); int sm_ll_dec(struct ll_disk *ll, dm_block_t b, dm_block_t e, int32_t *nr_allocations); int sm_ll_commit(struct ll_disk *ll);
int sm_ll_new_metadata(struct ll_disk *ll, struct dm_transaction_manager *tm); int sm_ll_open_metadata(struct ll_disk *ll, struct dm_transaction_manager *tm, void *root_le, size_t len);
int sm_ll_new_disk(struct ll_disk *ll, struct dm_transaction_manager *tm); int sm_ll_open_disk(struct ll_disk *ll, struct dm_transaction_manager *tm, void *root_le, size_t len);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.