Make request structure more compressed

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-05-29 14:38:08 +02:00
parent 75fb6c7940
commit f240f81641
14 changed files with 67 additions and 66 deletions

View File

@@ -795,9 +795,9 @@ static void _req_on_lock(void *ctx, uint32_t ctx_id,
if (env_atomic_dec_return(&req->lock_remaining) == 0) {
/* All cache line locked, resume request */
OCF_DEBUG_RQ(req, "Resume");
OCF_CHECK_NULL(req->resume);
ENV_BUG_ON(!req->io_if->resume);
env_atomic_dec(&c->waiting);
req->resume(req);
req->io_if->resume(req);
}
}
@@ -806,7 +806,7 @@ static void _req_on_lock(void *ctx, uint32_t ctx_id,
*/
int ocf_req_trylock_rd(struct ocf_request *req)
{
OCF_CHECK_NULL(req->resume);
ENV_BUG_ON(!req->io_if->resume);
return _ocf_req_lock_rd_common(req, req, _req_on_lock);
}
@@ -928,7 +928,7 @@ static int _ocf_req_lock_wr_common(struct ocf_request *req, void *context,
*/
int ocf_req_trylock_wr(struct ocf_request *req)
{
OCF_CHECK_NULL(req->resume);
ENV_BUG_ON(!req->io_if->resume);
return _ocf_req_lock_wr_common(req, req, _req_on_lock);
}

View File

@@ -53,14 +53,14 @@ size_t ocf_cache_concurrency_size_of(struct ocf_cache *cache);
/**
* @brief Lock OCF request for WRITE access (Lock all cache lines in map info)
*
* @note req->resume callback has to be set
* @note io_if->resume callback has to be set
*
* @param req - OCF request
*
* @retval OCF_LOCK_ACQUIRED - OCF request has been locked and can be processed
*
* @retval OCF_LOCK_NOT_ACQUIRED - OCF request lock not acquired, request was
* added into waiting list. When lock will be acquired req->resume be called
* added into waiting list. When lock will be acquired io_if->resume be called
*/
int ocf_req_trylock_wr(struct ocf_request *req);
@@ -75,21 +75,21 @@ int ocf_req_trylock_wr(struct ocf_request *req);
* @retval OCF_LOCK_ACQUIRED - OCF request has been locked and can be processed
*
* @retval OCF_LOCK_NOT_ACQUIRED - OCF request lock not acquired, request was
* added into waiting list. When lock will be acquired req->resume be called
* added into waiting list. When lock will be acquired io_if->resume be called
*/
int ocf_req_retrylock_wr(struct ocf_request *req);
/**
* @brief Lock OCF request for READ access (Lock all cache lines in map info)
*
* @note req->resume callback has to be set
* @note io_if->resume callback has to be set
*
* @param req - OCF request
*
* @retval OCF_LOCK_ACQUIRED - OCF request has been locked and can be processed
*
* @retval OCF_LOCK_NOT_ACQUIRED - OCF request lock not acquired, request was
* added into waiting list. When lock will be acquired req->resume be called
* added into waiting list. When lock will be acquired io_if->resume be called
*/
int ocf_req_trylock_rd(struct ocf_request *req);