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 <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2019-09-23 10:28:25 -04:00
parent 39c5819a51
commit f461f3c62e
2 changed files with 5 additions and 0 deletions

View File

@ -60,6 +60,9 @@ struct ocf_metadata_probe_status {
/** Cache contains dirty data */ /** Cache contains dirty data */
bool cache_dirty; bool cache_dirty;
/** Loaded name of cache instance */
char cache_name[OCF_CACHE_NAME_SIZE];
}; };
/** /**

View File

@ -330,6 +330,8 @@ static void ocf_metadata_probe_cmpl(struct ocf_metadata_read_sb_ctx *context)
status.clean_shutdown = (superblock->clean_shutdown != status.clean_shutdown = (superblock->clean_shutdown !=
ocf_metadata_dirty_shutdown); ocf_metadata_dirty_shutdown);
status.cache_dirty = (superblock->dirty_flushed == DIRTY_NOT_FLUSHED); 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); OCF_CMPL_RET(priv, 0, &status);
} }