Introduce ocf_forward_metadata()

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 15:26:13 +02:00
committed by Michal Mielewczyk
parent 17144e5d32
commit 5859e432c8
7 changed files with 72 additions and 0 deletions

View File

@@ -299,6 +299,23 @@ void ocf_forward_discard(ocf_volume_t volume, ocf_forward_token_t token,
void ocf_forward_write_zeros(ocf_volume_t volume, ocf_forward_token_t token,
uint64_t addr, uint64_t bytes);
/**
* @brief Forward metadata io to another subvolume
*
* Forwarding automatically increases forwarded io refcount, so at some
* point additional ocf_forward_end() needs to be called to balance it.
*
* @param[in] token Forward token
* @param[in] volume Volume to which IO is being submitted
* @param[in] token Token representing IO to be forwarded
* @param[in] dir Direction OCF_READ/OCF_WRITE
* @param[in] addr Address to which IO is being submitted
* @param[in] bytes Length of the IO
* @param[in] offset Offset within the IO data
*/
void ocf_forward_metadata(ocf_volume_t volume, ocf_forward_token_t token,
int dir, uint64_t addr, uint64_t bytes, uint64_t offset);
/**
* @brief Increment forwarded io refcount
*

View File

@@ -129,6 +129,20 @@ struct ocf_volume_ops {
ocf_forward_token_t token, uint64_t addr,
uint64_t bytes);
/**
* @brief Forward the metadata io directly to the volume
*
* @param[in] volume Volume to which IO is being submitted
* @param[in] token Token representing IO to be forwarded
* @param[in] dir Direction OCF_READ/OCF_WRITE
* @param[in] addr Address to which IO is being submitted
* @param[in] bytes Length of the IO
* @param[in] offset Offset within the IO data
*/
void (*forward_metadata)(ocf_volume_t volume, ocf_forward_token_t token,
int dir, uint64_t addr, uint64_t bytes,
uint64_t offset);
/**
* @brief Volume initialization callback, called when volume object
* is being initialized