include: Remove pagemap.h from blkdev.h
Subsystems (9)
PATCH v2 1/1 include: Remove pagemap.h from blkdev.h
My UEK-derived config has 1030 files depending on pagemap.h before this change. Afterwards, just 326 files need to be rebuilt when I touch pagemap.h. I think blkdev.h is probably included too widely, but untangling that dependency is harder and this solves my problem. x86 allmodconfig builds, but there may be implicit include problems on other architectures.
---
v2: Fix CONFIG_SWAP=n implicit use of pagemap.h by swap.h. Increases
the number of files from 240, but that's still a big win -- 68% reduction instead of 77%.
block/blk-settings.c | 1 + drivers/block/brd.c | 1 + drivers/block/loop.c | 1 + drivers/md/bcache/super.c | 1 + drivers/nvdimm/btt.c | 1 + drivers/nvdimm/pmem.c | 1 + drivers/scsi/scsicam.c | 1 + include/linux/blkdev.h | 1 - include/linux/swap.h | 1 + 9 files changed, 8 insertions(+), 1 deletion(-)
block/blk-settings.c +1 -0
@@ -7,6 +7,7 @@#include <linux/init.h> #include <linux/bio.h> #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/memblock.h> /* for max_pfn/max_low_pfn */ #include <linux/gcd.h> #include <linux/lcm.h>
drivers/block/brd.c +1 -0
@@ -18,6 +18,7 @@#include <linux/bio.h> #include <linux/highmem.h> #include <linux/mutex.h> +#include <linux/pagemap.h> #include <linux/radix-tree.h> #include <linux/fs.h> #include <linux/slab.h>
drivers/block/loop.c +1 -0
@@ -53,6 +53,7 @@#include <linux/moduleparam.h> #include <linux/sched.h> #include <linux/fs.h> +#include <linux/pagemap.h> #include <linux/file.h> #include <linux/stat.h> #include <linux/errno.h>
drivers/md/bcache/super.c +1 -0
@@ -16,6 +16,7 @@#include "features.h" #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/debugfs.h> #include <linux/genhd.h> #include <linux/idr.h>
drivers/nvdimm/btt.c +1 -0
@@ -6,6 +6,7 @@#include <linux/highmem.h> #include <linux/debugfs.h> #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/module.h> #include <linux/device.h> #include <linux/mutex.h>
drivers/nvdimm/pmem.c +1 -0
@@ -8,6 +8,7 @@*/ #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/hdreg.h> #include <linux/init.h> #include <linux/platform_device.h>
drivers/scsi/scsicam.c +1 -0
@@ -17,6 +17,7 @@#include <linux/genhd.h> #include <linux/kernel.h> #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/msdos_partition.h> #include <asm/unaligned.h>
include/linux/blkdev.h +0 -1
@@ -11,7 +11,6 @@#include <linux/minmax.h> #include <linux/timer.h> #include <linux/workqueue.h> -#include <linux/pagemap.h> #include <linux/backing-dev-defs.h> #include <linux/wait.h> #include <linux/mempool.h>
include/linux/swap.h +1 -0
@@ -10,6 +10,7 @@#include <linux/sched.h> #include <linux/node.h> #include <linux/fs.h> +#include <linux/pagemap.h> #include <linux/atomic.h> #include <linux/page-flags.h> #include <asm/page.h>
Signature · 1 line
2.30.0
Quoted 14 lines · Matthew Wilcox (Oracle)
My UEK-derived config has 1030 files depending on
pagemap.hbefore this change. Afterwards, just 326 files need to be rebuilt when I touchpagemap.h. I thinkblkdev.his probably included too widely, but untangling that dependency is harder and this solves my problem. x86 allmodconfig builds, but there may be implicit include problems on other architectures.Signed-off-by Matthew Wilcox (Oracle) <[email protected]>---
v2: FixCONFIG_SWAP=nimplicit use ofpagemap.hbyswap.h. Increases
the number of files from 240, but that's still a big win -- 68% reduction instead of 77%.
[..]
Quoted 2 lines
drivers/nvdimm/btt.c | 1 + drivers/nvdimm/pmem.c | 1 +
For the nvdimm bits:
Quoted 6 lines · Matthew Wilcox (Oracle)
My UEK-derived config has 1030 files depending on
pagemap.hbefore this change. Afterwards, just 326 files need to be rebuilt when I touchpagemap.h. I thinkblkdev.his probably included too widely, but untangling that dependency is harder and this solves my problem. x86 allmodconfig builds, but there may be implicit include problems on other architectures.
For the block bits:
Signature · 1 line
Jens Axboe
Quoted 7 lines · Matthew Wilcox (Oracle)
My UEK-derived config has 1030 files depending on
pagemap.hbefore this change. Afterwards, just 326 files need to be rebuilt when I touchpagemap.h. I thinkblkdev.his probably included too widely, but untangling that dependency is harder and this solves my problem. x86 allmodconfig builds, but there may be implicit include problems on other architectures.
Quoted 5 lines
Signed-off-by Matthew Wilcox (Oracle) <[email protected]>---
v2: FixCONFIG_SWAP=nimplicit use ofpagemap.hbyswap.h. Increases
the number of files from 240, but that's still a big win -- 68% reduction instead of 77%.
Looks good. I suspect blkdev.h also has penty of other includes that aren't needed either..
Quoted 24 lines · Matthew Wilcox (Oracle)
My UEK-derived config has 1030 files depending on
pagemap.hbefore this change. Afterwards, just 326 files need to be rebuilt when I touchpagemap.h. I thinkblkdev.his probably included too widely, but untangling that dependency is harder and this solves my problem. x86 allmodconfig builds, but there may be implicit include problems on other architectures.Signed-off-by Matthew Wilcox (Oracle) <[email protected]>---
v2: FixCONFIG_SWAP=nimplicit use ofpagemap.hbyswap.h. Increases
the number of files from 240, but that's still a big win -- 68% reduction instead of 77%.block/blk-settings.c | 1 + drivers/block/brd.c | 1 + drivers/block/loop.c | 1 + drivers/md/bcache/super.c | 1 + drivers/nvdimm/btt.c | 1 + drivers/nvdimm/pmem.c | 1 + drivers/scsi/scsicam.c | 1 + include/linux/blkdev.h | 1 - include/linux/swap.h | 1 + 9 files changed, 8 insertions(+), 1 deletion(-)
[snipped]
drivers/md/bcache/super.c line 22
Quoted 12 lines
drivers/md/bcache/super.c +1
-0@@ -16,6 +16,7 @@#include "features.h" #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/debugfs.h> #include <linux/genhd.h> #include <linux/idr.h>[snipped]
For bcache part, Acked-by: Coly Li <[email protected]>
Thanks.
Coly Li
Matthew,
Quoted 6 lines
My UEK-derived config has 1030 files depending on
pagemap.hbefore this change. Afterwards, just 326 files need to be rebuilt when I touchpagemap.h. I thinkblkdev.his probably included too widely, but untangling that dependency is harder and this solves my problem. x86 allmodconfig builds, but there may be implicit include problems on other architectures.
SCSI portion looks fine.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Nice cleanup, IMHO.
Quoted 138 lines · Matthew Wilcox (Oracle)
My UEK-derived config has 1030 files depending on
pagemap.hbefore this change. Afterwards, just 326 files need to be rebuilt when I touchpagemap.h. I thinkblkdev.his probably included too widely, but untangling that dependency is harder and this solves my problem. x86 allmodconfig builds, but there may be implicit include problems on other architectures.Signed-off-by Matthew Wilcox (Oracle) <[email protected]>---
v2: FixCONFIG_SWAP=nimplicit use ofpagemap.hbyswap.h. Increases
the number of files from 240, but that's still a big win -- 68% reduction instead of 77%.block/blk-settings.c | 1 + drivers/block/brd.c | 1 + drivers/block/loop.c | 1 + drivers/md/bcache/super.c | 1 + drivers/nvdimm/btt.c | 1 + drivers/nvdimm/pmem.c | 1 + drivers/scsi/scsicam.c | 1 + include/linux/blkdev.h | 1 - include/linux/swap.h | 1 + 9 files changed, 8 insertions(+), 1 deletion(-)block/blk-settings.c +1
-0@@ -7,6 +7,7 @@#include <linux/init.h> #include <linux/bio.h> #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/memblock.h> /* for max_pfn/max_low_pfn */ #include <linux/gcd.h> #include <linux/lcm.h> drivers/block/brd.c +1
-0@@ -18,6 +18,7 @@#include <linux/bio.h> #include <linux/highmem.h> #include <linux/mutex.h> +#include <linux/pagemap.h> #include <linux/radix-tree.h> #include <linux/fs.h> #include <linux/slab.h> drivers/block/loop.c +1
-0@@ -53,6 +53,7 @@#include <linux/moduleparam.h> #include <linux/sched.h> #include <linux/fs.h> +#include <linux/pagemap.h> #include <linux/file.h> #include <linux/stat.h> #include <linux/errno.h> drivers/md/bcache/super.c +1
-0@@ -16,6 +16,7 @@#include "features.h" #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/debugfs.h> #include <linux/genhd.h> #include <linux/idr.h> drivers/nvdimm/btt.c +1
-0@@ -6,6 +6,7 @@#include <linux/highmem.h> #include <linux/debugfs.h> #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/module.h> #include <linux/device.h> #include <linux/mutex.h> drivers/nvdimm/pmem.c +1
-0@@ -8,6 +8,7 @@*/ #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/hdreg.h> #include <linux/init.h> #include <linux/platform_device.h> drivers/scsi/scsicam.c +1
-0@@ -17,6 +17,7 @@#include <linux/genhd.h> #include <linux/kernel.h> #include <linux/blkdev.h> +#include <linux/pagemap.h> #include <linux/msdos_partition.h> #include <asm/unaligned.h> include/linux/blkdev.h +0
-1@@ -11,7 +11,6 @@#include <linux/minmax.h> #include <linux/timer.h> #include <linux/workqueue.h> -#include <linux/pagemap.h> #include <linux/backing-dev-defs.h> #include <linux/wait.h> #include <linux/mempool.h> include/linux/swap.h +1
-0@@ -10,6 +10,7 @@#include <linux/sched.h> #include <linux/node.h> #include <linux/fs.h> +#include <linux/pagemap.h> #include <linux/atomic.h> #include <linux/page-flags.h> #include <asm/page.h> Signature · 1 line
2.30.0