Introduce forward_io_simple

It's intended to be used in a context, where cache is not initialized
and the io_queue is not available yet.

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-16 22:13:33 +02:00
committed by Michal Mielewczyk
parent 1f26ceb563
commit 1c2d5bbcf3
7 changed files with 76 additions and 0 deletions

View File

@@ -337,6 +337,22 @@ void ocf_forward_write_zeros(ocf_volume_t volume, ocf_forward_token_t token,
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 Forward io simple 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
*/
void ocf_forward_io_simple(ocf_volume_t volume, ocf_forward_token_t token,
int dir, uint64_t addr, uint64_t bytes);
/**
* @brief Increment forwarded io refcount
*

View File

@@ -143,6 +143,20 @@ struct ocf_volume_ops {
int dir, uint64_t addr, uint64_t bytes,
uint64_t offset);
/**
* @brief Forward the io directly to the volume in context
* where cache is not initialized yet
*
* @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
*/
void (*forward_io_simple)(ocf_volume_t volume,
ocf_forward_token_t token, int dir,
uint64_t addr, uint64_t bytes);
/**
* @brief Volume initialization callback, called when volume object
* is being initialized