Skip to content

Commit

Permalink
Merge pull request #343 from robertbaldyga/relax-memory-alloc-require…
Browse files Browse the repository at this point in the history
…ments-metadata-io

metadata: Relax memory allocation requirements
  • Loading branch information
Michał Mielewczyk authored Jan 24, 2020
2 parents 89f0e96 + 7d82f20 commit 30f884b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/metadata/metadata_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion src/metadata/metadata_updater.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 30f884b

Please sign in to comment.