bdev/gpt: allocate buffer with correct alignment

Use spdk_bdev_get_buf_align() to determine the necessary memory
alignment for I/O buffers for the base bdev.

Change-Id: I6000c5b1117329d1a4618b19b6c6f3b919b7555a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408753
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2018-04-23 14:05:35 -07:00
parent 5ac6129908
commit b7060cb21a

View File

@ -133,7 +133,7 @@ spdk_gpt_base_bdev_init(struct spdk_bdev *bdev)
gpt = &gpt_base->gpt;
gpt->buf_size = spdk_max(SPDK_GPT_BUFFER_SIZE, bdev->blocklen);
gpt->buf = spdk_dma_zmalloc(gpt->buf_size, 0x1000, NULL);
gpt->buf = spdk_dma_zmalloc(gpt->buf_size, spdk_bdev_get_buf_align(bdev), NULL);
if (!gpt->buf) {
SPDK_ERRLOG("Cannot alloc buf\n");
spdk_bdev_part_base_free(&gpt_base->part_base);