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:
committed by
Michal Mielewczyk
parent
17144e5d32
commit
5859e432c8
@@ -479,6 +479,18 @@ void ocf_req_forward_cache_write_zeros(struct ocf_request *req, uint64_t addr,
|
||||
ocf_volume_forward_write_zeros(volume, token, addr, bytes);
|
||||
}
|
||||
|
||||
void ocf_req_forward_cache_metadata(struct ocf_request *req, int dir,
|
||||
uint64_t addr, uint64_t bytes, uint64_t offset)
|
||||
{
|
||||
ocf_volume_t volume = ocf_cache_get_volume(req->cache);
|
||||
ocf_forward_token_t token = ocf_req_to_cache_forward_token(req);
|
||||
|
||||
req->cache_error = 0;
|
||||
|
||||
ocf_req_forward_cache_get(req);
|
||||
ocf_volume_forward_metadata(volume, token, dir, addr, bytes, offset);
|
||||
}
|
||||
|
||||
void ocf_req_forward_core_io(struct ocf_request *req, int dir, uint64_t addr,
|
||||
uint64_t bytes, uint64_t offset)
|
||||
{
|
||||
@@ -563,6 +575,13 @@ void ocf_forward_write_zeros(ocf_volume_t volume, ocf_forward_token_t token,
|
||||
ocf_volume_forward_write_zeros(volume, token, addr, bytes);
|
||||
}
|
||||
|
||||
void ocf_forward_metadata(ocf_volume_t volume, ocf_forward_token_t token,
|
||||
int dir, uint64_t addr, uint64_t bytes, uint64_t offset)
|
||||
{
|
||||
_ocf_forward_get(token);
|
||||
ocf_volume_forward_metadata(volume, token, dir, addr, bytes, offset);
|
||||
}
|
||||
|
||||
void ocf_forward_end(ocf_forward_token_t token, int error)
|
||||
{
|
||||
struct ocf_request *req = ocf_req_forward_token_to_req(token);
|
||||
|
||||
@@ -564,6 +564,9 @@ void ocf_req_forward_cache_discard(struct ocf_request *req, uint64_t addr,
|
||||
void ocf_req_forward_cache_write_zeros(struct ocf_request *req, uint64_t addr,
|
||||
uint64_t bytes);
|
||||
|
||||
void ocf_req_forward_cache_metadata(struct ocf_request *req, int dir,
|
||||
uint64_t addr, uint64_t bytes, uint64_t offset);
|
||||
|
||||
void ocf_req_forward_core_io(struct ocf_request *req, int dir, uint64_t addr,
|
||||
uint64_t bytes, uint64_t offset);
|
||||
|
||||
|
||||
@@ -384,6 +384,20 @@ void ocf_volume_forward_write_zeros(ocf_volume_t volume,
|
||||
addr, bytes);
|
||||
}
|
||||
|
||||
void ocf_volume_forward_metadata(ocf_volume_t volume, ocf_forward_token_t token,
|
||||
int dir, uint64_t addr, uint64_t bytes, uint64_t offset)
|
||||
{
|
||||
ENV_BUG_ON(!volume->type->properties->ops.forward_metadata);
|
||||
|
||||
if (!volume->opened) {
|
||||
ocf_forward_end(token, -OCF_ERR_IO);
|
||||
return;
|
||||
}
|
||||
|
||||
volume->type->properties->ops.forward_metadata(volume, token,
|
||||
dir, addr, bytes, offset);
|
||||
}
|
||||
|
||||
int ocf_volume_open(ocf_volume_t volume, void *volume_params)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -58,6 +58,9 @@ void ocf_volume_forward_discard(ocf_volume_t volume, ocf_forward_token_t token,
|
||||
void ocf_volume_forward_write_zeros(ocf_volume_t volume,
|
||||
ocf_forward_token_t token, uint64_t addr, uint64_t bytes);
|
||||
|
||||
void ocf_volume_forward_metadata(ocf_volume_t volume, ocf_forward_token_t token,
|
||||
int dir, uint64_t addr, uint64_t bytes, uint64_t offset);
|
||||
|
||||
static inline void ocf_volume_submit_metadata(struct ocf_io *io)
|
||||
{
|
||||
ocf_volume_t volume = ocf_io_get_volume(io);
|
||||
|
||||
Reference in New Issue
Block a user