Example #1
0
bool is_erasure_oid(uint64_t oid, uint8_t policy)
{
	if (is_vdi_obj(oid))
		return false;
	if (is_vdi_btree_obj(oid))
		return false;
	if (policy == 0)
		return false;
	return true;
}
Example #2
0
size_t get_store_objsize(uint8_t copy_policy, uint64_t oid)
{
	if (is_vdi_obj(oid))
		return SD_INODE_SIZE;
	if (is_vdi_btree_obj(oid))
		return SD_INODE_DATA_INDEX_SIZE;
	if (copy_policy != 0) {
		int d;

		ec_policy_to_dp(copy_policy, &d, NULL);
		return SD_DATA_OBJ_SIZE / d;
	}
	return get_objsize(oid);
}
Example #3
0
size_t get_store_objsize(uint8_t copy_policy, uint8_t block_size_shift,
			 uint64_t oid)
{
	if (is_vdi_obj(oid))
		return SD_INODE_SIZE;
	if (is_vdi_btree_obj(oid))
		return SD_INODE_DATA_INDEX_SIZE;

	uint32_t object_size = (UINT32_C(1) << block_size_shift);
	if (copy_policy != 0) {
		int d;

		ec_policy_to_dp(copy_policy, &d, NULL);
		return object_size / d;
	}
	return get_objsize(oid, object_size);
}
Example #4
0
bool is_erasure_oid(uint64_t oid)
{
	return !is_vdi_obj(oid) && !is_vdi_btree_obj(oid) &&
		!is_ledger_object(oid) &&
		get_vdi_copy_policy(oid_to_vid(oid)) > 0;
}