summaryrefslogtreecommitdiff
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2020-05-14 11:45:09 +0300
committerJens Axboe <axboe@kernel.dk>2020-05-14 17:06:04 +0300
commit71ac860af824ce9ebbbe8de20044e777c0fc33b9 (patch)
treea060314e64f575390ed43d4009778bc6ce27826d /include/linux/blkdev.h
parent02ef12a663c7ac24b06146d0ed3137848edb0676 (diff)
downloadlinux-71ac860af824ce9ebbbe8de20044e777c0fc33b9.tar.xz
block: move blk_io_schedule() out of header file
blk_io_schedule() isn't called from performance sensitive code path, and it is easier to maintain by exporting it as symbol. Also blk_io_schedule() is only called by CONFIG_BLOCK code, so it is safe to do this way. Meantime fixes build failure when CONFIG_BLOCK is off. Cc: Christoph Hellwig <hch@infradead.org> Fixes: e6249cdd46e4 ("block: add blk_io_schedule() for avoiding task hung in sync dio") Reported-by: Satya Tangirala <satyat@google.com> Tested-by: Satya Tangirala <satyat@google.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5360696d85ff..f9e4b21b051b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -27,7 +27,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;
@@ -1221,6 +1220,8 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk)
!list_empty(&plug->cb_list));
}
+extern void blk_io_schedule(void);
+
extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *);
extern int blkdev_issue_write_same(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask, struct page *page);
@@ -1851,15 +1852,4 @@ static inline void blk_wake_io_task(struct task_struct *waiter)
wake_up_process(waiter);
}
-static inline void blk_io_schedule(void)
-{
- /* Prevent hang_check timer from firing at us during very long I/O */
- unsigned long timeout = sysctl_hung_task_timeout_secs * HZ / 2;
-
- if (timeout)
- io_schedule_timeout(timeout);
- else
- io_schedule();
-}
-
#endif