From c92720211d2ee17451a51d82f7ca719d3796ba80 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Tue, 28 May 2019 10:41:36 +0200 Subject: [PATCH] lib/ftl: decreased the size of the metadata buffer The metadata buffer was allocated in multiples of blocks (as well as aligned to a block). It's not necessary and is a waste of space. Change-Id: Icb13c664e82b23ea09bec16fa3c18fa98b722d57 Signed-off-by: Konrad Sztyber Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455922 Tested-by: SPDK CI Jenkins Reviewed-by: Wojciech Malikowski Reviewed-by: Darek Stojaczyk Reviewed-by: Shuhei Matsumoto --- lib/ftl/ftl_rwb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ftl/ftl_rwb.c b/lib/ftl/ftl_rwb.c index 426bbd37d..58e1d4392 100644 --- a/lib/ftl/ftl_rwb.c +++ b/lib/ftl/ftl_rwb.c @@ -150,8 +150,7 @@ ftl_rwb_batch_init(struct ftl_rwb *rwb, struct ftl_rwb_batch *batch, unsigned in { size_t md_size, i; - md_size = spdk_divide_round_up(rwb->md_size * rwb->xfer_size, FTL_BLOCK_SIZE) * - FTL_BLOCK_SIZE; + md_size = rwb->md_size * rwb->xfer_size; batch->rwb = rwb; batch->pos = pos; @@ -169,7 +168,7 @@ ftl_rwb_batch_init(struct ftl_rwb *rwb, struct ftl_rwb_batch *batch, unsigned in } if (md_size > 0) { - batch->md_buffer = spdk_dma_zmalloc(md_size, FTL_BLOCK_SIZE, NULL); + batch->md_buffer = spdk_dma_zmalloc(md_size, 0, NULL); if (!batch->md_buffer) { return -1; }