SPDK block compression. More...
Data Structures | |
struct | spdk_reduce_vol_info |
Describes the information of spdk_reduce_vol. More... | |
struct | spdk_reduce_vol_params |
Describes the parameters of an spdk_reduce_vol. More... | |
struct | spdk_reduce_vol_cb_args |
struct | spdk_reduce_backing_io |
struct | spdk_reduce_backing_dev |
Macros | |
#define | REDUCE_MAX_IOVECS 33 |
Typedefs | |
typedef void(* | spdk_reduce_vol_op_complete) (void *ctx, int reduce_errno) |
typedef void(* | spdk_reduce_vol_op_with_handle_complete) (void *ctx, struct spdk_reduce_vol *vol, int reduce_errno) |
typedef void(* | spdk_reduce_dev_cpl) (void *cb_arg, int reduce_errno) |
Defines function type for callback functions called when backing_dev operations are complete. | |
Enumerations | |
enum | spdk_reduce_backing_io_type { SPDK_REDUCE_BACKING_IO_WRITE , SPDK_REDUCE_BACKING_IO_READ , SPDK_REDUCE_BACKING_IO_UNMAP } |
Functions | |
const struct spdk_uuid * | spdk_reduce_vol_get_uuid (struct spdk_reduce_vol *vol) |
Get the UUID for a libreduce compressed volume. | |
void | spdk_reduce_vol_init (struct spdk_reduce_vol_params *params, struct spdk_reduce_backing_dev *backing_dev, const char *pm_file_dir, spdk_reduce_vol_op_with_handle_complete cb_fn, void *cb_arg) |
Initialize a new libreduce compressed volume. | |
void | spdk_reduce_vol_load (struct spdk_reduce_backing_dev *backing_dev, spdk_reduce_vol_op_with_handle_complete cb_fn, void *cb_arg) |
Load an existing libreduce compressed volume. | |
void | spdk_reduce_vol_unload (struct spdk_reduce_vol *vol, spdk_reduce_vol_op_complete cb_fn, void *cb_arg) |
Unload a previously initialized or loaded libreduce compressed volume. | |
void | spdk_reduce_vol_destroy (struct spdk_reduce_backing_dev *backing_dev, spdk_reduce_vol_op_complete cb_fn, void *cb_arg) |
Destroy an existing libreduce compressed volume. | |
void | spdk_reduce_vol_readv (struct spdk_reduce_vol *vol, struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length, spdk_reduce_vol_op_complete cb_fn, void *cb_arg) |
Read data from a libreduce compressed volume. | |
void | spdk_reduce_vol_writev (struct spdk_reduce_vol *vol, struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length, spdk_reduce_vol_op_complete cb_fn, void *cb_arg) |
Write data to a libreduce compressed volume. | |
void | spdk_reduce_vol_unmap (struct spdk_reduce_vol *vol, uint64_t offset, uint64_t length, spdk_reduce_vol_op_complete cb_fn, void *cb_arg) |
Unmap extent to a libreduce compressed volume. | |
const struct spdk_reduce_vol_params * | spdk_reduce_vol_get_params (struct spdk_reduce_vol *vol) |
Get the params structure for a libreduce compressed volume. | |
void | spdk_reduce_vol_print_info (struct spdk_reduce_vol *vol) |
Dump out key information for a libreduce compressed volume and its PMEM. | |
const char * | spdk_reduce_vol_get_pm_path (const struct spdk_reduce_vol *vol) |
Get the pm path for a libreduce compressed volume. | |
const struct spdk_reduce_vol_info * | spdk_reduce_vol_get_info (const struct spdk_reduce_vol *vol) |
Get the information for a libreduce compressed volume. | |
SPDK block compression.
typedef void(* spdk_reduce_dev_cpl) (void *cb_arg, int reduce_errno) |
Defines function type for callback functions called when backing_dev operations are complete.
cb_arg | Callback argument |
reduce_errno | Completion status of backing_dev operation Negative values indicate negated errno value 0 indicates successful readv/writev/unmap operation Positive value indicates successful compress/decompress operations; number indicates number of bytes written to destination iovs |
void spdk_reduce_vol_destroy | ( | struct spdk_reduce_backing_dev * | backing_dev, |
spdk_reduce_vol_op_complete | cb_fn, | ||
void * | cb_arg ) |
Destroy an existing libreduce compressed volume.
This will zero the metadata region on the backing device and delete the associated pm metadata file. If the backing device does not contain a compressed volume, the cb_fn will be called with error status without modifying the backing device nor deleting a pm file.
backing_dev | Structure describing the backing device containing the compressed volume. |
cb_fn | Callback function to signal completion of the destruction process. |
cb_arg | Argument to pass to the callback function. |
const struct spdk_reduce_vol_info * spdk_reduce_vol_get_info | ( | const struct spdk_reduce_vol * | vol | ) |
Get the information for a libreduce compressed volume.
vol | Previously loaded or initialized compressed volume. |
const struct spdk_reduce_vol_params * spdk_reduce_vol_get_params | ( | struct spdk_reduce_vol * | vol | ) |
Get the params structure for a libreduce compressed volume.
This function will populate the given params structure for a given volume.
vol | Previously loaded or initialized compressed volume. |
const char * spdk_reduce_vol_get_pm_path | ( | const struct spdk_reduce_vol * | vol | ) |
Get the pm path for a libreduce compressed volume.
vol | Previously loaded or initialized compressed volume. |
const struct spdk_uuid * spdk_reduce_vol_get_uuid | ( | struct spdk_reduce_vol * | vol | ) |
Get the UUID for a libreduce compressed volume.
vol | Previously loaded or initialized compressed volume. |
void spdk_reduce_vol_init | ( | struct spdk_reduce_vol_params * | params, |
struct spdk_reduce_backing_dev * | backing_dev, | ||
const char * | pm_file_dir, | ||
spdk_reduce_vol_op_with_handle_complete | cb_fn, | ||
void * | cb_arg ) |
Initialize a new libreduce compressed volume.
params | Parameters for the new volume. |
backing_dev | Structure describing the backing device to use for the new volume. |
pm_file_dir | Directory to use for creation of the persistent memory file to use for the new volume. This function will append the UUID as the filename to create in this directory. |
cb_fn | Callback function to signal completion of the initialization process. |
cb_arg | Argument to pass to the callback function. |
void spdk_reduce_vol_load | ( | struct spdk_reduce_backing_dev * | backing_dev, |
spdk_reduce_vol_op_with_handle_complete | cb_fn, | ||
void * | cb_arg ) |
Load an existing libreduce compressed volume.
backing_dev | Structure describing the backing device containing the compressed volume. |
cb_fn | Callback function to signal completion of the loading process. |
cb_arg | Argument to pass to the callback function. |
void spdk_reduce_vol_print_info | ( | struct spdk_reduce_vol * | vol | ) |
Dump out key information for a libreduce compressed volume and its PMEM.
This function will print key information for a given volume its PMEM.
vol | Previously loaded or initialized compressed volume. |
void spdk_reduce_vol_readv | ( | struct spdk_reduce_vol * | vol, |
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset, | ||
uint64_t | length, | ||
spdk_reduce_vol_op_complete | cb_fn, | ||
void * | cb_arg ) |
Read data from a libreduce compressed volume.
This function will only read from logical blocks on the comparessed volume that fall within the same chunk.
vol | Volume to read data. |
iov | iovec array describing the data to be read |
iovcnt | Number of elements in the iovec array |
offset | Offset (in logical blocks) to read the data on the compressed volume |
length | Length (in logical blocks) of the data to read |
cb_fn | Callback function to signal completion of the readv operation. |
cb_arg | Argument to pass to the callback function. |
void spdk_reduce_vol_unload | ( | struct spdk_reduce_vol * | vol, |
spdk_reduce_vol_op_complete | cb_fn, | ||
void * | cb_arg ) |
Unload a previously initialized or loaded libreduce compressed volume.
vol | Volume to unload. |
cb_fn | Callback function to signal completion of the unload process. |
cb_arg | Argument to pass to the callback function. |
void spdk_reduce_vol_unmap | ( | struct spdk_reduce_vol * | vol, |
uint64_t | offset, | ||
uint64_t | length, | ||
spdk_reduce_vol_op_complete | cb_fn, | ||
void * | cb_arg ) |
Unmap extent to a libreduce compressed volume.
This function will clear the mapping info by full chunk or write zero to nonfull chunk.
vol | Volume to unmap. |
offset | Offset (in logical blocks) of the extent to unmap on the compressed volume |
length | Length (in logical blocks) of the extent to unmap on the compressed volume |
cb_fn | Callback function to signal completion of the unmap operation. |
cb_arg | Argument to pass to the callback function. |
void spdk_reduce_vol_writev | ( | struct spdk_reduce_vol * | vol, |
struct iovec * | iov, | ||
int | iovcnt, | ||
uint64_t | offset, | ||
uint64_t | length, | ||
spdk_reduce_vol_op_complete | cb_fn, | ||
void * | cb_arg ) |
Write data to a libreduce compressed volume.
This function will only write to logical blocks on the comparessed volume that fall within the same chunk.
vol | Volume to write data. |
iov | iovec array describing the data to be written |
iovcnt | Number of elements in the iovec array |
offset | Offset (in logical blocks) to write the data on the compressed volume |
length | Length (in logical blocks) of the data to write |
cb_fn | Callback function to signal completion of the writev operation. |
cb_arg | Argument to pass to the callback function. |