Open CAS Framework
Open source framework of Cache Acceleration Software
Data Fields
ocf_data_ops Struct Reference

Context data representation ops. More...

#include <ocf_ctx.h>

Data Fields

ctx_data_t *(* alloc )(uint32_t pages)
 Allocate contest data buffer. More...
 
void(* free )(ctx_data_t *data)
 Free context data buffer. More...
 
int(* mlock )(ctx_data_t *data)
 Lock context data buffer to disable swap-out. More...
 
void(* munlock )(ctx_data_t *data)
 Unlock context data buffer. More...
 
uint32_t(* read )(void *dst, ctx_data_t *src, uint32_t size)
 Read from environment data buffer into raw data buffer. More...
 
uint32_t(* write )(ctx_data_t *dst, const void *src, uint32_t size)
 Write raw data buffer into context data buffer. More...
 
uint32_t(* zero )(ctx_data_t *dst, uint32_t size)
 Zero context data buffer. More...
 
uint32_t(* seek )(ctx_data_t *dst, ctx_data_seek_t seek, uint32_t size)
 Seek read/write head in context data buffer for specified offset. More...
 
uint64_t(* copy )(ctx_data_t *dst, ctx_data_t *src, uint64_t to, uint64_t from, uint64_t bytes)
 Copy context data buffer content. More...
 
void(* secure_erase )(ctx_data_t *dst)
 Erase content of data buffer. More...
 

Detailed Description

Context data representation ops.

Field Documentation

◆ alloc

ctx_data_t*(* alloc) (uint32_t pages)

Allocate contest data buffer.

Parameters
[in]pagesThe size of data buffer in pages
Returns
Context data buffer

◆ copy

uint64_t(* copy) (ctx_data_t *dst, ctx_data_t *src, uint64_t to, uint64_t from, uint64_t bytes)

Copy context data buffer content.

Parameters
[in,out]dstDestination context data buffer
[in]srcSource context data buffer
[in]toStarting offset in destination buffer
[in]fromStarting offset in source buffer
[in]bytesNumber of bytes to be copied
Returns
Number of bytes copied

◆ free

void(* free) (ctx_data_t *data)

Free context data buffer.

Parameters
[in]dataContex data buffer which shall be freed

◆ mlock

int(* mlock) (ctx_data_t *data)

Lock context data buffer to disable swap-out.

Parameters
[in]dataContex data buffer which shall be locked
Return values
0Memory locked successfully
Non-zeroMemory locking failure

◆ munlock

void(* munlock) (ctx_data_t *data)

Unlock context data buffer.

Parameters
[in]dataContex data buffer which shall be unlocked

◆ read

uint32_t(* read) (void *dst, ctx_data_t *src, uint32_t size)

Read from environment data buffer into raw data buffer.

Parameters
[in,out]dstDestination raw memory buffer
[in]srcSource context data buffer
[in]sizeNumber of bytes to be read
Returns
Number of read bytes

◆ secure_erase

void(* secure_erase) (ctx_data_t *dst)

Erase content of data buffer.

Parameters
[in]dstContex data buffer which shall be erased

◆ seek

uint32_t(* seek) (ctx_data_t *dst, ctx_data_seek_t seek, uint32_t size)

Seek read/write head in context data buffer for specified offset.

Parameters
[in,out]dstDestination context data buffer to be seek
[in]seekSeek beginning offset
[in]sizeNumber of bytes to be seek
Returns
Number of seek bytes

◆ write

uint32_t(* write) (ctx_data_t *dst, const void *src, uint32_t size)

Write raw data buffer into context data buffer.

Parameters
[in,out]dstDestination context data buffer
[in]srcSource raw memory buffer
[in]sizeNumber of bytes to be written
Returns
Number of written bytes

◆ zero

uint32_t(* zero) (ctx_data_t *dst, uint32_t size)

Zero context data buffer.

Parameters
[in,out]dstDestination context data buffer to be zeroed
[in]sizeNumber of bytes to be zeroed
Returns
Number of zeroed bytes

The documentation for this struct was generated from the following file: