]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nvme: move nvme_error_status to common code
authorChristoph Hellwig <hch@lst.de>
Fri, 16 Oct 2015 05:58:39 +0000 (07:58 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 20:40:36 +0000 (13:40 -0700)
And mark it inline so that we don't slow down the completion path by
having to turn it into a forced out of line call.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 15a190f7f57a2e46717490c35ac09882042a200b)

Orabug: 25130845

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

index 207ead30dc4d0c405cfde487d88f73321b07cd48..0810e1acf0f43ae96e11cd3e257c8d48980fe18a 100644 (file)
@@ -83,6 +83,18 @@ static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector)
        return (sector >> (ns->lba_shift - 9));
 }
 
+static inline int nvme_error_status(u16 status)
+{
+       switch (status & 0x7ff) {
+       case NVME_SC_SUCCESS:
+               return 0;
+       case NVME_SC_CAP_EXCEEDED:
+               return -ENOSPC;
+       default:
+               return -EIO;
+       }
+}
+
 int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
                void *buf, unsigned bufflen);
 int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
index 6ee3ab3612974d757f6fb1b4e4121f604ff1235a..347e320c6974dadcf0893cb978f421a19761ab1c 100644 (file)
@@ -552,18 +552,6 @@ static void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod)
                kfree(iod);
 }
 
-static int nvme_error_status(u16 status)
-{
-       switch (status & 0x7ff) {
-       case NVME_SC_SUCCESS:
-               return 0;
-       case NVME_SC_CAP_EXCEEDED:
-               return -ENOSPC;
-       default:
-               return -EIO;
-       }
-}
-
 #ifdef CONFIG_BLK_DEV_INTEGRITY
 static void nvme_dif_prep(u32 p, u32 v, struct t10_pi_tuple *pi)
 {