Commit a5dffbb6 authored by Enrico Weigelt, metux IT consult's avatar Enrico Weigelt, metux IT consult Committed by Christoph Hellwig

nvmet: include <linux/scatterlist.h>

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: default avatarEnrico Weigelt, metux IT consult <info@metux.net>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarMinwoo Im <minwoo.im@samsung.com>
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 6b7e631b
...@@ -3,6 +3,7 @@ config NVME_TARGET ...@@ -3,6 +3,7 @@ config NVME_TARGET
tristate "NVMe Target support" tristate "NVMe Target support"
depends on BLOCK depends on BLOCK
depends on CONFIGFS_FS depends on CONFIGFS_FS
select SGL_ALLOC
help help
This enabled target side support for the NVMe protocol, that is This enabled target side support for the NVMe protocol, that is
it allows the Linux kernel to implement NVMe subsystems and it allows the Linux kernel to implement NVMe subsystems and
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/random.h> #include <linux/random.h>
#include <linux/rculist.h> #include <linux/rculist.h>
#include <linux/pci-p2pdma.h> #include <linux/pci-p2pdma.h>
#include <linux/scatterlist.h>
#include "nvmet.h" #include "nvmet.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment