All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 12/17] block: move elevator.h to block/
Date: Mon, 20 Sep 2021 14:33:23 +0200	[thread overview]
Message-ID: <20210920123328.1399408-13-hch@lst.de> (raw)
In-Reply-To: <20210920123328.1399408-1-hch@lst.de>

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>
---
 block/bfq-cgroup.c                  |  2 +-
 block/bfq-iosched.c                 |  2 +-
 block/blk-mq-sched.h                |  1 +
 block/blk-mq-tag.h                  |  2 ++
 block/blk.h                         |  2 ++
 block/elevator.c                    |  2 +-
 {include/linux => block}/elevator.h | 20 +++-----------------
 block/kyber-iosched.c               |  2 +-
 block/mq-deadline.c                 |  2 +-
 drivers/block/amiflop.c             |  1 -
 drivers/scsi/lpfc/lpfc.h            |  1 +
 include/linux/blkdev.h              | 11 +++++++++--
 init/main.c                         |  1 -
 13 files changed, 23 insertions(+), 26 deletions(-)
 rename {include/linux => block}/elevator.h (93%)

diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index e2f14508f2d6e..8826daedd61c1 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -6,13 +6,13 @@
 #include <linux/slab.h>
 #include <linux/blkdev.h>
 #include <linux/cgroup.h>
-#include <linux/elevator.h>
 #include <linux/ktime.h>
 #include <linux/rbtree.h>
 #include <linux/ioprio.h>
 #include <linux/sbitmap.h>
 #include <linux/delay.h>
 
+#include "elevator.h"
 #include "bfq-iosched.h"
 
 #ifdef CONFIG_BFQ_CGROUP_DEBUG
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index dd13c2bbc29c1..f045ac8f07adf 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -117,7 +117,6 @@
 #include <linux/slab.h>
 #include <linux/blkdev.h>
 #include <linux/cgroup.h>
-#include <linux/elevator.h>
 #include <linux/ktime.h>
 #include <linux/rbtree.h>
 #include <linux/ioprio.h>
@@ -127,6 +126,7 @@
 
 #include <trace/events/block.h>
 
+#include "elevator.h"
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-tag.h"
diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h
index 5246ae0407047..5181487db7923 100644
--- a/block/blk-mq-sched.h
+++ b/block/blk-mq-sched.h
@@ -2,6 +2,7 @@
 #ifndef BLK_MQ_SCHED_H
 #define BLK_MQ_SCHED_H
 
+#include "elevator.h"
 #include "blk-mq.h"
 #include "blk-mq-tag.h"
 
diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h
index 8ed55af084273..f0a0ee758a556 100644
--- a/block/blk-mq-tag.h
+++ b/block/blk-mq-tag.h
@@ -2,6 +2,8 @@
 #ifndef INT_BLK_MQ_TAG_H
 #define INT_BLK_MQ_TAG_H
 
+struct blk_mq_alloc_data;
+
 /*
  * Tag address space map.
  */
diff --git a/block/blk.h b/block/blk.h
index 7d2a0ba7ed21d..82ab26add08df 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -12,6 +12,8 @@
 #include "blk-mq.h"
 #include "blk-mq-sched.h"
 
+struct elevator_type;
+
 /* Max future timer expiry for timeouts */
 #define BLK_MAX_TIMEOUT		(5 * HZ)
 
diff --git a/block/elevator.c b/block/elevator.c
index ff45d8388f487..57be09cd7f6dd 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -26,7 +26,6 @@
 #include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/blkdev.h>
-#include <linux/elevator.h>
 #include <linux/bio.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -40,6 +39,7 @@
 
 #include <trace/events/block.h>
 
+#include "elevator.h"
 #include "blk.h"
 #include "blk-mq-sched.h"
 #include "blk-pm.h"
diff --git a/include/linux/elevator.h b/block/elevator.h
similarity index 93%
rename from include/linux/elevator.h
rename to block/elevator.h
index 80633f3b600c2..16cd8bdedb7ea 100644
--- a/include/linux/elevator.h
+++ b/block/elevator.h
@@ -1,17 +1,13 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _LINUX_ELEVATOR_H
-#define _LINUX_ELEVATOR_H
+#ifndef _ELEVATOR_H
+#define _ELEVATOR_H
 
 #include <linux/percpu.h>
 #include <linux/hashtable.h>
 
-#ifdef CONFIG_BLOCK
-
 struct io_cq;
 struct elevator_type;
-#ifdef CONFIG_BLK_DEBUG_FS
 struct blk_mq_debugfs_attr;
-#endif
 
 /*
  * Return values from elevator merger
@@ -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_fifo_clear(rq)	list_del_init(&(rq)->queuelist)
 
-/*
- * 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
+#endif /* _ELEVATOR_H */
diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c
index 15a8be57203d6..5808f0ea0b79f 100644
--- a/block/kyber-iosched.c
+++ b/block/kyber-iosched.c
@@ -9,12 +9,12 @@
 #include <linux/kernel.h>
 #include <linux/blkdev.h>
 #include <linux/blk-mq.h>
-#include <linux/elevator.h>
 #include <linux/module.h>
 #include <linux/sbitmap.h>
 
 #include <trace/events/block.h>
 
+#include "elevator.h"
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-debugfs.h"
diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index 7f3c3932b723e..47f042fa6a688 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -9,7 +9,6 @@
 #include <linux/fs.h>
 #include <linux/blkdev.h>
 #include <linux/blk-mq.h>
-#include <linux/elevator.h>
 #include <linux/bio.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -20,6 +19,7 @@
 
 #include <trace/events/block.h>
 
+#include "elevator.h"
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-debugfs.h"
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 8b1714021498c..b892e5185d6fa 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -64,7 +64,6 @@
 #include <linux/mutex.h>
 #include <linux/fs.h>
 #include <linux/blk-mq.h>
-#include <linux/elevator.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index befeb7c342903..337e6ed248218 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -22,6 +22,7 @@
  *******************************************************************/
 
 #include <scsi/scsi_host.h>
+#include <linux/hashtable.h>
 #include <linux/ktime.h>
 #include <linux/workqueue.h>
 
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4bcbb1ae2d66a..d815238f61ed9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -251,8 +251,6 @@ static inline unsigned short req_get_ioprio(struct request *req)
 	return req->ioprio;
 }
 
-#include <linux/elevator.h>
-
 struct bio_vec;
 
 enum blk_eh_timer_return {
@@ -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_rq_timeout(struct request_queue *, unsigned int);
 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,
 						 unsigned int features);
 extern bool blk_queue_can_use_dma_map_merging(struct request_queue *q,
diff --git a/init/main.c b/init/main.c
index 3f72169344412..330aae01e728c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -83,7 +83,6 @@
 #include <linux/ptrace.h>
 #include <linux/pti.h>
 #include <linux/blkdev.h>
-#include <linux/elevator.h>
 #include <linux/sched/clock.h>
 #include <linux/sched/task.h>
 #include <linux/sched/task_stack.h>
-- 
2.30.2


  parent reply	other threads:[~2021-09-20 12:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 12:33 untangle the block headers v2 Christoph Hellwig
2021-09-20 12:33 ` [PATCH 01/17] mm: don't include <linux/blk-cgroup.h> in <linux/writeback.h> Christoph Hellwig
2021-09-20 12:53   ` Johannes Thumshirn
2021-09-20 22:13   ` Bart Van Assche
2021-09-21  6:36     ` Christoph Hellwig
2021-09-20 12:33 ` [PATCH 02/17] mm: don't include <linux/blk-cgroup.h> in <linux/backing-dev.h> Christoph Hellwig
2021-09-20 12:33 ` [PATCH 03/17] mm: don't include <linux/blkdev.h> " Christoph Hellwig
2021-09-20 12:54   ` Johannes Thumshirn
2021-09-20 12:33 ` [PATCH 04/17] mm: remove spurious blkdev.h includes Christoph Hellwig
2021-09-20 12:33 ` [PATCH 05/17] arch: " Christoph Hellwig
2021-09-20 12:33 ` [PATCH 06/17] kernel: " Christoph Hellwig
2021-09-20 12:33 ` [PATCH 07/17] sched: move the <linux/blkdev.h> include out of kernel/sched/sched.h Christoph Hellwig
2021-09-20 12:33 ` [PATCH 08/17] block: remove the unused rq_end_sector macro Christoph Hellwig
2021-09-20 12:55   ` Johannes Thumshirn
2021-09-20 12:33 ` [PATCH 09/17] block: remove the unused blk_queue_state enum Christoph Hellwig
2021-09-20 12:56   ` Johannes Thumshirn
2021-09-20 12:33 ` [PATCH 10/17] block: remove the cmd_size field from struct request_queue Christoph Hellwig
2021-09-20 12:59   ` Johannes Thumshirn
2021-09-20 12:33 ` [PATCH 11/17] block: remove the struct blk_queue_ctx forward declaration Christoph Hellwig
2021-09-20 13:00   ` Johannes Thumshirn
2021-09-20 12:33 ` Christoph Hellwig [this message]
2021-09-20 13:02   ` [PATCH 12/17] block: move elevator.h to block/ Johannes Thumshirn
2021-09-20 12:33 ` [PATCH 13/17] block: drop unused includes in <linux/blkdev.h> Christoph Hellwig
2021-09-20 12:33 ` [PATCH 14/17] block: drop unused includes in <linux/genhd.h> Christoph Hellwig
2021-09-20 12:33 ` [PATCH 15/17] block: move a few merge helpers out of <linux/blkdev.h> Christoph Hellwig
2021-09-20 12:33 ` [PATCH 16/17] block: move integrity handling " Christoph Hellwig
2021-09-20 12:33 ` [PATCH 17/17] block: move struct request to blk-mq.h Christoph Hellwig
2021-09-27 23:14 ` untangle the block headers v2 Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2021-09-15  6:40 untangle the block headers Christoph Hellwig
2021-09-15  6:40 ` [PATCH 12/17] block: move elevator.h to block/ Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210920123328.1399408-13-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.