untangle the block headers v2
Subsystems (49)
Christoph Hellwig
maintainerHi Jens,
this series untangles the worst of the block header maze. It removes various includes from blkdev.h and genhd.h, and also ensures the writeback code doesn't pull in blkdev.h leading to huge rebuilds whenever they change. Finally it moves various bits out of blkdev.h which shouldn't be in the general block layer header.
It has surived various randomconfig builds from me and the buildbot, but I suspect there are a few more conditionally missing headers that will emerge later for more oscure configs, so it would be great to get this merged early.
Changes since v1:
- a few spelling fixes
- add a bunch more includes needed for a arc randomconfig
Diffstat:
arch/mips/rb532/prom.c | 1 arch/mips/sibyte/common/cfe.c | 1 arch/mips/sibyte/swarm/setup.c | 1 arch/openrisc/mm/init.c | 1 arch/powerpc/platforms/cell/spufs/inode.c | 1 arch/um/drivers/ubd_kern.c | 1 block/bdev.c | 1 block/bfq-cgroup.c | 2 block/bfq-iosched.c | 2 block/bio-integrity.c | 2 block/blk-core.c | 1 block/blk-crypto-fallback.c | 1 block/blk-crypto-internal.h | 2 block/blk-integrity.c | 2 block/blk-iolatency.c | 1 block/blk-merge.c | 25 block/blk-mq-sched.h | 1 block/blk-mq-tag.h | 2 block/blk-mq.c | 2 block/blk.h | 40 + block/bounce.c | 1 block/elevator.c | 2 block/elevator.h | 21 block/genhd.c | 1 block/holder.c | 1 block/keyslot-manager.c | 1 block/kyber-iosched.c | 2 block/mq-deadline.c | 2 block/partitions/core.c | 1 block/t10-pi.c | 2 drivers/block/amiflop.c | 2 drivers/block/ataflop.c | 1 drivers/block/floppy.c | 1 drivers/block/rnbd/rnbd-proto.h | 2 drivers/block/swim.c | 1 drivers/block/xen-blkfront.c | 1 drivers/gpu/drm/i915/i915_utils.h | 1 drivers/md/dm-bio-record.h | 1 drivers/md/dm-crypt.c | 1 drivers/md/dm-ima.c | 1 drivers/md/dm-ps-historical-service-time.c | 1 drivers/md/dm-rq.c | 1 drivers/md/dm-table.c | 1 drivers/md/dm-verity-target.c | 1 drivers/md/md.c | 2 drivers/mmc/core/sd.c | 1 drivers/mtd/mtdsuper.c | 1 drivers/nvdimm/core.c | 1 drivers/nvme/host/core.c | 1 drivers/nvme/host/pci.c | 1 drivers/nvme/host/rdma.c | 1 drivers/nvme/target/io-cmd-bdev.c | 1 drivers/nvme/target/rdma.c | 1 drivers/s390/block/dasd_genhd.c | 1 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 drivers/scsi/lpfc/lpfc.h | 1 drivers/scsi/scsi_lib.c | 1 drivers/scsi/sd.c | 1 drivers/scsi/sd_dif.c | 2 drivers/scsi/sg.c | 1 drivers/scsi/sr.c | 1 drivers/scsi/st.c | 1 drivers/scsi/virtio_scsi.c | 1 drivers/target/target_core_file.c | 1 drivers/target/target_core_iblock.c | 2 fs/btrfs/compression.c | 1 fs/btrfs/ctree.c | 1 fs/btrfs/inode.c | 1 fs/f2fs/compress.c | 1 fs/ntfs/file.c | 1 fs/ntfs3/file.c | 1 fs/orangefs/inode.c | 2 fs/orangefs/super.c | 1 fs/quota/quota.c | 1 fs/ramfs/inode.c | 1 include/linux/backing-dev.h | 19 include/linux/blk-integrity.h | 183 +++++++ include/linux/blk-mq.h | 465 ++++++++++++++++++ include/linux/blk_types.h | 2 include/linux/blkdev.h | 743 ----------------------------- include/linux/blktrace_api.h | 2 include/linux/genhd.h | 14 include/linux/part_stat.h | 1 include/linux/t10-pi.h | 2 include/linux/writeback.h | 14 include/scsi/scsi_device.h | 2 init/main.c | 1 kernel/acct.c | 1 kernel/exit.c | 1 kernel/fork.c | 1 kernel/sched/core.c | 2 kernel/sched/sched.h | 1 lib/random32.c | 1 mm/backing-dev.c | 19 mm/filemap.c | 1 mm/highmem.c | 1 mm/mempool.c | 1 mm/nommu.c | 1 mm/readahead.c | 1 mm/shmem.c | 1 mm/swapfile.c | 2 101 files changed, 832 insertions(+), 825 deletions(-)
Christoph Hellwig
maintainerPATCH 1/17 mm: don't include <linux/blk-cgroup.h> in <linux/writeback.h>
blk-cgroup.h pulls in blkdev.h and thus pretty much all the block headers. Break this dependency chain by turning wbc_blkcg_css into a macro and dropping the blk-cgroup.h include.
--- drivers/gpu/drm/i915/i915_utils.h | 1 + fs/btrfs/inode.c | 1 + fs/quota/quota.c | 1 + include/linux/writeback.h | 14 +++++--------- lib/random32.c | 1 + 5 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_utils.h +1 -0
@@ -30,6 +30,7 @@#include <linux/sched.h> #include <linux/types.h> #include <linux/workqueue.h> +#include <linux/sched/clock.h> struct drm_i915_private ;struct timer_list ;
fs/btrfs/inode.c +1 -0
@@ -6,6 +6,7 @@#include <crypto/hash.h> #include <linux/kernel.h> #include <linux/bio.h> +#include <linux/blk-cgroup.h> #include <linux/file.h> #include <linux/fs.h> #include <linux/pagemap.h>
fs/quota/quota.c +1 -0
@@ -10,6 +10,7 @@#include <linux/namei.h> #include <linux/slab.h> #include <asm/current.h> +#include <linux/blkdev.h> #include <linux/uaccess.h> #include <linux/kernel.h> #include <linux/security.h>
include/linux/writeback.h +5 -9
@@ -11,7 +11,6 @@#include <linux/flex_proportions.h> #include <linux/backing-dev-defs.h> #include <linux/blk_types.h> -#include <linux/blk-cgroup.h> struct bio ;
@@ -109,15 +108,12 @@ static inline int wbc_to_write_flags(struct writeback_control *wbc)return flags; } -static inline struct cgroup_subsys_state * -wbc_blkcg_css (struct writeback_control *wbc) -{#ifdef CONFIG_CGROUP_WRITEBACK -if (wbc->wb) -return wbc->wb->blkcg_css; -#endif -return blkcg_root_css; -} +#define wbc_blkcg_css (wbc) \ + ((wbc)->wb ? (wbc)->wb->blkcg_css : blkcg_root_css) +#else +#define wbc_blkcg_css (wbc) (blkcg_root_css) +#endif /* CONFIG_CGROUP_WRITEBACK */ /* * A wb_domain represents a domain that wb's (bdi_writeback's) belong to
lib/random32.c +1 -0
@@ -39,6 +39,7 @@#include <linux/random.h> #include <linux/sched.h> #include <linux/bitops.h> +#include <linux/slab.h> #include <asm/unaligned.h> #include <trace/events/random.h>
Signature · 1 line
2.30.2
Re: [PATCH 01/17] mm: don't include <linux/blk-cgroup.h> in <linux/writeback.h>
Looks good,
Re: [PATCH 01/17] mm: don't include <linux/blk-cgroup.h> in <linux/writeback.h>
In reply to Christoph HellwigQuoted 4 lines · Christoph Hellwig
include/linux/writeback.h +0
-3-static inline struct cgroup_subsys_state * -wbc_blkcg_css (struct writeback_control *wbc) -{#ifdef CONFIG_CGROUP_WRITEBACK
include/linux/writeback.h static inline int wbc_to_write_flags(struct writeback_control *wbc) · line 116
Quoted 10 lines
include/linux/writeback.h +5
-5-if (wbc->wb) -return wbc->wb->blkcg_css; -#endif -return blkcg_root_css; -} +#define wbc_blkcg_css (wbc) \ + ((wbc)->wb ? (wbc)->wb->blkcg_css : blkcg_root_css) +#else +#define wbc_blkcg_css (wbc) (blkcg_root_css) +#endif /* CONFIG_CGROUP_WRITEBACK */
This change may introduce annoying set-but-not-used warnings with CONFIG_CGROUP_WRITEBACK=n. How about changing (blkcg_root_css) into ((wbc), blkcg_root_css) to prevent this?
Thanks,
Bart.
Christoph Hellwig
maintainerRe: [PATCH 01/17] mm: don't include <linux/blk-cgroup.h> in <linux/writeback.h>
Quoted 9 lines · Bart Van Assche
include/linux/writeback.h static inline int wbc_to_write_flags(struct writeback_control *wbc) · line 116
Quoted 5 lines
include/linux/writeback.h +5
-0+#define wbc_blkcg_css (wbc) \ + ((wbc)->wb ? (wbc)->wb->blkcg_css : blkcg_root_css) +#else +#define wbc_blkcg_css (wbc) (blkcg_root_css) +#endif /* CONFIG_CGROUP_WRITEBACK */ This change may introduce annoying set-but-not-used warnings with
CONFIG_CGROUP_WRITEBACK=n. How about changing (blkcg_root_css) into ((wbc),blkcg_root_css) to prevent this?
I agree in principle, but in this case the caller pretty much has to use wbc in other ways, so I don't think it matters much.
Christoph Hellwig
maintainerPATCH 2/17 mm: don't include <linux/blk-cgroup.h> in <linux/backing-dev.h>
In reply to Christoph HellwigThere is no need to pull blk-cgroup.h and thus blkdev.h in here, so break the include chain.
--- arch/powerpc/platforms/cell/spufs/inode.c | 1 + block/blk-iolatency.c | 1 + block/blk-mq.c | 1 + block/bounce.c | 1 + drivers/md/dm-ima.c | 1 + fs/btrfs/compression.c | 1 + fs/btrfs/ctree.c | 1 + fs/f2fs/compress.c | 1 + fs/orangefs/super.c | 1 + fs/ramfs/inode.c | 1 + include/linux/backing-dev.h | 3 ++- mm/backing-dev.c | 3 ++- mm/swapfile.c | 2 +- 13 files changed, 15 insertions(+), 3 deletions(-)
arch/powerpc/platforms/cell/spufs/inode.c +1 -0
@@ -21,6 +21,7 @@#include <linux/namei.h> #include <linux/pagemap.h> #include <linux/poll.h> +#include <linux/seq_file.h> #include <linux/slab.h> #include <asm/prom.h>
block/blk-iolatency.c +1 -0
@@ -74,6 +74,7 @@#include <linux/sched/signal.h> #include <trace/events/block.h> #include <linux/blk-mq.h> +#include <linux/blk-cgroup.h> #include "blk-rq-qos.h" #include "blk-stat.h" #include "blk.h"
block/blk-mq.c +1 -0
@@ -16,6 +16,7 @@#include <linux/slab.h> #include <linux/workqueue.h> #include <linux/smp.h> +#include <linux/interrupt.h> #include <linux/llist.h> #include <linux/list_sort.h> #include <linux/cpu.h>
block/bounce.c +1 -0
@@ -14,6 +14,7 @@#include <linux/pagemap.h> #include <linux/mempool.h> #include <linux/blkdev.h> +#include <linux/blk-cgroup.h> #include <linux/backing-dev.h> #include <linux/init.h> #include <linux/hash.h>
drivers/md/dm-ima.c +1 -0
@@ -12,6 +12,7 @@#include "dm-ima.h" #include <linux/ima.h> +#include <linux/sched/mm.h> #include <crypto/hash.h> #include <linux/crypto.h> #include <crypto/hash_info.h>
fs/btrfs/compression.c +1 -0
@@ -9,6 +9,7 @@#include <linux/fs.h> #include <linux/pagemap.h> #include <linux/highmem.h> +#include <linux/kthread.h> #include <linux/time.h> #include <linux/init.h> #include <linux/string.h>
fs/btrfs/ctree.c +1 -0
@@ -7,6 +7,7 @@#include <linux/slab.h> #include <linux/rbtree.h> #include <linux/mm.h> +#include <linux/error-injection.h> #include "ctree.h" #include "disk-io.h" #include "transaction.h"
fs/f2fs/compress.c +1 -0
@@ -7,6 +7,7 @@#include <linux/fs.h> #include <linux/f2fs_fs.h> +#include <linux/moduleparam.h> #include <linux/writeback.h> #include <linux/backing-dev.h> #include <linux/lzo.h>
fs/orangefs/super.c +1 -0
@@ -11,6 +11,7 @@#include <linux/parser.h> #include <linux/hashtable.h> +#include <linux/seq_file.h> /* a cache for orangefs-inode objects (i.e. orangefs inode private data) */ static struct kmem_cache *orangefs_inode_cache;
fs/ramfs/inode.c +1 -0
@@ -38,6 +38,7 @@#include <linux/uaccess.h> #include <linux/fs_context.h> #include <linux/fs_parser.h> +#include <linux/seq_file.h> #include "internal.h" struct ramfs_mount_opts {
include/linux/backing-dev.h +2 -1
@@ -15,10 +15,11 @@#include <linux/blkdev.h> #include <linux/device.h> #include <linux/writeback.h> -#include <linux/blk-cgroup.h> #include <linux/backing-dev-defs.h> #include <linux/slab.h> +struct blkcg ; +static inline struct backing_dev_info *bdi_get (struct backing_dev_info *bdi) {kref_get (&bdi->refcnt);
mm/backing-dev.c +2 -1
@@ -2,8 +2,9 @@#include <linux/wait.h> #include <linux/rbtree.h> -#include <linux/backing-dev.h> #include <linux/kthread.h> +#include <linux/backing-dev.h> +#include <linux/blk-cgroup.h> #include <linux/freezer.h> #include <linux/fs.h> #include <linux/pagemap.h>
mm/swapfile.c +1 -1
@@ -18,7 +18,7 @@#include <linux/pagemap.h> #include <linux/namei.h> #include <linux/shmem_fs.h> -#include <linux/blkdev.h> +#include <linux/blk-cgroup.h> #include <linux/random.h> #include <linux/writeback.h> #include <linux/proc_fs.h>
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 3/17 mm: don't include <linux/blkdev.h> in <linux/backing-dev.h>
In reply to Christoph HellwigMove inode_to_bdi out of line to avoid having to include blkdev.h.
--- drivers/mtd/mtdsuper.c | 1 + fs/ntfs/file.c | 1 + fs/ntfs3/file.c | 1 + fs/orangefs/inode.c | 2 +- include/linux/backing-dev.h | 16 +--------------- mm/backing-dev.c | 16 ++++++++++++++++ 6 files changed, 21 insertions(+), 16 deletions(-)
drivers/mtd/mtdsuper.c +1 -0
@@ -15,6 +15,7 @@#include <linux/slab.h> #include <linux/major.h> #include <linux/backing-dev.h> +#include <linux/blkdev.h> #include <linux/fs_context.h> #include "mtdcore.h"
fs/ntfs/file.c +1 -0
@@ -5,6 +5,7 @@* Copyright (c) 2001-2015 Anton Altaparmakov and Tuxera Inc. */ +#include <linux/blkdev.h> #include <linux/backing-dev.h> #include <linux/buffer_head.h> #include <linux/gfp.h>
fs/ntfs3/file.c +1 -0
@@ -8,6 +8,7 @@*/ #include <linux/backing-dev.h> +#include <linux/blkdev.h> #include <linux/buffer_head.h> #include <linux/compat.h> #include <linux/falloc.h>
fs/orangefs/inode.c +1 -1
@@ -10,7 +10,7 @@* Linux VFS inode operations. */ -#include <linux/bvec.h> +#include <linux/blkdev.h> #include <linux/fileattr.h> #include "protocol.h" #include "orangefs-kernel.h"
include/linux/backing-dev.h +1 -15
@@ -12,7 +12,6 @@#include <linux/kernel.h> #include <linux/fs.h> #include <linux/sched.h> -#include <linux/blkdev.h> #include <linux/device.h> #include <linux/writeback.h> #include <linux/backing-dev-defs.h>
@@ -134,20 +133,7 @@ static inline bool writeback_in_progress(struct bdi_writeback *wb)return test_bit (WB_writeback_running, &wb->state); } -static inline struct backing_dev_info *inode_to_bdi (struct inode *inode) -{ -struct super_block *sb; - -if (!inode) -return &noop_backing_dev_info; - - sb = inode->i_sb; -#ifdef CONFIG_BLOCK -if (sb_is_blkdev_sb (sb)) -return I_BDEV (inode)->bd_disk->bdi; -#endif -return sb->s_bdi; -} +struct backing_dev_info *inode_to_bdi (struct inode *inode);static inline int wb_congested (struct bdi_writeback *wb,int cong_bits) {
mm/backing-dev.c +16 -0
@@ -978,6 +978,22 @@ void bdi_put(struct backing_dev_info *bdi) }EXPORT_SYMBOL (bdi_put); +struct backing_dev_info *inode_to_bdi (struct inode *inode) +{ +struct super_block *sb; + +if (!inode) +return &noop_backing_dev_info; + + sb = inode->i_sb; +#ifdef CONFIG_BLOCK +if (sb_is_blkdev_sb (sb)) +return I_BDEV (inode)->bd_disk->bdi; +#endif +return sb->s_bdi; +} +EXPORT_SYMBOL (inode_to_bdi); +const char *bdi_dev_name (struct backing_dev_info *bdi) {if (!bdi || !bdi->dev)
Signature · 1 line
2.30.2
Re: [PATCH 03/17] mm: don't include <linux/blkdev.h> in <linux/backing-dev.h>
Christoph Hellwig
maintainerPATCH 4/17 mm: remove spurious blkdev.h includes
In reply to Christoph HellwigVarious files have acquired spurious includes of <linux/blkdev.h> over time. Remove them.
--- mm/filemap.c | 1 - mm/highmem.c | 1 - mm/mempool.c | 1 - mm/nommu.c | 1 - mm/readahead.c | 1 - mm/shmem.c | 1 - 6 files changed, 6 deletions(-)
mm/filemap.c +0 -1
@@ -30,7 +30,6 @@#include <linux/writeback.h> #include <linux/backing-dev.h> #include <linux/pagevec.h> -#include <linux/blkdev.h> #include <linux/security.h> #include <linux/cpuset.h> #include <linux/hugetlb.h>
mm/highmem.c +0 -1
@@ -23,7 +23,6 @@#include <linux/bio.h> #include <linux/pagemap.h> #include <linux/mempool.h> -#include <linux/blkdev.h> #include <linux/init.h> #include <linux/hash.h> #include <linux/highmem.h>
mm/mempool.c +0 -1
@@ -17,7 +17,6 @@#include <linux/kmemleak.h> #include <linux/export.h> #include <linux/mempool.h> -#include <linux/blkdev.h> #include <linux/writeback.h> #include "slab.h"
mm/nommu.c +0 -1
@@ -27,7 +27,6 @@#include <linux/pagemap.h> #include <linux/slab.h> #include <linux/vmalloc.h> -#include <linux/blkdev.h> #include <linux/backing-dev.h> #include <linux/compiler.h> #include <linux/mount.h>
mm/readahead.c +0 -1
@@ -12,7 +12,6 @@#include <linux/dax.h> #include <linux/gfp.h> #include <linux/export.h> -#include <linux/blkdev.h> #include <linux/backing-dev.h> #include <linux/task_io_accounting_ops.h> #include <linux/pagevec.h>
mm/shmem.c +0 -1
@@ -59,7 +59,6 @@ static struct vfsmount *shm_mnt;#include <linux/backing-dev.h> #include <linux/shmem_fs.h> #include <linux/writeback.h> -#include <linux/blkdev.h> #include <linux/pagevec.h> #include <linux/percpu_counter.h> #include <linux/falloc.h>
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 5/17 arch: remove spurious blkdev.h includes
In reply to Christoph HellwigVarious files have acquired spurious includes of <linux/blkdev.h> over time. Remove them.
--- arch/mips/rb532/prom.c | 1 - arch/mips/sibyte/common/cfe.c | 1 - arch/mips/sibyte/swarm/setup.c | 1 - arch/openrisc/mm/init.c | 1 - 4 files changed, 4 deletions(-)
arch/mips/rb532/prom.c +0 -1
@@ -16,7 +16,6 @@#include <linux/console.h> #include <linux/memblock.h> #include <linux/ioport.h> -#include <linux/blkdev.h> #include <asm/bootinfo.h> #include <asm/mach-rc32434/ddr.h>
arch/mips/sibyte/common/cfe.c +0 -1
@@ -7,7 +7,6 @@#include <linux/kernel.h> #include <linux/linkage.h> #include <linux/mm.h> -#include <linux/blkdev.h> #include <linux/memblock.h> #include <linux/pm.h> #include <linux/smp.h>
arch/mips/sibyte/swarm/setup.c +0 -1
@@ -11,7 +11,6 @@#include <linux/spinlock.h> #include <linux/mm.h> #include <linux/memblock.h> -#include <linux/blkdev.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/screen_info.h>
arch/openrisc/mm/init.c +0 -1
@@ -25,7 +25,6 @@#include <linux/memblock.h> #include <linux/init.h> #include <linux/delay.h> -#include <linux/blkdev.h> /* for initrd_* */ #include <linux/pagemap.h> #include <asm/pgalloc.h>
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 6/17 kernel: remove spurious blkdev.h includes
In reply to Christoph HellwigVarious files have acquired spurious includes of <linux/blkdev.h> over time. Remove them.
--- kernel/acct.c | 1 - kernel/exit.c | 1 - kernel/fork.c | 1 - 3 files changed, 3 deletions(-)
kernel/acct.c +0 -1
@@ -60,7 +60,6 @@#include <linux/sched/cputime.h> #include <asm/div64.h> -#include <linux/blkdev.h> /* sector_div */ #include <linux/pid_namespace.h> #include <linux/fs_pin.h>
kernel/exit.c +0 -1
@@ -48,7 +48,6 @@#include <linux/pipe_fs_i.h> #include <linux/audit.h> /* for audit_free() */ #include <linux/resource.h> -#include <linux/blkdev.h> #include <linux/task_io_accounting_ops.h> #include <linux/tracehook.h> #include <linux/fs_struct.h>
kernel/fork.c +0 -1
@@ -76,7 +76,6 @@#include <linux/taskstats_kern.h> #include <linux/random.h> #include <linux/tty.h> -#include <linux/blkdev.h> #include <linux/fs_struct.h> #include <linux/magic.h> #include <linux/perf_event.h>
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 7/17 sched: move the <linux/blkdev.h> include out of kernel/sched/sched.h
In reply to Christoph HellwigOnly core.c needs blkdev.h, so move the #include statement there.
--- kernel/sched/core.c | 2 +- kernel/sched/sched.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
kernel/sched/core.c +1 -1
@@ -13,7 +13,7 @@#include "sched.h" #include <linux/nospec.h> - +#include <linux/blkdev.h> #include <linux/kcov.h> #include <linux/scs.h>
kernel/sched/sched.h +0 -1
@@ -37,7 +37,6 @@#include <linux/binfmts.h> #include <linux/bitops.h> -#include <linux/blkdev.h> #include <linux/compat.h> #include <linux/context_tracking.h> #include <linux/cpufreq.h>
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 8/17 block: remove the unused rq_end_sector macro
In reply to Christoph Hellwig--- drivers/md/dm-rq.c | 1 - include/linux/elevator.h | 1 - 2 files changed, 2 deletions(-)
drivers/md/dm-rq.c +0 -1
@@ -7,7 +7,6 @@#include "dm-core.h" #include "dm-rq.h" -#include <linux/elevator.h> /* for rq_end_sector() */ #include <linux/blk-mq.h> #define DM_MSG_PREFIX "core-rq"
include/linux/elevator.h +0 -1
@@ -162,7 +162,6 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t);#define ELEVATOR_INSERT_FLUSH 5#define ELEVATOR_INSERT_SORT_MERGE 6 -#define rq_end_sector (rq) (blk_rq_pos(rq) + blk_rq_sectors(rq))#define rb_entry_rq (node) rb_entry((node), struct request, rb_node)#define rq_entry_fifo (ptr) list_entry((ptr), struct request, queuelist)
Signature · 1 line
2.30.2
Re: [PATCH 08/17] block: remove the unused rq_end_sector macro
So long...
Christoph Hellwig
maintainerPATCH 9/17 block: remove the unused blk_queue_state enum
In reply to Christoph Hellwig--- include/linux/blkdev.h | 5 ----- 1 file changed, 5 deletions(-)
include/linux/blkdev.h +0 -5
@@ -262,11 +262,6 @@ enum blk_eh_timer_return { BLK_EH_RESET_TIMER, /* reset timer and try again */ }; -enum blk_queue_state { - Queue_down, - Queue_up, -}; -#define BLK_TAG_ALLOC_FIFO 0/* allocate starting from 0 */ #define BLK_TAG_ALLOC_RR 1/* allocate starting from last allocated tag */
Signature · 1 line
2.30.2
Re: [PATCH 09/17] block: remove the unused blk_queue_state enum
Looks good,
Christoph Hellwig
maintainerPATCH 10/17 block: remove the cmd_size field from struct request_queue
In reply to Christoph HellwigEntirely unused.
--- include/linux/blkdev.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/blkdev.h +0 -2
@@ -544,8 +544,6 @@ struct request_queue {bool mq_sysfs_init_done; -size_t cmd_size; -#define BLK_MAX_WRITE_HINTS 5u64 write_hints[BLK_MAX_WRITE_HINTS ]; };
Signature · 1 line
2.30.2
Re: [PATCH 10/17] block: remove the cmd_size field from struct request_queue
Christoph Hellwig
maintainerPATCH 11/17 block: remove the struct blk_queue_ctx forward declaration
In reply to Christoph HellwigThis type doesn't exist at all, so no need to forward declare it.
--- include/linux/blkdev.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/blkdev.h +0 -2
@@ -253,8 +253,6 @@ static inline unsigned short req_get_ioprio(struct request *req)#include <linux/elevator.h> -struct blk_queue_ctx ; -struct bio_vec ;enum blk_eh_timer_return {
Signature · 1 line
2.30.2
Re: [PATCH 11/17] block: remove the struct blk_queue_ctx forward declaration
Looks good,
Christoph Hellwig
maintainerPATCH 12/17 block: move elevator.h to block/
In reply to Christoph HellwigExcept 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.
---
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%)block/bfq-cgroup.c +1 -1
@@ -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
block/bfq-iosched.c +1 -1
@@ -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"
block/blk-mq-sched.h +1 -0
@@ -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"
block/blk-mq-tag.h +2 -0
@@ -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. */
block/blk.h +2 -0
@@ -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)
block/elevator.c +1 -1
@@ -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"
block/elevator.h renamed from include/linux/elevator.h +3 -17
@@ -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 */
block/kyber-iosched.c +1 -1
@@ -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"
block/mq-deadline.c +1 -1
@@ -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"
drivers/block/amiflop.c +0 -1
@@ -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>
drivers/scsi/lpfc/lpfc.h +1 -0
@@ -22,6 +22,7 @@*******************************************************************/ #include <scsi/scsi_host.h> +#include <linux/hashtable.h> #include <linux/ktime.h> #include <linux/workqueue.h>
include/linux/blkdev.h +9 -2
@@ -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,
init/main.c +0 -1
@@ -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>
Signature · 1 line
2.30.2
Re: [PATCH 12/17] block: move elevator.h to block/
Looks good,
Christoph Hellwig
maintainerPATCH 13/17 block: drop unused includes in <linux/blkdev.h>
In reply to Christoph HellwigDrop various include not actually used in blkdev.h itself.
--- drivers/md/dm-ps-historical-service-time.c | 1 + drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + include/linux/blkdev.h | 7 ------- 3 files changed, 2 insertions(+), 7 deletions(-)
drivers/md/dm-ps-historical-service-time.c +1 -0
@@ -27,6 +27,7 @@#include <linux/blkdev.h> #include <linux/slab.h> #include <linux/module.h> +#include <linux/sched/clock.h> #define DM_MSG_PREFIX "multipath historical-service-time"
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 -0
@@ -3,6 +3,7 @@* Copyright (c) 2017 Hisilicon Limited. */ +#include <linux/sched/clock.h> #include "hisi_sas.h" #define DRV_NAME "hisi_sas_v3_hw"
include/linux/blkdev.h +0 -7
@@ -3,8 +3,6 @@#define _LINUX_BLKDEV_H#include <linux/sched.h> -#include <linux/sched/clock.h> -#include <linux/major.h> #include <linux/genhd.h> #include <linux/list.h> #include <linux/llist.h>
@@ -12,17 +10,12 @@#include <linux/timer.h> #include <linux/workqueue.h> #include <linux/wait.h> -#include <linux/mempool.h> -#include <linux/pfn.h> #include <linux/bio.h> -#include <linux/stringify.h> #include <linux/gfp.h> -#include <linux/smp.h> #include <linux/rcupdate.h> #include <linux/percpu-refcount.h> #include <linux/scatterlist.h> #include <linux/blkzoned.h> -#include <linux/pm.h> #include <linux/sbitmap.h> struct module ;
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 14/17 block: drop unused includes in <linux/genhd.h>
In reply to Christoph HellwigDrop various include not actually used in genhd.h itself, and move the remaning includes closer together.
--- arch/um/drivers/ubd_kern.c | 1 + block/genhd.c | 1 + block/holder.c | 1 + block/partitions/core.c | 1 + drivers/block/amiflop.c | 1 + drivers/block/ataflop.c | 1 + drivers/block/floppy.c | 1 + drivers/block/swim.c | 1 + drivers/block/xen-blkfront.c | 1 + drivers/md/md.c | 1 + drivers/s390/block/dasd_genhd.c | 1 + drivers/scsi/sd.c | 1 + drivers/scsi/sg.c | 1 + drivers/scsi/sr.c | 1 + drivers/scsi/st.c | 1 + include/linux/genhd.h | 14 ++------------ include/linux/part_stat.h | 1 + 17 files changed, 18 insertions(+), 12 deletions(-)
arch/um/drivers/ubd_kern.c +1 -0
@@ -27,6 +27,7 @@#include <linux/blk-mq.h> #include <linux/ata.h> #include <linux/hdreg.h> +#include <linux/major.h> #include <linux/cdrom.h> #include <linux/proc_fs.h> #include <linux/seq_file.h>
block/genhd.c +1 -0
@@ -19,6 +19,7 @@#include <linux/seq_file.h> #include <linux/slab.h> #include <linux/kmod.h> +#include <linux/major.h> #include <linux/mutex.h> #include <linux/idr.h> #include <linux/log2.h>
block/holder.c +1 -0
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0-only #include <linux/genhd.h> +#include <linux/slab.h> struct bd_holder_disk {struct list_head list;
block/partitions/core.c +1 -0
@@ -5,6 +5,7 @@* Copyright (C) 2020 Christoph Hellwig */ #include <linux/fs.h> +#include <linux/major.h> #include <linux/slab.h> #include <linux/ctype.h> #include <linux/genhd.h>
drivers/block/amiflop.c +1 -0
@@ -61,6 +61,7 @@#include <linux/hdreg.h> #include <linux/delay.h> #include <linux/init.h> +#include <linux/major.h> #include <linux/mutex.h> #include <linux/fs.h> #include <linux/blk-mq.h>
drivers/block/ataflop.c +1 -0
@@ -68,6 +68,7 @@#include <linux/delay.h> #include <linux/init.h> #include <linux/blk-mq.h> +#include <linux/major.h> #include <linux/mutex.h> #include <linux/completion.h> #include <linux/wait.h>
drivers/block/floppy.c +1 -0
@@ -184,6 +184,7 @@ static int print_unex = 1;#include <linux/ioport.h> #include <linux/interrupt.h> #include <linux/init.h> +#include <linux/major.h> #include <linux/platform_device.h> #include <linux/mod_devicetable.h> #include <linux/mutex.h>
drivers/block/swim.c +1 -0
@@ -16,6 +16,7 @@#include <linux/fd.h> #include <linux/slab.h> #include <linux/blk-mq.h> +#include <linux/major.h> #include <linux/mutex.h> #include <linux/hdreg.h> #include <linux/kernel.h>
drivers/block/xen-blkfront.c +1 -0
@@ -42,6 +42,7 @@#include <linux/cdrom.h> #include <linux/module.h> #include <linux/slab.h> +#include <linux/major.h> #include <linux/mutex.h> #include <linux/scatterlist.h> #include <linux/bitmap.h>
drivers/md/md.c +1 -0
@@ -51,6 +51,7 @@#include <linux/hdreg.h> #include <linux/proc_fs.h> #include <linux/random.h> +#include <linux/major.h> #include <linux/module.h> #include <linux/reboot.h> #include <linux/file.h>
drivers/s390/block/dasd_genhd.c +1 -0
@@ -14,6 +14,7 @@#define KMSG_COMPONENT "dasd"#include <linux/interrupt.h> +#include <linux/major.h> #include <linux/fs.h> #include <linux/blkpg.h>
drivers/scsi/sd.c +1 -0
@@ -48,6 +48,7 @@#include <linux/blkpg.h> #include <linux/blk-pm.h> #include <linux/delay.h> +#include <linux/major.h> #include <linux/mutex.h> #include <linux/string_helpers.h> #include <linux/async.h>
drivers/scsi/sg.c +1 -0
@@ -31,6 +31,7 @@ static int sg_version_num = 30536; /* 2 digits for each component */#include <linux/errno.h> #include <linux/mtio.h> #include <linux/ioctl.h> +#include <linux/major.h> #include <linux/slab.h> #include <linux/fcntl.h> #include <linux/init.h>
drivers/scsi/sr.c +1 -0
@@ -44,6 +44,7 @@#include <linux/cdrom.h> #include <linux/interrupt.h> #include <linux/init.h> +#include <linux/major.h> #include <linux/blkdev.h> #include <linux/blk-pm.h> #include <linux/mutex.h>
drivers/scsi/st.c +1 -0
@@ -32,6 +32,7 @@ static const char *verstr = "20160209";#include <linux/slab.h> #include <linux/errno.h> #include <linux/mtio.h> +#include <linux/major.h> #include <linux/cdrom.h> #include <linux/ioctl.h> #include <linux/fcntl.h>
include/linux/genhd.h +2 -12
@@ -12,12 +12,10 @@#include <linux/types.h> #include <linux/kdev_t.h> -#include <linux/rcupdate.h> -#include <linux/slab.h> -#include <linux/percpu-refcount.h> #include <linux/uuid.h> #include <linux/blk_types.h> -#include <asm/local.h> +#include <linux/device.h> +#include <linux/xarray.h> extern const struct device_type disk_type;extern struct device_type part_type;
@@ -26,14 +24,6 @@ extern struct class block_class;#define DISK_MAX_PARTS 256#define DISK_NAME_LEN 32 -#include <linux/major.h> -#include <linux/device.h> -#include <linux/smp.h> -#include <linux/string.h> -#include <linux/fs.h> -#include <linux/workqueue.h> -#include <linux/xarray.h> -#define PARTITION_META_INFO_VOLNAMELTH 64/* * Enough for the string representation of any kind of UUID plus NULL.
include/linux/part_stat.h +1 -0
@@ -3,6 +3,7 @@#define _LINUX_PART_STAT_H#include <linux/genhd.h> +#include <asm/local.h> struct disk_stats {u64 nsecs[NR_STAT_GROUPS ];
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 15/17 block: move a few merge helpers out of <linux/blkdev.h>
In reply to Christoph HellwigThese are block-layer internal helpers, so move them to block/blk.h and block/blk-merge.c. Also update a comment a bit to use better grammar.
--- block/blk-merge.c | 24 ++++++++++++++++ block/blk.h | 38 +++++++++++++++++++++++++ include/linux/blkdev.h | 64 ------------------------------------------ 3 files changed, 62 insertions(+), 64 deletions(-)
block/blk-merge.c +24 -0
@@ -558,6 +558,23 @@ static inline unsigned int blk_rq_get_max_segments(struct request *rq)return queue_max_segments (rq->q); } +static inline unsigned int blk_rq_get_max_sectors (struct request *rq, +sector_t offset) +{ +struct request_queue *q = rq->q; + +if (blk_rq_is_passthrough (rq)) +return q->limits.max_hw_sectors; + +if (!q->limits.chunk_sectors || +req_op (rq) ==REQ_OP_DISCARD || +req_op (rq) ==REQ_OP_SECURE_ERASE ) +return blk_queue_get_max_sectors (q,req_op (rq)); + +return min (blk_max_size_offset (q, offset,0 ), +blk_queue_get_max_sectors (q,req_op (rq))); +} +static inline int ll_new_hw_segment (struct request *req,struct bio *bio,unsigned int nr_phys_segs) {
@@ -718,6 +735,13 @@ static enum elv_merge blk_try_req_merge(struct request *req,return ELEVATOR_NO_MERGE ; } +static inline bool blk_write_same_mergeable (struct bio *a,struct bio *b) +{ +if (bio_page (a) ==bio_page (b) &&bio_offset (a) ==bio_offset (b)) +return true; +return false; +} +/* * For non-mq, this has to be called with the request spinlock acquired. * For mq with scheduling, the appropriate queue wide lock should be held.
block/blk.h +38 -0
@@ -94,6 +94,44 @@ static inline bool bvec_gap_to_prev(struct request_queue *q,return __bvec_gap_to_prev (q, bprv, offset); } +static inline bool rq_mergeable (struct request *rq) +{ +if (blk_rq_is_passthrough (rq)) +return false; + +if (req_op (rq) ==REQ_OP_FLUSH ) +return false; + +if (req_op (rq) ==REQ_OP_WRITE_ZEROES ) +return false; + +if (req_op (rq) ==REQ_OP_ZONE_APPEND ) +return false; + +if (rq->cmd_flags &REQ_NOMERGE_FLAGS ) +return false; +if (rq->rq_flags &RQF_NOMERGE_FLAGS ) +return false; + +return true; +} + +/* +* There are two different ways to handle DISCARD merges: +* 1) If max_discard_segments > 1, the driver treats every bio as a range and +* send the bios to controller together. The ranges don't need to be +* contiguous. +* 2) Otherwise, the request will be normal read/write requests. The ranges +* need to be contiguous. +*/ +static inline bool blk_discard_mergable (struct request *req) +{ +if (req_op (req) ==REQ_OP_DISCARD && +queue_max_discard_segments (req->q) >1 ) +return true; +return false; +} +#ifdef CONFIG_BLK_DEV_INTEGRITY void blk_flush_integrity (void );bool __bio_integrity_endio (struct bio *);
include/linux/blkdev.h +0 -64
82 lines not on this page · raw message
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 16/17 block: move integrity handling out of <linux/blkdev.h>
In reply to Christoph HellwigSplit the integrity/metadata handling definitions out into a new header.
--- block/bdev.c | 1 + block/bio-integrity.c | 2 +- block/blk-core.c | 1 + block/blk-integrity.c | 2 +- block/blk-merge.c | 1 + block/blk-mq.c | 1 + block/keyslot-manager.c | 1 + block/t10-pi.c | 2 +- drivers/md/dm-bio-record.h | 1 + drivers/md/dm-crypt.c | 1 + drivers/md/dm-table.c | 1 + drivers/md/md.c | 1 + drivers/nvdimm/core.c | 1 + drivers/nvme/host/core.c | 1 + drivers/nvme/host/pci.c | 1 + drivers/nvme/host/rdma.c | 1 + drivers/nvme/target/io-cmd-bdev.c | 1 + drivers/nvme/target/rdma.c | 1 + drivers/scsi/scsi_lib.c | 1 + drivers/scsi/sd_dif.c | 2 +- drivers/scsi/virtio_scsi.c | 1 + drivers/target/target_core_iblock.c | 1 + include/linux/blk-integrity.h | 183 ++++++++++++++++++++++++++++ include/linux/blkdev.h | 183 ---------------------------- 24 files changed, 205 insertions(+), 187 deletions(-) create mode 100644 include/linux/blk-integrity.h
block/bdev.c +1 -0
@@ -12,6 +12,7 @@#include <linux/major.h> #include <linux/device_cgroup.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/backing-dev.h> #include <linux/module.h> #include <linux/blkpg.h>
block/bio-integrity.c +1 -1
@@ -6,7 +6,7 @@* Written by: Martin K. Petersen <[email protected]> */ -#include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/mempool.h> #include <linux/export.h> #include <linux/bio.h>
block/blk-core.c +1 -0
@@ -18,6 +18,7 @@#include <linux/blkdev.h> #include <linux/blk-mq.h> #include <linux/blk-pm.h> +#include <linux/blk-integrity.h> #include <linux/highmem.h> #include <linux/mm.h> #include <linux/pagemap.h>
block/blk-integrity.c +1 -1
@@ -6,7 +6,7 @@* Written by: Martin K. Petersen <[email protected]> */ -#include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/backing-dev.h> #include <linux/mempool.h> #include <linux/bio.h>
block/blk-merge.c +1 -0
@@ -6,6 +6,7 @@#include <linux/module.h> #include <linux/bio.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/scatterlist.h> #include <trace/events/block.h>
block/blk-mq.c +1 -0
@@ -10,6 +10,7 @@#include <linux/backing-dev.h> #include <linux/bio.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/kmemleak.h> #include <linux/mm.h> #include <linux/init.h>
block/keyslot-manager.c +1 -0
@@ -35,6 +35,7 @@#include <linux/pm_runtime.h> #include <linux/wait.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> struct blk_ksm_keyslot {atomic_t slot_refs;
block/t10-pi.c +1 -1
@@ -5,7 +5,7 @@*/ #include <linux/t10-pi.h> -#include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/crc-t10dif.h> #include <linux/module.h> #include <net/checksum.h>
drivers/md/dm-bio-record.h +1 -0
@@ -8,6 +8,7 @@#define DM_BIO_RECORD_H #include <linux/bio.h> +#include <linux/blk-integrity.h> /* * There are lots of mutable fields in the bio struct that get
drivers/md/dm-crypt.c +1 -0
@@ -15,6 +15,7 @@#include <linux/key.h> #include <linux/bio.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/mempool.h> #include <linux/slab.h> #include <linux/crypto.h>
drivers/md/dm-table.c +1 -0
@@ -10,6 +10,7 @@#include <linux/module.h> #include <linux/vmalloc.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/namei.h> #include <linux/ctype.h> #include <linux/string.h>
drivers/md/md.c +1 -0
@@ -41,6 +41,7 @@#include <linux/sched/signal.h> #include <linux/kthread.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/badblocks.h> #include <linux/sysctl.h> #include <linux/seq_file.h>
drivers/nvdimm/core.c +1 -0
@@ -7,6 +7,7 @@#include <linux/export.h> #include <linux/module.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/device.h> #include <linux/ctype.h> #include <linux/ndctl.h>
drivers/nvme/host/core.c +1 -0
@@ -6,6 +6,7 @@#include <linux/blkdev.h> #include <linux/blk-mq.h> +#include <linux/blk-integrity.h> #include <linux/compat.h> #include <linux/delay.h> #include <linux/errno.h>
drivers/nvme/host/pci.c +1 -0
@@ -10,6 +10,7 @@#include <linux/blkdev.h> #include <linux/blk-mq.h> #include <linux/blk-mq-pci.h> +#include <linux/blk-integrity.h> #include <linux/dmi.h> #include <linux/init.h> #include <linux/interrupt.h>
drivers/nvme/host/rdma.c +1 -0
@@ -13,6 +13,7 @@#include <linux/atomic.h> #include <linux/blk-mq.h> #include <linux/blk-mq-rdma.h> +#include <linux/blk-integrity.h> #include <linux/types.h> #include <linux/list.h> #include <linux/mutex.h>
drivers/nvme/target/io-cmd-bdev.c +1 -0
@@ -5,6 +5,7 @@*/ #define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/module.h> #include "nvmet.h"
drivers/nvme/target/rdma.c +1 -0
@@ -5,6 +5,7 @@*/ #define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#include <linux/atomic.h> +#include <linux/blk-integrity.h> #include <linux/ctype.h> #include <linux/delay.h> #include <linux/err.h>
drivers/scsi/scsi_lib.c +1 -0
@@ -21,6 +21,7 @@#include <linux/hardirq.h> #include <linux/scatterlist.h> #include <linux/blk-mq.h> +#include <linux/blk-integrity.h> #include <linux/ratelimit.h> #include <asm/unaligned.h>
drivers/scsi/sd_dif.c +1 -1
@@ -6,7 +6,7 @@* Written by: Martin K. Petersen <[email protected]> */ -#include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/t10-pi.h> #include <scsi/scsi.h>
drivers/scsi/virtio_scsi.c +1 -0
@@ -22,6 +22,7 @@#include <linux/virtio_scsi.h> #include <linux/cpu.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <scsi/scsi_host.h> #include <scsi/scsi_device.h> #include <scsi/scsi_cmnd.h>
drivers/target/target_core_iblock.c +1 -0
@@ -16,6 +16,7 @@#include <linux/timer.h> #include <linux/fs.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/bio.h>
include/linux/blk-integrity.h new file +183 -0
183 lines not on this page · raw message
include/linux/blkdev.h +0 -183
189 lines not on this page · raw message
Signature · 1 line
2.30.2
Christoph Hellwig
maintainerPATCH 17/17 block: move struct request to blk-mq.h
In reply to Christoph Hellwigstruct request is only used by blk-mq drivers, so move it and all related declarations to blk-mq.h.
--- block/blk-crypto-fallback.c | 1 + block/blk-crypto-internal.h | 2 +- drivers/block/rnbd/rnbd-proto.h | 2 +- drivers/md/dm-verity-target.c | 1 + drivers/mmc/core/sd.c | 1 + drivers/target/target_core_file.c | 1 + drivers/target/target_core_iblock.c | 1 + include/linux/blk-mq.h | 465 +++++++++++++++++++++++++++ include/linux/blk_types.h | 2 - include/linux/blkdev.h | 469 +--------------------------- include/linux/blktrace_api.h | 2 +- include/linux/t10-pi.h | 2 +- include/scsi/scsi_device.h | 2 +- 13 files changed, 476 insertions(+), 475 deletions(-)
block/blk-crypto-fallback.c +1 -0
@@ -18,6 +18,7 @@#include <linux/mempool.h> #include <linux/module.h> #include <linux/random.h> +#include <linux/scatterlist.h> #include "blk-crypto-internal.h"
block/blk-crypto-internal.h +1 -1
@@ -7,7 +7,7 @@#define __LINUX_BLK_CRYPTO_INTERNAL_H#include <linux/bio.h> -#include <linux/blkdev.h> +#include <linux/blk-mq.h> /* Represents a crypto mode supported by blk-crypto */ struct blk_crypto_mode {
drivers/block/rnbd/rnbd-proto.h +1 -1
@@ -10,7 +10,7 @@#define RNBD_PROTO_H #include <linux/types.h> -#include <linux/blkdev.h> +#include <linux/blk-mq.h> #include <linux/limits.h> #include <linux/inet.h> #include <linux/in.h>
drivers/md/dm-verity-target.c +1 -0
@@ -18,6 +18,7 @@#include "dm-verity-verify-sig.h" #include <linux/module.h> #include <linux/reboot.h> +#include <linux/scatterlist.h> #define DM_MSG_PREFIX "verity"
drivers/mmc/core/sd.c +1 -0
@@ -12,6 +12,7 @@#include <linux/slab.h> #include <linux/stat.h> #include <linux/pm_runtime.h> +#include <linux/scatterlist.h> #include <linux/mmc/host.h> #include <linux/mmc/card.h>
drivers/target/target_core_file.c +1 -0
@@ -20,6 +20,7 @@#include <linux/vmalloc.h> #include <linux/falloc.h> #include <linux/uio.h> +#include <linux/scatterlist.h> #include <scsi/scsi_proto.h> #include <asm/unaligned.h>
drivers/target/target_core_iblock.c +1 -0
@@ -23,6 +23,7 @@#include <linux/genhd.h> #include <linux/file.h> #include <linux/module.h> +#include <linux/scatterlist.h> #include <scsi/scsi_proto.h> #include <asm/unaligned.h>
include/linux/blk-mq.h +465 -0
479 lines not on this page · raw message
include/linux/blk_types.h +0 -2
@@ -431,8 +431,6 @@ enum stat_group {#define bio_op (bio) \ ((bio)->bi_opf & REQ_OP_MASK) -#define req_op (req) \ - ((req)->cmd_flags & REQ_OP_MASK)/* obsolete, don't use in new code */ static inline void bio_set_op_attrs(struct bio *bio, unsigned op,
include/linux/blkdev.h +1 -468
556 lines not on this page · raw message
include/linux/blktrace_api.h +1 -1
@@ -2,7 +2,7 @@#ifndef BLKTRACE_H #define BLKTRACE_H -#include <linux/blkdev.h> +#include <linux/blk-mq.h> #include <linux/relay.h> #include <linux/compat.h> #include <uapi/linux/blktrace_api.h>
include/linux/t10-pi.h +1 -1
@@ -3,7 +3,7 @@#define _LINUX_T10_PI_H#include <linux/types.h> -#include <linux/blkdev.h> +#include <linux/blk-mq.h> /* * A T10 PI-capable target device can be formatted with different
include/scsi/scsi_device.h +1 -1
@@ -5,7 +5,7 @@#include <linux/list.h> #include <linux/spinlock.h> #include <linux/workqueue.h> -#include <linux/blkdev.h> +#include <linux/blk-mq.h> #include <scsi/scsi.h> #include <linux/atomic.h> #include <linux/sbitmap.h>
Signature · 1 line
2.30.2
Quoted 8 lines · Christoph Hellwig
Hi Jens,
this series untangles the worst of the block header maze. It removes various includes from
blkdev.handgenhd.h, and also ensures the writeback code doesn't pull inblkdev.hleading to huge rebuilds whenever they change. Finally it moves various bits out ofblkdev.hwhich shouldn't be in the general block layer header.
Quoted 4 lines
It has surived various randomconfig builds from me and the buildbot, but I suspect there are a few more conditionally missing headers that will emerge later for more oscure configs, so it would be great to get this merged early.
Applied, thanks.
Signature · 1 line
Jens Axboe