提交 2e9bc346 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: move elevator.h to block/

Except for the features passed to blk_queue_required_elevator_features,
elevator.h is only needed internally to the block layer.  Move the
ELEVATOR_F_* definitions to blkdev.h, and the move elevator.h to
block/, dropping all the spurious includes outside of that.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NJohannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20210920123328.1399408-13-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 9778ac77
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/cgroup.h> #include <linux/cgroup.h>
#include <linux/elevator.h>
#include <linux/ktime.h> #include <linux/ktime.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <linux/ioprio.h> #include <linux/ioprio.h>
#include <linux/sbitmap.h> #include <linux/sbitmap.h>
#include <linux/delay.h> #include <linux/delay.h>
#include "elevator.h"
#include "bfq-iosched.h" #include "bfq-iosched.h"
#ifdef CONFIG_BFQ_CGROUP_DEBUG #ifdef CONFIG_BFQ_CGROUP_DEBUG
......
...@@ -117,7 +117,6 @@ ...@@ -117,7 +117,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/cgroup.h> #include <linux/cgroup.h>
#include <linux/elevator.h>
#include <linux/ktime.h> #include <linux/ktime.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <linux/ioprio.h> #include <linux/ioprio.h>
...@@ -127,6 +126,7 @@ ...@@ -127,6 +126,7 @@
#include <trace/events/block.h> #include <trace/events/block.h>
#include "elevator.h"
#include "blk.h" #include "blk.h"
#include "blk-mq.h" #include "blk-mq.h"
#include "blk-mq-tag.h" #include "blk-mq-tag.h"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#ifndef BLK_MQ_SCHED_H #ifndef BLK_MQ_SCHED_H
#define BLK_MQ_SCHED_H #define BLK_MQ_SCHED_H
#include "elevator.h"
#include "blk-mq.h" #include "blk-mq.h"
#include "blk-mq-tag.h" #include "blk-mq-tag.h"
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#ifndef INT_BLK_MQ_TAG_H #ifndef INT_BLK_MQ_TAG_H
#define INT_BLK_MQ_TAG_H #define INT_BLK_MQ_TAG_H
struct blk_mq_alloc_data;
/* /*
* Tag address space map. * Tag address space map.
*/ */
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#include "blk-mq.h" #include "blk-mq.h"
#include "blk-mq-sched.h" #include "blk-mq-sched.h"
struct elevator_type;
/* Max future timer expiry for timeouts */ /* Max future timer expiry for timeouts */
#define BLK_MAX_TIMEOUT (5 * HZ) #define BLK_MAX_TIMEOUT (5 * HZ)
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/elevator.h>
#include <linux/bio.h> #include <linux/bio.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -40,6 +39,7 @@ ...@@ -40,6 +39,7 @@
#include <trace/events/block.h> #include <trace/events/block.h>
#include "elevator.h"
#include "blk.h" #include "blk.h"
#include "blk-mq-sched.h" #include "blk-mq-sched.h"
#include "blk-pm.h" #include "blk-pm.h"
......
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_ELEVATOR_H #ifndef _ELEVATOR_H
#define _LINUX_ELEVATOR_H #define _ELEVATOR_H
#include <linux/percpu.h> #include <linux/percpu.h>
#include <linux/hashtable.h> #include <linux/hashtable.h>
#ifdef CONFIG_BLOCK
struct io_cq; struct io_cq;
struct elevator_type; struct elevator_type;
#ifdef CONFIG_BLK_DEBUG_FS
struct blk_mq_debugfs_attr; struct blk_mq_debugfs_attr;
#endif
/* /*
* Return values from elevator merger * Return values from elevator merger
...@@ -167,14 +163,4 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t); ...@@ -167,14 +163,4 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t);
#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
#define rq_fifo_clear(rq) list_del_init(&(rq)->queuelist) #define rq_fifo_clear(rq) list_del_init(&(rq)->queuelist)
/* #endif /* _ELEVATOR_H */
* Elevator features.
*/
/* Supports zoned block devices sequential write constraint */
#define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0)
/* Supports scheduling on multiple hardware queues */
#define ELEVATOR_F_MQ_AWARE (1U << 1)
#endif /* CONFIG_BLOCK */
#endif
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/blk-mq.h> #include <linux/blk-mq.h>
#include <linux/elevator.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sbitmap.h> #include <linux/sbitmap.h>
#include <trace/events/block.h> #include <trace/events/block.h>
#include "elevator.h"
#include "blk.h" #include "blk.h"
#include "blk-mq.h" #include "blk-mq.h"
#include "blk-mq-debugfs.h" #include "blk-mq-debugfs.h"
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/blk-mq.h> #include <linux/blk-mq.h>
#include <linux/elevator.h>
#include <linux/bio.h> #include <linux/bio.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -20,6 +19,7 @@ ...@@ -20,6 +19,7 @@
#include <trace/events/block.h> #include <trace/events/block.h>
#include "elevator.h"
#include "blk.h" #include "blk.h"
#include "blk-mq.h" #include "blk-mq.h"
#include "blk-mq-debugfs.h" #include "blk-mq-debugfs.h"
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/blk-mq.h> #include <linux/blk-mq.h>
#include <linux/elevator.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*******************************************************************/ *******************************************************************/
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/hashtable.h>
#include <linux/ktime.h> #include <linux/ktime.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
......
...@@ -251,8 +251,6 @@ static inline unsigned short req_get_ioprio(struct request *req) ...@@ -251,8 +251,6 @@ static inline unsigned short req_get_ioprio(struct request *req)
return req->ioprio; return req->ioprio;
} }
#include <linux/elevator.h>
struct bio_vec; struct bio_vec;
enum blk_eh_timer_return { enum blk_eh_timer_return {
...@@ -1124,6 +1122,15 @@ extern void blk_queue_dma_alignment(struct request_queue *, int); ...@@ -1124,6 +1122,15 @@ extern void blk_queue_dma_alignment(struct request_queue *, int);
extern void blk_queue_update_dma_alignment(struct request_queue *, int); extern void blk_queue_update_dma_alignment(struct request_queue *, int);
extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua); extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua);
/*
* Elevator features for blk_queue_required_elevator_features:
*/
/* Supports zoned block devices sequential write constraint */
#define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0)
/* Supports scheduling on multiple hardware queues */
#define ELEVATOR_F_MQ_AWARE (1U << 1)
extern void blk_queue_required_elevator_features(struct request_queue *q, extern void blk_queue_required_elevator_features(struct request_queue *q,
unsigned int features); unsigned int features);
extern bool blk_queue_can_use_dma_map_merging(struct request_queue *q, extern bool blk_queue_can_use_dma_map_merging(struct request_queue *q,
......
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/pti.h> #include <linux/pti.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/elevator.h>
#include <linux/sched/clock.h> #include <linux/sched/clock.h>
#include <linux/sched/task.h> #include <linux/sched/task.h>
#include <linux/sched/task_stack.h> #include <linux/sched/task_stack.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册