]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nvme: make SG_IO support optional
authorChristoph Hellwig <hch@lst.de>
Thu, 24 Dec 2015 14:27:02 +0000 (15:27 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 20:40:53 +0000 (13:40 -0700)
Translation SCSI commands to NVMe commands is rather pointless in general
as applications must not expext to be able to use SCSI commands on a
generic block device.

Make the huge translation layer optional and hope no one will ever enable
it in the future.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 4490733250b8b272a6d3e66352dd7b8025409549)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/Kconfig
drivers/nvme/host/Makefile
drivers/nvme/host/core.c

index 0089f78b40718f37ed7c0bcee942a3023c9843c4..68d75714ebf3b33cd0c9d1c11ee030acca8a19b1 100644 (file)
@@ -8,3 +8,14 @@ config BLK_DEV_NVME
 
          To compile this driver as a module, choose M here: the
          module will be called nvme.
+
+config BLK_DEV_NVME_SCSI
+       bool "SCSI emulation for NVMe device nodes"
+       depends on BLK_DEV_NVME
+       ---help---
+         This adds support for the SG_IO ioctl on the NVMe character
+         and block devices nodes, as well a a translation for a small
+         number of selected SCSI commands to NVMe commands to the NVMe
+         driver.  If you don't know what this means you probably want
+         to say N here, and if you know what it means you probably
+         want to say N as well.
index 336b4eabcb0f61b8548690f704a11007f498c64d..f854c5dbda6420918d2db45b5410c995d3bf2257 100644 (file)
@@ -1,4 +1,5 @@
 
 obj-$(CONFIG_BLK_DEV_NVME)     += nvme.o
 
-nvme-y         += core.o pci.o scsi.o
+nvme-y                                 += core.o pci.o
+nvme-$(CONFIG_BLK_DEV_NVME_SCSI)        += scsi.o
index d84430e298580b44cd4e7247893c6888ecbaf25e..7b397aff2ec9b383bb7fa96fc122f9fecfddd5aa 100644 (file)
@@ -454,10 +454,12 @@ static int nvme_ioctl(struct block_device *bdev, fmode_t mode,
                return nvme_user_cmd(ns->ctrl, ns, (void __user *)arg);
        case NVME_IOCTL_SUBMIT_IO:
                return nvme_submit_io(ns, (void __user *)arg);
+#ifdef CONFIG_BLK_DEV_NVME_SCSI
        case SG_GET_VERSION_NUM:
                return nvme_sg_get_version_num((void __user *)arg);
        case SG_IO:
                return nvme_sg_io(ns, (void __user *)arg);
+#endif
        default:
                return -ENOTTY;
        }