Give ocf_ctx get/put semantics

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-05-22 16:29:42 +02:00
parent 76bcac5b45
commit c903d13ad2
8 changed files with 42 additions and 28 deletions

View File

@@ -51,7 +51,7 @@ class OcfCtx:
logger_priv=cast(pointer(logger.get_priv()), c_void_p),
)
result = self.lib.ocf_ctx_init(byref(self.ctx_handle), byref(self.cfg))
result = self.lib.ocf_ctx_create(byref(self.ctx_handle), byref(self.cfg))
if result != 0:
raise OcfError("Context initialization failed", result)
@@ -95,9 +95,7 @@ class OcfCtx:
self.stop_caches()
self.cleanup_volume_types()
result = self.lib.ocf_ctx_exit(self.ctx_handle)
if result != 0:
raise OcfError("Failed quitting OcfCtx", result)
self.lib.ocf_ctx_put(self.ctx_handle)
self.cfg = None
self.logger = None