nvmet: include <linux/scatterlist.h>
authorEnrico Weigelt, metux IT consult <info@metux.net>
Wed, 24 Apr 2019 10:34:39 +0000 (12:34 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 25 Apr 2019 14:47:03 +0000 (16:47 +0200)
Build breaks:

    drivers/nvme/target/core.c: In function 'nvmet_req_alloc_sgl':
    drivers/nvme/target/core.c:939:12: error: implicit declaration of \
function 'sgl_alloc'; did you mean 'bio_alloc'? \
[-Werror=implicit-function-declaration]
      req->sg = sgl_alloc(req->transfer_len, GFP_KERNEL, &req->sg_cnt);
                ^~~~~~~~~
                bio_alloc
    drivers/nvme/target/core.c:939:10: warning: assignment makes pointer \
from integer without a cast [-Wint-conversion]
      req->sg = sgl_alloc(req->transfer_len, GFP_KERNEL, &req->sg_cnt);
              ^
    drivers/nvme/target/core.c: In function 'nvmet_req_free_sgl':
    drivers/nvme/target/core.c:952:3: error: implicit declaration of \
function 'sgl_free'; did you mean 'ida_free'? [-Werror=implicit-function-declaration]
       sgl_free(req->sg);
       ^~~~~~~~
       ida_free

Cause:

    1. missing include to <linux/scatterlist.h>
    2. SGL_ALLOC needs to be enabled

Therefore adding the missing include, as well as Kconfig dependency.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Minwoo Im <minwoo.im@samsung.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/Kconfig
drivers/nvme/target/core.c

index d94f25cde0192f25c65dc1bed527558701737951..3ef0a4e5eed6d5eab27a7391a3932b5d179b646e 100644 (file)
@@ -3,6 +3,7 @@ config NVME_TARGET
        tristate "NVMe Target support"
        depends on BLOCK
        depends on CONFIGFS_FS
+       select SGL_ALLOC
        help
          This enabled target side support for the NVMe protocol, that is
          it allows the Linux kernel to implement NVMe subsystems and
index 24e0a36392d9888a8cb52b0bfe065a4fb99d2843..7734a6acff85182feade6f394f1cb2829c9397c7 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/random.h>
 #include <linux/rculist.h>
 #include <linux/pci-p2pdma.h>
+#include <linux/scatterlist.h>
 
 #include "nvmet.h"