错误:函数"blk_get_request"的参数太少



在块设备驱动程序编码中,我试图在文件代码上实现磁盘,我得到了错误:

In function ‘mydisk_request’:
/home/lab/DD/main.c:223:20: error: too few arguments to function ‘blk_get_request’
while ((req =  blk_get_request(queue)) != NULL)
^~~~~~~~~~~~~~~
In file included from /home/lab/DD/main.c:5:0:
./include/linux/blkdev.h:854:24: note: declared here
extern struct request *blk_get_request(struct request_queue *, unsigned int op,
^~~~~~~~~~~~~~~
/home/lab/DD/main.c:228:9: error: implicit declaration of function ‘__blk_end_request_all’; did you mean ‘blk_get_request’? [-Werror=implicit-function-declaration]
__blk_end_request_all(req,ret);
^~~~~~~~~~~~~~~~~~~~~
blk_get_request
/home/lab/DD/main.c: In function ‘mydisk_init’:
/home/lab/DD/main.c:266:24: error: implicit declaration of function ‘blk_init_queue’; did you mean ‘blk_put_queue’? [-Werror=implicit-function-declaration]
mydisk_dev.queue = blk_init_queue(mydisk_request, &mydisk_dev.lock);
^~~~~~~~~~~~~~
blk_put_queue
/home/lab/DD/main.c:266:22: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
mydisk_dev.queue = blk_init_queue(mydisk_request, &mydisk_dev.lock);
^

有人能帮忙吗。帮我做这个?

我认为它要求我用blk_get_request和blk_int_queue(mydisk_request,&mydisk_dev.lock(替换blk_get-request(queue(函数;函数分别使用blk_put_queue。但一旦我替换,我就会得到一个错误,即这些函数的参数太少。

我建议您将内核版本从4.6降级到4.19,然后所有功能都可以工作。

blk_get_request采用3个参数
struct request*blk_get_request(struct request_queue*q,unsigned int op,blk_mq_req_flags_t标志(

相关内容

  • 没有找到相关文章

最新更新