diff --git a/modules/cas_cache/context.c b/modules/cas_cache/context.c index ed5b1cc..94eb55a 100644 --- a/modules/cas_cache/context.c +++ b/modules/cas_cache/context.c @@ -82,7 +82,7 @@ static int _cas_page_get_cpu(struct page *page) /* * */ -static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc) +static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages) { struct blk_data *data; uint32_t i; @@ -116,14 +116,6 @@ static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc) if (!data->vec[i].bv_page) break; - if (zalloc) { - if (!page_addr) { - page_addr = page_address( - data->vec[i].bv_page); - } - memset(page_addr, 0, PAGE_SIZE); - } - data->vec[i].bv_len = PAGE_SIZE; data->vec[i].bv_offset = 0; } @@ -153,12 +145,7 @@ static ctx_data_t *__cas_ctx_data_alloc(uint32_t pages, bool zalloc) ctx_data_t *cas_ctx_data_alloc(uint32_t pages) { - return __cas_ctx_data_alloc(pages, false); -} - -ctx_data_t *cas_ctx_data_zalloc(uint32_t pages) -{ - return __cas_ctx_data_alloc(pages, true); + return __cas_ctx_data_alloc(pages); } /* diff --git a/modules/cas_cache/context.h b/modules/cas_cache/context.h index 5e95789..b502330 100644 --- a/modules/cas_cache/context.h +++ b/modules/cas_cache/context.h @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2022 Intel Corporation +* Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -69,7 +70,6 @@ struct blk_data *cas_alloc_blk_data(uint32_t size, gfp_t flags); void cas_free_blk_data(struct blk_data *data); ctx_data_t *cas_ctx_data_alloc(uint32_t pages); -ctx_data_t *cas_ctx_data_zalloc(uint32_t pages); void cas_ctx_data_free(ctx_data_t *ctx_data); void cas_ctx_data_secure_erase(ctx_data_t *ctx_data);