engines/io_uring_cmd: add extended LBA support
authorAnkit Kumar <ankit.kumar@samsung.com>
Mon, 15 May 2023 11:03:40 +0000 (16:33 +0530)
committerVincent Fu <vincent.fu@samsung.com>
Mon, 15 May 2023 12:41:59 +0000 (08:41 -0400)
commit345fa8fd80e669ffb0b1b8898c2f713279d4814a
treeeb6cdf5c1e09107cb414c1a2c8760973d015bf62
parent01a7d384d4c78f23b03f79e8002e705ea5cbceb4
engines/io_uring_cmd: add extended LBA support

The io_uring_cmd ioengine assumes that logical block size is always
power of 2. But with namespace formats where metadata is transferred at
the end of logical block i.e. an extended logical block this is not
true.

This patch calculates the correct extended logical block size and uses
division operation for start and number of logical block calculation.
The existing calculation for power of 2 logical block size will remain
same.

This also add checks to verify that block sizes are multiple of LBA
size.

This current implementation however doesn't support protection info and
metadata transferred as separate buffer. Return error for those.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
[Vincent: edited commit message]
engines/io_uring.c
engines/nvme.c
engines/nvme.h