Commit c9272021 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Jim Harris
Browse files

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: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455922


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarWojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent e1dbe1c8
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
		}