我要评分
获取效率
正确性
完整性
易理解

Structures

Structure

Description

Definition

ocf_config

Input parameter structure, including necessary elements for ocf initialization

struct ocf_config {

uint32_t cache_line_size; // Cache line size, 8 KiB by default.

uint64_t cache_capacity; // Cache capacity, in bytes. The value is an integer multiple of the chunk size.

uint16_t io_worker_num; // Number of external threads that submit requests.

uint16_t core_num; // Number of cores allocated to the ocf thread.

uint64_t cache_line_size; // Cache line size, 8 KiB by default.

uint64_t chunk_pool_id; // Chunk pool used by the cache to store data

uint128_t core_mask; // Set of core IDs allocated to ocf.

log_print_func log_print; // Log printing function.

};

req_context

Input parameter structure of the interfaces for submitting asynchronous requests such as read, write, query, and invalidation to ocf

struct req_context {

void *req_identifier; // Request identifier, which is indexed to the request context.

uint32_t io_worker_id; // Index SQ.

uint32_t slot_id; // Index ocf core.

uint64_t region_id; // Used to calculate the core offset.

uint64_t offset; // Offset in the region, which is used to calculate the core offset.

uint64_t len; // Request length.

char *buffer // Buffer used by read/write requests.

int (*cb)(int32_t ret, void *ctx); // Request completion callback.

char internal[40]; // ocf internal parameter that does not need to be set.

};

ocf_dump_info

Query result structure

struct ocf_dump_info {

char *buf;

size_t len;

};