Renaming hash bucket locking functions

1. new abbreviated previx: ocf_hb (HB stands for hash bucket)
2. clear distinction between functions requiring caller to
   hold metadata shared global lock ("naked") vs the ones
   which acquire global lock on its own ("prot" for protected)
3. clear distinction between hash bucket locking functions
   accepting hash bucket id ("id"), core line and lba ("cline")
   and entire request ("req").

Resulting naming scheme:
ocf_hb_(id/cline/req)_(prot/naked)_(lock/unlock/trylock)_(rd/wr)

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-02-05 00:05:17 -06:00
parent c822c953ed
commit 10c3c3de36
18 changed files with 204 additions and 147 deletions

View File

@@ -151,12 +151,12 @@ static int _ocf_read_generic_do(struct ocf_request *req)
if (ocf_engine_is_miss(req)) {
if (req->info.dirty_any) {
ocf_req_hash_lock_rd(req);
ocf_hb_req_prot_lock_rd(req);
/* Request is dirty need to clean request */
ocf_engine_clean(req);
ocf_req_hash_unlock_rd(req);
ocf_hb_req_prot_unlock_rd(req);
/* We need to clean request before processing, return */
ocf_req_put(req);
@@ -164,25 +164,25 @@ static int _ocf_read_generic_do(struct ocf_request *req)
return 0;
}
ocf_req_hash_lock_rd(req);
ocf_hb_req_prot_lock_rd(req);
/* Set valid status bits map */
ocf_set_valid_map_info(req);
ocf_req_hash_unlock_rd(req);
ocf_hb_req_prot_unlock_rd(req);
}
if (ocf_engine_needs_repart(req)) {
OCF_DEBUG_RQ(req, "Re-Part");
ocf_req_hash_lock_wr(req);
ocf_hb_req_prot_lock_wr(req);
/* Probably some cache lines are assigned into wrong
* partition. Need to move it to new one
*/
ocf_part_move(req);
ocf_req_hash_unlock_wr(req);
ocf_hb_req_prot_unlock_wr(req);
}
OCF_DEBUG_RQ(req, "Submit");