Merge pull request #343 from robertbaldyga/relax-memory-alloc-requirements-metadata-io

metadata: Relax memory allocation requirements
This commit is contained in:
Michał Mielewczyk 2020-01-24 11:37:31 +01:00 committed by GitHub
commit 30f884ba84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -9,7 +9,6 @@
#include "../engine/engine_common.h"
#include "../engine/engine_bf.h"
#include "../utils/utils_cache_line.h"
#include "../utils/utils_realloc.h"
#include "../utils/utils_io.h"
#include "../ocf_request.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;
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)
@ -376,7 +375,7 @@ static int metadata_io_i_asynch(ocf_cache_t cache, ocf_queue_t queue, int dir,
if (count == 0)
return 0;
a_req = env_zalloc(sizeof(*a_req), ENV_MEM_NOIO);
a_req = env_vzalloc(sizeof(*a_req));
if (!a_req)
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:
while (i--)
ctx_data_free(cache->owner, a_req->reqs[i].data);
env_free(a_req);
env_vfree(a_req);
return -OCF_ERR_NO_MEM;
}

View File

@ -11,7 +11,6 @@
#include "../ocf_cache_priv.h"
#include "../ocf_ctx_priv.h"
#include "../utils/utils_io.h"
#include "../utils/utils_realloc.h"
int ocf_metadata_updater_init(ocf_cache_t cache)
{