Add support for handling nvme_cmd_copy command on target.Reviewed-by: Hannes Reinecke <hare@xxxxxxx>
For bdev-ns if backing device supports copy offload we call device copy
offload (blkdev_copy_offload).
In case of partial completion from above or absence of device copy offload
capability, we fallback to copy emulation (blkdev_copy_emulation)
For file-ns we call vfs_copy_file_range to service our request.
Currently target always shows copy capability by setting
NVME_CTRL_ONCS_COPY in controller ONCS.
loop target has copy support, which can be used to test copy offload.
trace event support for nvme_cmd_copy.
Signed-off-by: Nitesh Shetty <nj.shetty@xxxxxxxxxxx>
Signed-off-by: Anuj Gupta <anuj20.g@xxxxxxxxxxx>
---
drivers/nvme/target/admin-cmd.c | 9 ++-
drivers/nvme/target/io-cmd-bdev.c | 97 +++++++++++++++++++++++++++++++
drivers/nvme/target/io-cmd-file.c | 50 ++++++++++++++++
drivers/nvme/target/nvmet.h | 4 ++
drivers/nvme/target/trace.c | 19 ++++++
5 files changed, 177 insertions(+), 2 deletions(-)