Remove ocf_core_new_io
This function is equivalent to calling ocf_volume_new_io() on core front volume Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -99,40 +99,12 @@ class Core:
|
||||
def get_handle(self):
|
||||
return self.handle
|
||||
|
||||
def new_io(
|
||||
self, queue: Queue, addr: int, length: int, direction: IoDir,
|
||||
io_class: int, flags: int
|
||||
):
|
||||
if not self.cache:
|
||||
raise Exception("Core isn't attached to any cache")
|
||||
|
||||
io = OcfLib.getInstance().ocf_core_new_io_wrapper(
|
||||
self.handle, queue.handle, addr, length, direction, io_class, flags)
|
||||
|
||||
if io is None:
|
||||
raise Exception("Failed to create io!")
|
||||
|
||||
return Io.from_pointer(io)
|
||||
|
||||
def get_front_volume(self):
|
||||
return Volume.get_instance(lib.ocf_core_get_front_volume(self.handle))
|
||||
|
||||
def get_volume(self):
|
||||
return Volume.get_instance(lib.ocf_core_get_volume(self.handle))
|
||||
|
||||
def new_core_io(
|
||||
self,
|
||||
queue: Queue,
|
||||
addr: int,
|
||||
length: int,
|
||||
direction: IoDir,
|
||||
io_class: int,
|
||||
flags: int,
|
||||
):
|
||||
return self.get_volume().new_io(
|
||||
queue, addr, length, direction, io_class, flags
|
||||
)
|
||||
|
||||
def get_default_queue(self):
|
||||
return self.cache.get_default_queue()
|
||||
|
||||
@@ -250,13 +222,3 @@ lib.ocf_stats_collect_core.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c
|
||||
lib.ocf_stats_collect_core.restype = c_int
|
||||
lib.ocf_core_get_info.argtypes = [c_void_p, c_void_p]
|
||||
lib.ocf_core_get_info.restype = c_int
|
||||
lib.ocf_core_new_io_wrapper.argtypes = [
|
||||
c_void_p,
|
||||
c_void_p,
|
||||
c_uint64,
|
||||
c_uint32,
|
||||
c_uint32,
|
||||
c_uint32,
|
||||
c_uint64,
|
||||
]
|
||||
lib.ocf_core_new_io_wrapper.restype = c_void_p
|
||||
|
@@ -117,9 +117,6 @@ IoOps._fields_ = [("_set_data", IoOps.SET_DATA), ("_get_data", IoOps.GET_DATA)]
|
||||
lib = OcfLib.getInstance()
|
||||
lib.ocf_io_set_cmpl_wrapper.argtypes = [POINTER(Io), c_void_p, c_void_p, Io.END]
|
||||
|
||||
lib.ocf_core_new_io_wrapper.argtypes = [c_void_p]
|
||||
lib.ocf_core_new_io_wrapper.restype = c_void_p
|
||||
|
||||
lib.ocf_io_set_data.argtypes = [POINTER(Io), c_void_p, c_uint32]
|
||||
lib.ocf_io_set_data.restype = c_int
|
||||
|
||||
|
@@ -6,13 +6,6 @@
|
||||
#include "ocf/ocf_io.h"
|
||||
#include "ocf/ocf_core.h"
|
||||
|
||||
struct ocf_io *ocf_core_new_io_wrapper(ocf_core_t core, ocf_queue_t queue,
|
||||
uint64_t addr, uint32_t bytes, uint32_t dir,
|
||||
uint32_t io_class, uint64_t flags)
|
||||
{
|
||||
return ocf_core_new_io(core, queue, addr, bytes, dir, io_class, flags);
|
||||
}
|
||||
|
||||
void ocf_io_set_cmpl_wrapper(struct ocf_io *io, void *context,
|
||||
void *context2, ocf_end_io_t fn)
|
||||
{
|
||||
|
Reference in New Issue
Block a user