Zero superblock before writing metadata

This is the first step towards atomic initialization of metadata
on cache disk.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-12-21 18:16:23 +01:00
parent c6644116ae
commit 196437f9bc
9 changed files with 141 additions and 2 deletions

View File

@@ -1628,6 +1628,16 @@ void ocf_metadata_load_properties(ocf_volume_t volume,
OCF_CMPL_RET(priv, result, NULL);
}
void ocf_metadata_zero_superblock(ocf_cache_t cache,
ocf_metadata_end_t cmpl, void *context)
{
struct ocf_metadata_ctrl *ctrl = (struct ocf_metadata_ctrl *)
cache->metadata.priv;
ocf_metadata_sb_zero(ctrl->segment[metadata_segment_sb_config],
cmpl, context);
}
/* metadata segment data + iterators */
struct query_cores_data
{