Add volume_params argument to bottom volume open

This pointer is used to provide optional volume specific data
from the user down to bottom volume open callback. volume_params
is provided to OCF in ocf_mngt_cache_device_config.volume_params.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2019-04-01 16:36:08 -04:00
parent cc30794160
commit 2aba5a2843
7 changed files with 21 additions and 12 deletions

View File

@@ -341,6 +341,12 @@ struct ocf_mngt_cache_device_config {
* @brief If set, cache device will be discarded on cache start
*/
bool discard_on_start;
/**
* @brief Optional opaque volume parameters, passed down to cache volume
* open callback
*/
void *volume_params;
};
/**

View File

@@ -88,8 +88,9 @@ struct ocf_volume_ops {
* be called before any other operation on volume
*
* @param[in] volume Volume
* @param[in] volume_params optional volume parameters, opaque to OCF
*/
int (*open)(ocf_volume_t volume);
int (*open)(ocf_volume_t volume, void *volume_params);
/**
* @brief Close volume
@@ -285,10 +286,11 @@ void ocf_volume_submit_discard(struct ocf_io *io);
* @brief Open volume
*
* @param[in] volume Volume
* @param[in] volume_params Opaque volume params
*
* @return Zero when success, othewise en error
*/
int ocf_volume_open(ocf_volume_t volume);
int ocf_volume_open(ocf_volume_t volume, void *volume_params);
/**
* @brief Get volume max io size