Bind ocf_io to ocf_request

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
Robert Baldyga
2023-10-13 21:49:52 +02:00
committed by Michal Mielewczyk
parent 7fb6b62825
commit c5741df0ed
8 changed files with 57 additions and 187 deletions

View File

@@ -105,42 +105,6 @@ struct ocf_io {
ocf_end_io_t end;
};
/**
* @brief OCF IO operations set structure
*/
struct ocf_io_ops {
/**
* @brief Set up data vector in OCF IO
*
* @param[in] io OCF IO to set up
* @param[in] data Source context data
* @param[in] offset Data offset in source context data
*
* @retval 0 Data set up successfully
* @retval Non-zero Data set up failure
*/
int (*set_data)(struct ocf_io *io, ctx_data_t *data,
uint32_t offset);
/**
* @brief Get context data from OCF IO
*
* @param[in] io OCF IO to get data
*
* @return Data vector from IO
*/
ctx_data_t *(*get_data)(struct ocf_io *io);
};
/**
* @brief Get IO private context structure
*
* @param[in] io OCF IO
*
* @return IO private context structure
*/
void *ocf_io_get_priv(struct ocf_io *io);
/**
* @brief Increase reference counter in OCF IO
*
@@ -199,8 +163,6 @@ static inline void ocf_io_set_handle(struct ocf_io *io, ocf_handle_io_t fn)
/**
* @brief Set up data vector in OCF IO
*
* @note Wrapper for set up data vector function
*
* @param[in] io OCF IO to set up
* @param[in] data Source data vector
* @param[in] offset Data offset in source data vector
@@ -213,14 +175,21 @@ int ocf_io_set_data(struct ocf_io *io, ctx_data_t *data, uint32_t offset);
/**
* @brief Get data vector from OCF IO
*
* @note Wrapper for get data vector function
*
* @param[in] io OCF IO to get data
*
* @return Data vector from IO
*/
ctx_data_t *ocf_io_get_data(struct ocf_io *io);
/**
* @brief Get offset within the data from OCF IO
*
* @param[in] io OCF IO to get data
*
* @return Offset within data
*/
uint32_t ocf_io_get_offset(struct ocf_io *io);
/**
* @brief Handle IO in cache engine
*

View File

@@ -221,18 +221,12 @@ struct ocf_volume_properties {
const char *name;
/*!< The name of volume operations */
uint32_t io_priv_size;
/*!< Size of io private context structure */
uint32_t volume_priv_size;
/*!< Size of volume private context structure */
struct ocf_volume_caps caps;
/*!< Volume capabilities */
struct ocf_io_ops io_ops;
/*!< IO operations */
void (*deinit)(void);
/*!< Deinitialize volume type */