Skip to content

Commit 2e9bc34

Browse files
Christoph Hellwigaxboe
authored andcommitted
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20210920123328.1399408-13-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 9778ac7 commit 2e9bc34

File tree

13 files changed

+23
-26
lines changed

13 files changed

+23
-26
lines changed

block/bfq-cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#include <linux/slab.h>
77
#include <linux/blkdev.h>
88
#include <linux/cgroup.h>
9-
#include <linux/elevator.h>
109
#include <linux/ktime.h>
1110
#include <linux/rbtree.h>
1211
#include <linux/ioprio.h>
1312
#include <linux/sbitmap.h>
1413
#include <linux/delay.h>
1514

15+
#include "elevator.h"
1616
#include "bfq-iosched.h"
1717

1818
#ifdef CONFIG_BFQ_CGROUP_DEBUG

block/bfq-iosched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
#include <linux/slab.h>
118118
#include <linux/blkdev.h>
119119
#include <linux/cgroup.h>
120-
#include <linux/elevator.h>
121120
#include <linux/ktime.h>
122121
#include <linux/rbtree.h>
123122
#include <linux/ioprio.h>
@@ -127,6 +126,7 @@
127126

128127
#include <trace/events/block.h>
129128

129+
#include "elevator.h"
130130
#include "blk.h"
131131
#include "blk-mq.h"
132132
#include "blk-mq-tag.h"

block/blk-mq-sched.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#ifndef BLK_MQ_SCHED_H
33
#define BLK_MQ_SCHED_H
44

5+
#include "elevator.h"
56
#include "blk-mq.h"
67
#include "blk-mq-tag.h"
78

block/blk-mq-tag.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef INT_BLK_MQ_TAG_H
33
#define INT_BLK_MQ_TAG_H
44

5+
struct blk_mq_alloc_data;
6+
57
/*
68
* Tag address space map.
79
*/

block/blk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "blk-mq.h"
1313
#include "blk-mq-sched.h"
1414

15+
struct elevator_type;
16+
1517
/* Max future timer expiry for timeouts */
1618
#define BLK_MAX_TIMEOUT (5 * HZ)
1719

block/elevator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <linux/kernel.h>
2727
#include <linux/fs.h>
2828
#include <linux/blkdev.h>
29-
#include <linux/elevator.h>
3029
#include <linux/bio.h>
3130
#include <linux/module.h>
3231
#include <linux/slab.h>
@@ -40,6 +39,7 @@
4039

4140
#include <trace/events/block.h>
4241

42+
#include "elevator.h"
4343
#include "blk.h"
4444
#include "blk-mq-sched.h"
4545
#include "blk-pm.h"

include/linux/elevator.h renamed to block/elevator.h

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
#ifndef _LINUX_ELEVATOR_H
3-
#define _LINUX_ELEVATOR_H
2+
#ifndef _ELEVATOR_H
3+
#define _ELEVATOR_H
44

55
#include <linux/percpu.h>
66
#include <linux/hashtable.h>
77

8-
#ifdef CONFIG_BLOCK
9-
108
struct io_cq;
119
struct elevator_type;
12-
#ifdef CONFIG_BLK_DEBUG_FS
1310
struct blk_mq_debugfs_attr;
14-
#endif
1511

1612
/*
1713
* Return values from elevator merger
@@ -167,14 +163,4 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t);
167163
#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
168164
#define rq_fifo_clear(rq) list_del_init(&(rq)->queuelist)
169165

170-
/*
171-
* Elevator features.
172-
*/
173-
174-
/* Supports zoned block devices sequential write constraint */
175-
#define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0)
176-
/* Supports scheduling on multiple hardware queues */
177-
#define ELEVATOR_F_MQ_AWARE (1U << 1)
178-
179-
#endif /* CONFIG_BLOCK */
180-
#endif
166+
#endif /* _ELEVATOR_H */

block/kyber-iosched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#include <linux/kernel.h>
1010
#include <linux/blkdev.h>
1111
#include <linux/blk-mq.h>
12-
#include <linux/elevator.h>
1312
#include <linux/module.h>
1413
#include <linux/sbitmap.h>
1514

1615
#include <trace/events/block.h>
1716

17+
#include "elevator.h"
1818
#include "blk.h"
1919
#include "blk-mq.h"
2020
#include "blk-mq-debugfs.h"

block/mq-deadline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <linux/fs.h>
1010
#include <linux/blkdev.h>
1111
#include <linux/blk-mq.h>
12-
#include <linux/elevator.h>
1312
#include <linux/bio.h>
1413
#include <linux/module.h>
1514
#include <linux/slab.h>
@@ -20,6 +19,7 @@
2019

2120
#include <trace/events/block.h>
2221

22+
#include "elevator.h"
2323
#include "blk.h"
2424
#include "blk-mq.h"
2525
#include "blk-mq-debugfs.h"

drivers/block/amiflop.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
#include <linux/mutex.h>
6565
#include <linux/fs.h>
6666
#include <linux/blk-mq.h>
67-
#include <linux/elevator.h>
6867
#include <linux/interrupt.h>
6968
#include <linux/platform_device.h>
7069

0 commit comments

Comments
 (0)