Consolidate ocf_request_io and ocf_request - io properties

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
2024-08-02 16:06:32 +02:00
committed by Michal Mielewczyk
parent d8d750462a
commit 3fbb75756e
25 changed files with 121 additions and 136 deletions

View File

@@ -426,7 +426,7 @@ static int metadata_io_i_asynch(ocf_cache_t cache, ocf_queue_t queue, int dir,
m_req->req.rw = dir;
m_req->req.map = LIST_POISON1;
m_req->req.alock_status = (uint8_t*)&m_req->alock_status;
m_req->req.io.flags = flags;
m_req->req.flags = flags;
/* If req_count == io_count and count is not multiple of
* max_count, for last we can allocate data smaller that

View File

@@ -30,8 +30,8 @@ static int passive_io_resume(struct ocf_request *req)
struct ocf_request *master = req->master_io_req;
ocf_cache_t cache = req->cache;
struct ocf_metadata_ctrl *ctrl = cache->metadata.priv;
uint64_t io_start_page = BYTES_TO_PAGES(master->io.addr);
uint64_t io_pages_count = BYTES_TO_PAGES(master->io.bytes);
uint64_t io_start_page = BYTES_TO_PAGES(master->addr);
uint64_t io_pages_count = BYTES_TO_PAGES(master->bytes);
uint64_t io_end_page = io_start_page + io_pages_count - 1;
enum ocf_metadata_segment_id update_segments[] = {
metadata_segment_sb_config,
@@ -77,12 +77,12 @@ int ocf_metadata_passive_update(struct ocf_request *master)
{
ocf_cache_t cache = master->cache;
struct ocf_metadata_ctrl *ctrl = cache->metadata.priv;
uint64_t io_start_page = BYTES_TO_PAGES(master->io.addr);
uint64_t io_end_page = io_start_page + BYTES_TO_PAGES(master->io.bytes);
uint64_t io_start_page = BYTES_TO_PAGES(master->addr);
uint64_t io_end_page = io_start_page + BYTES_TO_PAGES(master->bytes);
struct ocf_request *req;
int lock = 0;
if (master->io.dir == OCF_READ) {
if (master->rw == OCF_READ) {
master->complete(master, 0);
return 0;
}
@@ -92,14 +92,14 @@ int ocf_metadata_passive_update(struct ocf_request *master)
return 0;
}
if (master->io.addr % PAGE_SIZE || master->io.bytes % PAGE_SIZE) {
if (master->addr % PAGE_SIZE || master->bytes % PAGE_SIZE) {
ocf_cache_log(cache, log_warn,
"Metadata update not aligned to page size!\n");
master->complete(master, -OCF_ERR_INVAL);
return -OCF_ERR_INVAL;
}
if (master->io.bytes > MAX_PASSIVE_IO_SIZE) {
if (master->bytes > MAX_PASSIVE_IO_SIZE) {
//FIXME handle greater IOs
ocf_cache_log(cache, log_warn,
"IO size exceedes max supported size!\n");
@@ -113,7 +113,7 @@ int ocf_metadata_passive_update(struct ocf_request *master)
return -OCF_ERR_NO_MEM;
}
req->io_queue = master->io.io_queue;;
req->io_queue = master->io_queue;;
req->info.internal = true;
req->engine_handler = passive_io_resume;
req->rw = OCF_WRITE;

View File

@@ -621,7 +621,7 @@ static int _raw_ram_flush_do_asynch(ocf_cache_t cache,
result |= metadata_io_write_i_asynch(cache, req->io_queue, ctx,
raw->ssd_pages_offset + start_page, count,
req->io.flags,
req->flags,
_raw_ram_flush_do_asynch_fill,
_raw_ram_flush_do_asynch_io_complete,
raw->mio_conc);