Remove cache id - test update

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-07-25 15:27:54 +02:00
parent 1100cb0b4f
commit a32ca74519
3 changed files with 19 additions and 28 deletions

View File

@@ -42,7 +42,6 @@ class Backfill(Structure):
class CacheConfig(Structure):
_fields_ = [
("_id", c_uint16),
("_name", c_char_p),
("_cache_mode", c_uint32),
("_eviction_policy", c_uint32),
@@ -134,7 +133,6 @@ class Cache:
def __init__(
self,
owner,
cache_id: int = DEFAULT_ID,
name: str = "cache",
cache_mode: CacheMode = CacheMode.DEFAULT,
eviction_policy: EvictionPolicy = EvictionPolicy.DEFAULT,
@@ -154,7 +152,6 @@ class Cache:
self.cache_line_size = cache_line_size
self.cfg = CacheConfig(
_id=cache_id,
_name=cast(create_string_buffer(name.encode("ascii")), c_char_p),
_cache_mode=cache_mode,
_eviction_policy=eviction_policy,
@@ -437,7 +434,7 @@ class Cache:
raise OcfError("Failed getting stats", status)
line_size = CacheLineSize(cache_info.cache_line_size)
cache_id = self.owner.lib.ocf_cache_get_id(self)
cache_name = self.owner.lib.ocf_cache_get_name(self).decode("ascii")
self.read_unlock()
return {
@@ -468,7 +465,7 @@ class Cache:
"core_count": cache_info.core_count,
"metadata_footprint": Size(cache_info.metadata_footprint),
"metadata_end_offset": Size(cache_info.metadata_end_offset),
"cache_id": cache_id,
"cache_name": cache_name,
},
"block": struct_to_dict(block),
"req": struct_to_dict(req),

View File

@@ -118,5 +118,5 @@ def get_default_ctx(logger):
lib = OcfLib.getInstance()
lib.ocf_mngt_cache_get_by_id.argtypes = [c_void_p, c_void_p, c_void_p]
lib.ocf_mngt_cache_get_by_id.restype = c_int
lib.ocf_mngt_cache_get_by_name.argtypes = [c_void_p, c_void_p, c_void_p]
lib.ocf_mngt_cache_get_by_name.restype = c_int