This one is quite special, because it can be called before cache is
instantiated, which means we can not allocate the request using
ocf_req_new_mngt() due to absence of mngt_queue. For that reason we
simply allocate request using env_zalloc() and then release it with
env_free(). The lifecycle of the request is very straightforward and
the only used fields are forward counter and callback.
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
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>
struct ocf_io is going to be removed soon (consolidated with ocf_request).
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
Skip the ocf_io abstraction and get the data directly from the request.
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
Those are meant to be used in context where no cache nor queue is
available (typically at very early stage of initialization). We reuse
cache_forward* callback and counter, because they will not be used
in this context anyway.
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This is meant to be used in atomic mode to avoid allocating huge buffers
for zeroing data on drive.
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
Avoid unnecessary code execution in D2C mode.
Avoid multiple req->d2c check in normal I/O path.
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
Allow composite volume to forward the io to sub-volumes, splitting it
into several forward operations when needed. This is still done with
zero allocations, making forward even more efficient when combined with
composite volume.
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
Allow the core volume IOs to be forwarded directly to backend volumes to
avoid unnecessary allocations.
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This reverts commit 77d949bdcc.
Returning the actual amount of RAM may cause test_start_cache_huge_device to
fail
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
Signed-off-by: Avi Halaf <avi.halaf@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>