Merge pull request #343 from robertbaldyga/relax-memory-alloc-requirements-metadata-io
metadata: Relax memory allocation requirements
This commit is contained in:
commit
30f884ba84
@ -9,7 +9,6 @@
|
|||||||
#include "../engine/engine_common.h"
|
#include "../engine/engine_common.h"
|
||||||
#include "../engine/engine_bf.h"
|
#include "../engine/engine_bf.h"
|
||||||
#include "../utils/utils_cache_line.h"
|
#include "../utils/utils_cache_line.h"
|
||||||
#include "../utils/utils_realloc.h"
|
|
||||||
#include "../utils/utils_io.h"
|
#include "../utils/utils_io.h"
|
||||||
#include "../ocf_request.h"
|
#include "../ocf_request.h"
|
||||||
#include "../ocf_def_priv.h"
|
#include "../ocf_def_priv.h"
|
||||||
@ -298,7 +297,7 @@ void metadata_io_req_finalize(struct metadata_io_request *m_req)
|
|||||||
struct metadata_io_request_asynch *a_req = m_req->asynch;
|
struct metadata_io_request_asynch *a_req = m_req->asynch;
|
||||||
|
|
||||||
if (env_atomic_dec_return(&a_req->req_active) == 0)
|
if (env_atomic_dec_return(&a_req->req_active) == 0)
|
||||||
env_free(a_req);
|
env_vfree(a_req);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t metadata_io_max_page(ocf_cache_t cache)
|
static uint32_t metadata_io_max_page(ocf_cache_t cache)
|
||||||
@ -376,7 +375,7 @@ static int metadata_io_i_asynch(ocf_cache_t cache, ocf_queue_t queue, int dir,
|
|||||||
if (count == 0)
|
if (count == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
a_req = env_zalloc(sizeof(*a_req), ENV_MEM_NOIO);
|
a_req = env_vzalloc(sizeof(*a_req));
|
||||||
if (!a_req)
|
if (!a_req)
|
||||||
return -OCF_ERR_NO_MEM;
|
return -OCF_ERR_NO_MEM;
|
||||||
|
|
||||||
@ -430,7 +429,7 @@ static int metadata_io_i_asynch(ocf_cache_t cache, ocf_queue_t queue, int dir,
|
|||||||
err:
|
err:
|
||||||
while (i--)
|
while (i--)
|
||||||
ctx_data_free(cache->owner, a_req->reqs[i].data);
|
ctx_data_free(cache->owner, a_req->reqs[i].data);
|
||||||
env_free(a_req);
|
env_vfree(a_req);
|
||||||
|
|
||||||
return -OCF_ERR_NO_MEM;
|
return -OCF_ERR_NO_MEM;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#include "../ocf_cache_priv.h"
|
#include "../ocf_cache_priv.h"
|
||||||
#include "../ocf_ctx_priv.h"
|
#include "../ocf_ctx_priv.h"
|
||||||
#include "../utils/utils_io.h"
|
#include "../utils/utils_io.h"
|
||||||
#include "../utils/utils_realloc.h"
|
|
||||||
|
|
||||||
int ocf_metadata_updater_init(ocf_cache_t cache)
|
int ocf_metadata_updater_init(ocf_cache_t cache)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user