Merge pull request #106 from imjfckm/fix-puts
Remove unneccessary cache_puts
This commit is contained in:
commit
b3dd5ead36
@ -271,10 +271,8 @@ int cache_mngt_set_cleaning_policy(ocf_cache_t cache, uint32_t type)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = _cache_mngt_lock_sync(cache);
|
result = _cache_mngt_lock_sync(cache);
|
||||||
if (result) {
|
if (result)
|
||||||
ocf_mngt_cache_put(cache);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
result = ocf_mngt_cache_cleaning_set_policy(cache, type);
|
result = ocf_mngt_cache_cleaning_set_policy(cache, type);
|
||||||
if (result)
|
if (result)
|
||||||
@ -293,10 +291,8 @@ int cache_mngt_get_cleaning_policy(ocf_cache_t cache, uint32_t *type)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = _cache_mngt_read_lock_sync(cache);
|
result = _cache_mngt_read_lock_sync(cache);
|
||||||
if (result) {
|
if (result)
|
||||||
ocf_mngt_cache_put(cache);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
result = ocf_mngt_cache_cleaning_get_policy(cache, &tmp_type);
|
result = ocf_mngt_cache_cleaning_get_policy(cache, &tmp_type);
|
||||||
|
|
||||||
@ -313,10 +309,8 @@ int cache_mngt_set_cleaning_param(ocf_cache_t cache, ocf_cleaning_t type,
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = _cache_mngt_lock_sync(cache);
|
result = _cache_mngt_lock_sync(cache);
|
||||||
if (result) {
|
if (result)
|
||||||
ocf_mngt_cache_put(cache);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
result = ocf_mngt_cache_cleaning_set_param(cache, type,
|
result = ocf_mngt_cache_cleaning_set_param(cache, type,
|
||||||
param_id, param_value);
|
param_id, param_value);
|
||||||
@ -336,10 +330,8 @@ int cache_mngt_get_cleaning_param(ocf_cache_t cache, ocf_cleaning_t type,
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = _cache_mngt_read_lock_sync(cache);
|
result = _cache_mngt_read_lock_sync(cache);
|
||||||
if (result) {
|
if (result)
|
||||||
ocf_mngt_cache_put(cache);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
result = ocf_mngt_cache_cleaning_get_param(cache, type,
|
result = ocf_mngt_cache_cleaning_get_param(cache, type,
|
||||||
param_id, param_value);
|
param_id, param_value);
|
||||||
@ -1575,12 +1567,15 @@ int cache_mngt_get_seq_cutoff_threshold(ocf_core_t core, uint32_t *thresh)
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = _cache_mngt_read_lock_sync(cache);
|
result = _cache_mngt_read_lock_sync(cache);
|
||||||
if (result)
|
if (result) {
|
||||||
|
ocf_mngt_cache_put(cache);
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
result = ocf_mngt_core_get_seq_cutoff_threshold(core, thresh);
|
result = ocf_mngt_core_get_seq_cutoff_threshold(core, thresh);
|
||||||
|
|
||||||
ocf_mngt_cache_read_unlock(cache);
|
ocf_mngt_cache_read_unlock(cache);
|
||||||
|
ocf_mngt_cache_put(cache);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1599,12 +1594,15 @@ int cache_mngt_get_seq_cutoff_policy(ocf_core_t core,
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = _cache_mngt_read_lock_sync(cache);
|
result = _cache_mngt_read_lock_sync(cache);
|
||||||
if (result)
|
if (result) {
|
||||||
|
ocf_mngt_cache_put(cache);
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
result = ocf_mngt_core_get_seq_cutoff_policy(core, policy);
|
result = ocf_mngt_core_get_seq_cutoff_policy(core, policy);
|
||||||
|
|
||||||
ocf_mngt_cache_read_unlock(cache);
|
ocf_mngt_cache_read_unlock(cache);
|
||||||
|
ocf_mngt_cache_put(cache);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user