Switching mechanism for promotion policies

Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
Jan Musial
2019-08-26 13:52:11 +02:00
parent e3a20c0da0
commit a1d3cf0c4d
12 changed files with 252 additions and 26 deletions

View File

@@ -83,8 +83,6 @@ static int _ocf_discard_core(struct ocf_request *req)
ocf_volume_submit_discard(io);
ocf_promotion_req_purge(req->cache->promotion_policy, req);
return 0;
}
@@ -186,6 +184,14 @@ int _ocf_discard_step_do(struct ocf_request *req)
OCF_METADATA_UNLOCK_WR(); /*- END Metadata WR access ---------*/
}
OCF_METADATA_LOCK_RD();
/* Even if no cachelines are mapped they could be tracked in promotion
* policy. RD lock suffices. */
ocf_promotion_req_purge(req->cache->promotion_policy, req);
OCF_METADATA_UNLOCK_RD();
OCF_DEBUG_RQ(req, "Discard");
_ocf_discard_step_complete(req, 0);