nvme: Add pr_ops read_keys support
authorMike Christie <michael.christie@oracle.com>
Fri, 7 Apr 2023 20:05:44 +0000 (15:05 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Apr 2023 01:55:35 +0000 (21:55 -0400)
commit5fd96a4e15de8442915a912233d800c56f49001d
tree75478f370bcb2d4512a4b49f96877b5b3d834502
parentf0614790b77300d69a1f37265f98b68c4835811b
nvme: Add pr_ops read_keys support

This patch adds support for the pr_ops read_keys callout by calling the
NVMe Reservation Report helper, then parsing that info to get the
controller's registered keys. Because the callout is only used in the
kernel where the callers, like LIO, do not know about controller/host IDs,
the callout just returns the registered keys which is required by the SCSI
PR in READ KEYS command.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20230407200551.12660-12-michael.christie@oracle.com
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/pr.c
include/linux/nvme.h