Skip to contentSkip to conversation

block: fix build failure in case of !CONFIG_BLOCK

PATCH In review Ming Lei 2 participants 3 messages May 14, 2020 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 block: fix build failure in case of !CONFIG_BLOCK

Commit e6249cdd46e4 ("block: add blk_io_schedule() for avoiding task hung in sync dio") adds helper blk_io_schedule, however the required header is added for CONFIG_BLOCK only.

Fixes the issue by moving the added '#include' out of CONFIG_BLOCK because blk_io_schedule() doesn't need any CONFIG_BLOCK only stuff.

Fixes e6249cdd46e4 ("block: add blk_io_schedule() for avoiding task hung in sync dio")
---
 include/linux/blkdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blkdev.h +1 -1
index 5360696d85ff..bf99a723673b 100644
@@ -4,6 +4,7 @@
 
 #include <linux/sched.h>
 #include <linux/sched/clock.h>
+#include <linux/sched/sysctl.h>
 
 #ifdef CONFIG_BLOCK
 
@@ -27,7 +28,6 @@
 #include <linux/percpu-refcount.h>
 #include <linux/scatterlist.h>
 #include <linux/blkzoned.h>
-#include <linux/sched/sysctl.h>
 
 struct module;
 struct scsi_ioctl_command;
Signature · 1 line
2.25.2
#1 lore raw

Can you please just move the function out of line? If we context switch it is by definition to performance critical enough to be an inline function bloating the callers..

author
#2 lore raw
Quoted 4 lines · Christoph Hellwig

Can you please just move the function out of line? If we context switch it is by definition to performance critical enough to be an inline function bloating the callers..

Looks blk_io_schedule() is only called from CONFG_BLOCK code, so it is better to export it as one symbol.

Thanks,
Ming