From f461f3c62edbed7a7ab2c15a267c6b6dfca4cf76 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Mon, 23 Sep 2019 10:28:25 -0400 Subject: [PATCH] Extend probe informations with cache name. Since ocf requires loading cache with the same name as it was stopped, it should also allow to read name from metadata. Signed-off-by: Michal Mielewczyk --- inc/ocf_metadata.h | 3 +++ src/metadata/metadata.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/inc/ocf_metadata.h b/inc/ocf_metadata.h index f2951cf..5ecfbca 100644 --- a/inc/ocf_metadata.h +++ b/inc/ocf_metadata.h @@ -60,6 +60,9 @@ struct ocf_metadata_probe_status { /** Cache contains dirty data */ bool cache_dirty; + + /** Loaded name of cache instance */ + char cache_name[OCF_CACHE_NAME_SIZE]; }; /** diff --git a/src/metadata/metadata.c b/src/metadata/metadata.c index 3050d0c..9964d46 100644 --- a/src/metadata/metadata.c +++ b/src/metadata/metadata.c @@ -330,6 +330,8 @@ static void ocf_metadata_probe_cmpl(struct ocf_metadata_read_sb_ctx *context) status.clean_shutdown = (superblock->clean_shutdown != ocf_metadata_dirty_shutdown); status.cache_dirty = (superblock->dirty_flushed == DIRTY_NOT_FLUSHED); + env_strncpy(status.cache_name, OCF_CACHE_NAME_SIZE, superblock->name, + OCF_CACHE_NAME_SIZE); OCF_CMPL_RET(priv, 0, &status); }