Commit 608eb13b authored by Mateusz Kozlowski's avatar Mateusz Kozlowski Committed by Konrad Sztyber
Browse files

lib/ftl: Skip md buffer transfer on non-vss IO



Update helper functions (which pass in dummy buffer for metadata, when
the caller doesn't need its contents), to work on devices without md.

Change-Id: I49eafad1d98a1d9337d80e7e33e618d2ccf51d07
Signed-off-by: default avatarMateusz Kozlowski <mateusz.kozlowski@solidigm.com>
Signed-off-by: default avatarMariusz Barczak <Mariusz.Barczak@solidigmtechnology.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19627


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent f0748d19
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -18,10 +18,14 @@ ftl_nv_cache_bdev_read_blocks_with_md(struct spdk_ftl_dev *dev,
				      uint64_t offset_blocks, uint64_t num_blocks,
				      spdk_bdev_io_completion_cb cb, void *cb_arg)
{
	if (spdk_bdev_get_md_size(spdk_bdev_desc_get_bdev(desc))) {
		return spdk_bdev_read_blocks_with_md(desc, ch, buf, md ? : g_ftl_read_buf,
					     offset_blocks, num_blocks,
						     offset_blocks, num_blocks, cb, cb_arg);
	} else {
		return spdk_bdev_read_blocks(desc, ch, buf, offset_blocks, num_blocks,
					     cb, cb_arg);
	}
}

static inline int
ftl_nv_cache_bdev_write_blocks_with_md(struct spdk_ftl_dev *dev,
@@ -31,9 +35,13 @@ ftl_nv_cache_bdev_write_blocks_with_md(struct spdk_ftl_dev *dev,
				       uint64_t offset_blocks, uint64_t num_blocks,
				       spdk_bdev_io_completion_cb cb, void *cb_arg)
{
	if (spdk_bdev_get_md_size(spdk_bdev_desc_get_bdev(desc))) {
		return spdk_bdev_write_blocks_with_md(desc, ch, buf, md ? : g_ftl_write_buf,
					      offset_blocks, num_blocks,
						      offset_blocks, num_blocks, cb, cb_arg);
	} else {
		return spdk_bdev_write_blocks(desc, ch, buf, offset_blocks, num_blocks,
					      cb, cb_arg);
	}
}

#endif /* FTL_NV_CACHE_IO_H */