Rename cacheline concurrency struct to alock

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-04-02 19:15:59 -05:00
committed by Kozlowski Mateusz
parent 927bc805fe
commit d22a3ad0e0
7 changed files with 208 additions and 210 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@
/**
* @brief OCF cache concurrency module handle
*/
struct ocf_cache_line_concurrency;
struct ocf_alock;
/**
* @brief Initialize OCF cache concurrency module
@@ -25,7 +25,7 @@ struct ocf_cache_line_concurrency;
* @return 0 - Initialization successful, otherwise ERROR
*/
int ocf_cache_line_concurrency_init(struct ocf_cache_line_concurrency **self,
int ocf_cache_line_concurrency_init(struct ocf_alock **self,
unsigned num_clines, struct ocf_cache *cache);
/**
@@ -34,7 +34,7 @@ int ocf_cache_line_concurrency_init(struct ocf_cache_line_concurrency **self,
* @param self - cacheline concurrency private data
*/
void ocf_cache_line_concurrency_deinit(
struct ocf_cache_line_concurrency **self);
struct ocf_alock **self);
/**
* @brief Get number of waiting (suspended) OCF requests in due to cache
@@ -44,7 +44,7 @@ void ocf_cache_line_concurrency_deinit(
*
* @return Number of suspended OCF requests
*/
uint32_t ocf_cache_line_concurrency_suspended_no(struct ocf_cache_line_concurrency *c);
uint32_t ocf_cache_line_concurrency_suspended_no(struct ocf_alock *c);
/**
* @brief Return memory footprint conusmed by cache concurrency module
@@ -71,7 +71,7 @@ typedef void (*ocf_req_async_lock_cb)(struct ocf_request *req);
* @retval OCF_LOCK_NOT_ACQUIRED - OCF request lock not acquired, request was
* added into waiting list. When lock will be acquired @cmpl cllback be called
*/
int ocf_req_async_lock_wr(struct ocf_cache_line_concurrency *c,
int ocf_req_async_lock_wr(struct ocf_alock *c,
struct ocf_request *req, ocf_req_async_lock_cb cmpl);
/**
@@ -87,7 +87,7 @@ int ocf_req_async_lock_wr(struct ocf_cache_line_concurrency *c,
* @retval OCF_LOCK_NOT_ACQUIRED - OCF request lock not acquired, request was
* added into waiting list. When lock will be acquired @cmpl callback be called
*/
int ocf_req_async_lock_rd(struct ocf_cache_line_concurrency *c,
int ocf_req_async_lock_rd(struct ocf_alock *c,
struct ocf_request *req, ocf_req_async_lock_cb cmpl);
/**
@@ -96,7 +96,7 @@ int ocf_req_async_lock_rd(struct ocf_cache_line_concurrency *c,
* @param c - cacheline concurrency private data
* @param req - OCF request
*/
void ocf_req_unlock_wr(struct ocf_cache_line_concurrency *c,
void ocf_req_unlock_wr(struct ocf_alock *c,
struct ocf_request *req);
/**
@@ -105,7 +105,7 @@ void ocf_req_unlock_wr(struct ocf_cache_line_concurrency *c,
* @param c - cacheline concurrency private data
* @param req - OCF request
*/
void ocf_req_unlock_rd(struct ocf_cache_line_concurrency *c,
void ocf_req_unlock_rd(struct ocf_alock *c,
struct ocf_request *req);
/**
@@ -114,7 +114,7 @@ void ocf_req_unlock_rd(struct ocf_cache_line_concurrency *c,
* @param c - cacheline concurrency private data
* @param req - OCF request
*/
void ocf_req_unlock(struct ocf_cache_line_concurrency *c,
void ocf_req_unlock(struct ocf_alock *c,
struct ocf_request *req);
/**
@@ -131,7 +131,7 @@ void ocf_req_unlock(struct ocf_cache_line_concurrency *c,
* @retval true - cache line is used
* @retval false - cache line is not used
*/
bool ocf_cache_line_is_used(struct ocf_cache_line_concurrency *c,
bool ocf_cache_line_is_used(struct ocf_alock *c,
ocf_cache_line_t line);
/**
@@ -144,7 +144,7 @@ bool ocf_cache_line_is_used(struct ocf_cache_line_concurrency *c,
* @retval true - there are waiters
* @retval false - No waiters
*/
bool ocf_cache_line_are_waiters(struct ocf_cache_line_concurrency *c,
bool ocf_cache_line_are_waiters(struct ocf_alock *c,
ocf_cache_line_t line);
bool ocf_cache_line_is_locked_exclusively(struct ocf_cache *cache,
@@ -157,7 +157,7 @@ bool ocf_cache_line_is_locked_exclusively(struct ocf_cache *cache,
* @param req - OCF request
* @param entry - request map entry number
*/
void ocf_req_unlock_entry(struct ocf_cache_line_concurrency *c,
void ocf_req_unlock_entry(struct ocf_alock *c,
struct ocf_request *req, uint32_t entry);
/**
@@ -166,7 +166,7 @@ void ocf_req_unlock_entry(struct ocf_cache_line_concurrency *c,
* @param cache - OCF cache instance
* @param line - Cache line to be unlocked
*/
void ocf_cache_line_unlock_rd(struct ocf_cache_line_concurrency *c,
void ocf_cache_line_unlock_rd(struct ocf_alock *c,
ocf_cache_line_t line);
/**
@@ -178,7 +178,7 @@ void ocf_cache_line_unlock_rd(struct ocf_cache_line_concurrency *c,
* @retval true - read lock successfully acquired
* @retval false - failed to acquire read lock
*/
bool ocf_cache_line_try_lock_rd(struct ocf_cache_line_concurrency *c,
bool ocf_cache_line_try_lock_rd(struct ocf_alock *c,
ocf_cache_line_t line);
/**
@@ -187,7 +187,7 @@ bool ocf_cache_line_try_lock_rd(struct ocf_cache_line_concurrency *c,
* @param c - cacheline concurrency private data
* @param line - Cache line to be unlocked
*/
void ocf_cache_line_unlock_wr(struct ocf_cache_line_concurrency *c,
void ocf_cache_line_unlock_wr(struct ocf_alock *c,
ocf_cache_line_t line);
/**
@@ -199,7 +199,7 @@ void ocf_cache_line_unlock_wr(struct ocf_cache_line_concurrency *c,
* @retval true - write lock successfully acquired
* @retval false - failed to acquire write lock
*/
bool ocf_cache_line_try_lock_wr(struct ocf_cache_line_concurrency *c,
bool ocf_cache_line_try_lock_wr(struct ocf_alock *c,
ocf_cache_line_t line);
/**
@@ -208,7 +208,7 @@ bool ocf_cache_line_try_lock_wr(struct ocf_cache_line_concurrency *c,
* @param cache - cache instance
* @return cacheline concurrency context
*/
static inline struct ocf_cache_line_concurrency *
static inline struct ocf_alock *
ocf_cache_line_concurrency(ocf_cache_t cache)
{
return cache->device->concurrency.cache_line;