Ensure that core name is set and unique

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-07-20 13:51:03 +02:00
parent 9853814252
commit 4f0735b503
7 changed files with 77 additions and 40 deletions

View File

@@ -179,6 +179,13 @@ static inline ocf_core_t ocf_cache_get_core(ocf_cache_t cache,
return &cache->core[core_id];
}
#define for_each_core_all(_cache, _core, _id) \
for (_id = 0; _core = &cache->core[_id], _id < OCF_CORE_MAX; _id++)
#define for_each_core(_cache, _core, _id) \
for_each_core_all(_cache, _core, _id) \
if (_core->conf_meta->added)
#define ocf_cache_log_prefix(cache, lvl, prefix, fmt, ...) \
ocf_log_prefix(ocf_cache_get_ctx(cache), lvl, "%s" prefix, \
fmt, ocf_cache_get_name(cache), ##__VA_ARGS__)