Open CAS Framework
Open source framework of Cache Acceleration Software
|
OCF volume API. More...
Go to the source code of this file.
Data Structures | |
struct | ocf_volume_uuid |
OCF volume UUID. More... | |
struct | ocf_volume_caps |
This structure describes volume capabilities. More... | |
struct | ocf_volume_ops |
OCF volume interface declaration. More... | |
struct | ocf_volume_properties |
This structure describes volume properties. More... | |
Macros | |
#define | OCF_VOLUME_UUID_MAX_SIZE (4096UL - sizeof(uint32_t)) |
OCF volume UUID maximum allowed size. | |
Functions | |
int | ocf_uuid_set_str (ocf_uuid_t uuid, char *str) |
Initialize UUID from string. More... | |
int | ocf_volume_init (ocf_volume_t volume, ocf_volume_type_t type, struct ocf_volume_uuid *uuid, bool uuid_copy) |
Initialize volume. More... | |
void | ocf_volume_deinit (ocf_volume_t volume) |
Deinitialize volume. More... | |
int | ocf_volume_create (ocf_volume_t *volume, ocf_volume_type_t type, struct ocf_volume_uuid *uuid) |
Allocate and initialize volume. More... | |
void | ocf_volume_destroy (ocf_volume_t volume) |
Deinitialize and free volume. More... | |
ocf_volume_type_t | ocf_volume_get_type (ocf_volume_t volume) |
Get volume type. More... | |
const struct ocf_volume_uuid * | ocf_volume_get_uuid (ocf_volume_t volume) |
Get volume UUID. More... | |
void * | ocf_volume_get_priv (ocf_volume_t volume) |
Get private context of volume. More... | |
ocf_cache_t | ocf_volume_get_cache (ocf_volume_t volume) |
Get cache handle for given volume. More... | |
int | ocf_volume_is_atomic (ocf_volume_t volume) |
Check if volume supports atomic mode. More... | |
struct ocf_io * | ocf_volume_new_io (ocf_volume_t volume, ocf_queue_t queue, uint64_t addr, uint32_t bytes, uint32_t dir, uint32_t io_class, uint64_t flags) |
Allocate new io. More... | |
void | ocf_volume_submit_io (struct ocf_io *io) |
Submit io to volume. More... | |
void | ocf_volume_submit_flush (struct ocf_io *io) |
Submit flush to volume. More... | |
void | ocf_volume_submit_discard (struct ocf_io *io) |
Submit discard to volume. More... | |
int | ocf_volume_open (ocf_volume_t volume, void *volume_params) |
Open volume. More... | |
void | ocf_volume_close (ocf_volume_t volume) |
Get volume max io size. More... | |
unsigned int | ocf_volume_get_max_io_size (ocf_volume_t volume) |
Get volume max io size. More... | |
uint64_t | ocf_volume_get_length (ocf_volume_t volume) |
Get volume length. More... | |
OCF volume API.
int ocf_uuid_set_str | ( | ocf_uuid_t | uuid, |
char * | str | ||
) |
Initialize UUID from string.
[in] | uuid | UUID to be initialized |
[in] | str | NULL-terminated string |
void ocf_volume_close | ( | ocf_volume_t | volume | ) |
Get volume max io size.
[in] | volume | Volume |
int ocf_volume_create | ( | ocf_volume_t * | volume, |
ocf_volume_type_t | type, | ||
struct ocf_volume_uuid * | uuid | ||
) |
Allocate and initialize volume.
[out] | volume | pointer to volume handle |
[in] | type | cache/core volume type |
[in] | uuid | OCF volume UUID |
void ocf_volume_deinit | ( | ocf_volume_t | volume | ) |
Deinitialize volume.
[in] | volume | volume handle |
void ocf_volume_destroy | ( | ocf_volume_t | volume | ) |
Deinitialize and free volume.
[in] | volume | volume handle |
ocf_cache_t ocf_volume_get_cache | ( | ocf_volume_t | volume | ) |
Get cache handle for given volume.
volume | volume handle |
uint64_t ocf_volume_get_length | ( | ocf_volume_t | volume | ) |
Get volume length.
[in] | volume | Volume |
unsigned int ocf_volume_get_max_io_size | ( | ocf_volume_t | volume | ) |
Get volume max io size.
[in] | volume | Volume |
void* ocf_volume_get_priv | ( | ocf_volume_t | volume | ) |
Get private context of volume.
[in] | volume | Volume |
ocf_volume_type_t ocf_volume_get_type | ( | ocf_volume_t | volume | ) |
Get volume type.
[in] | volume | Volume |
const struct ocf_volume_uuid* ocf_volume_get_uuid | ( | ocf_volume_t | volume | ) |
Get volume UUID.
[in] | volume | Volume |
int ocf_volume_init | ( | ocf_volume_t | volume, |
ocf_volume_type_t | type, | ||
struct ocf_volume_uuid * | uuid, | ||
bool | uuid_copy | ||
) |
Initialize volume.
[in] | volume | volume handle |
[in] | type | cache/core volume type |
[in] | uuid | OCF volume UUID |
[in] | uuid_copy | crate copy of uuid data |
int ocf_volume_is_atomic | ( | ocf_volume_t | volume | ) |
Check if volume supports atomic mode.
[in] | volume | Volume |
struct ocf_io* ocf_volume_new_io | ( | ocf_volume_t | volume, |
ocf_queue_t | queue, | ||
uint64_t | addr, | ||
uint32_t | bytes, | ||
uint32_t | dir, | ||
uint32_t | io_class, | ||
uint64_t | flags | ||
) |
Allocate new io.
[in] | volume | Volume |
[in] | queue | IO queue handle |
[in] | addr | OCF IO destination address |
[in] | bytes | OCF IO size in bytes |
[in] | dir | OCF IO direction |
[in] | io_class | OCF IO destination class |
[in] | flags | OCF IO flags |
int ocf_volume_open | ( | ocf_volume_t | volume, |
void * | volume_params | ||
) |
Open volume.
[in] | volume | Volume |
[in] | volume_params | Opaque volume params |
void ocf_volume_submit_discard | ( | struct ocf_io * | io | ) |
Submit discard to volume.
[in] | io | IO |
void ocf_volume_submit_flush | ( | struct ocf_io * | io | ) |
Submit flush to volume.
[in] | io | IO |
void ocf_volume_submit_io | ( | struct ocf_io * | io | ) |
Submit io to volume.
[in] | io | IO |