diff options
author | David Howells <dhowells@redhat.com> | 2006-09-30 14:45:40 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:52:31 -0400 |
commit | 9361401eb7619c033e2394e4f9f6d410d6719ac7 (patch) | |
tree | 04b94a71f2366988c17740d1c16cfbdec41d5d2e /drivers | |
parent | d366e40a1cabd453be6e2609caa7e12f9ca17b1f (diff) |
[PATCH] BLOCK: Make it possible to disable the block layer [try #6]
Make it possible to disable the block layer. Not all embedded devices require
it, some can make do with just JFFS2, NFS, ramfs, etc - none of which require
the block layer to be present.
This patch does the following:
(*) Introduces CONFIG_BLOCK to disable the block layer, buffering and blockdev
support.
(*) Adds dependencies on CONFIG_BLOCK to any configuration item that controls
an item that uses the block layer. This includes:
(*) Block I/O tracing.
(*) Disk partition code.
(*) All filesystems that are block based, eg: Ext3, ReiserFS, ISOFS.
(*) The SCSI layer. As far as I can tell, even SCSI chardevs use the
block layer to do scheduling. Some drivers that use SCSI facilities -
such as USB storage - end up disabled indirectly from this.
(*) Various block-based device drivers, such as IDE and the old CDROM
drivers.
(*) MTD blockdev handling and FTL.
(*) JFFS - which uses set_bdev_super(), something it could avoid doing by
taking a leaf out of JFFS2's book.
(*) Makes most of the contents of linux/blkdev.h, linux/buffer_head.h and
linux/elevator.h contingent on CONFIG_BLOCK being set. sector_div() is,
however, still used in places, and so is still available.
(*) Also made contingent are the contents of linux/mpage.h, linux/genhd.h and
parts of linux/fs.h.
(*) Makes a number of files in fs/ contingent on CONFIG_BLOCK.
(*) Makes mm/bounce.c (bounce buffering) contingent on CONFIG_BLOCK.
(*) set_page_dirty() doesn't call __set_page_dirty_buffers() if CONFIG_BLOCK
is not enabled.
(*) fs/no-block.c is created to hold out-of-line stubs and things that are
required when CONFIG_BLOCK is not set:
(*) Default blockdev file operations (to give error ENODEV on opening).
(*) Makes some /proc changes:
(*) /proc/devices does not list any blockdevs.
(*) /proc/diskstats and /proc/partitions are contingent on CONFIG_BLOCK.
(*) Makes some compat ioctl handling contingent on CONFIG_BLOCK.
(*) If CONFIG_BLOCK is not defined, makes sys_quotactl() return -ENODEV if
given command other than Q_SYNC or if a special device is specified.
(*) In init/do_mounts.c, no reference is made to the blockdev routines if
CONFIG_BLOCK is not defined. This does not prohibit NFS roots or JFFS2.
(*) The bdflush, ioprio_set and ioprio_get syscalls can now be absent (return
error ENOSYS by way of cond_syscall if so).
(*) The seclvl_bd_claim() and seclvl_bd_release() security calls do nothing if
CONFIG_BLOCK is not set, since they can't then happen.
Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/Kconfig | 4 | ||||
-rw-r--r-- | drivers/cdrom/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/Kconfig | 1 | ||||
-rw-r--r-- | drivers/char/random.c | 4 | ||||
-rw-r--r-- | drivers/ide/Kconfig | 4 | ||||
-rw-r--r-- | drivers/md/Kconfig | 3 | ||||
-rw-r--r-- | drivers/message/i2o/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mmc/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mmc/Makefile | 3 | ||||
-rw-r--r-- | drivers/mtd/Kconfig | 12 | ||||
-rw-r--r-- | drivers/mtd/devices/Kconfig | 2 | ||||
-rw-r--r-- | drivers/s390/block/Kconfig | 2 | ||||
-rw-r--r-- | drivers/scsi/Kconfig | 2 |
13 files changed, 31 insertions, 12 deletions
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index b5382cedf0c0..422e31d5f8e5 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
@@ -2,6 +2,8 @@ | |||
2 | # Block device driver configuration | 2 | # Block device driver configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | if BLOCK | ||
6 | |||
5 | menu "Block devices" | 7 | menu "Block devices" |
6 | 8 | ||
7 | config BLK_DEV_FD | 9 | config BLK_DEV_FD |
@@ -468,3 +470,5 @@ config ATA_OVER_ETH | |||
468 | devices like the Coraid EtherDrive (R) Storage Blade. | 470 | devices like the Coraid EtherDrive (R) Storage Blade. |
469 | 471 | ||
470 | endmenu | 472 | endmenu |
473 | |||
474 | endif | ||
diff --git a/drivers/cdrom/Kconfig b/drivers/cdrom/Kconfig index ff5652d40619..4b12e9031fb3 100644 --- a/drivers/cdrom/Kconfig +++ b/drivers/cdrom/Kconfig | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | menu "Old CD-ROM drivers (not SCSI, not IDE)" | 5 | menu "Old CD-ROM drivers (not SCSI, not IDE)" |
6 | depends on ISA | 6 | depends on ISA && BLOCK |
7 | 7 | ||
8 | config CD_NO_IDESCSI | 8 | config CD_NO_IDESCSI |
9 | bool "Support non-SCSI/IDE/ATAPI CDROM drives" | 9 | bool "Support non-SCSI/IDE/ATAPI CDROM drives" |
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 4cc619edf424..bde1c665d9f4 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -1006,6 +1006,7 @@ config GPIO_VR41XX | |||
1006 | 1006 | ||
1007 | config RAW_DRIVER | 1007 | config RAW_DRIVER |
1008 | tristate "RAW driver (/dev/raw/rawN) (OBSOLETE)" | 1008 | tristate "RAW driver (/dev/raw/rawN) (OBSOLETE)" |
1009 | depends on BLOCK | ||
1009 | help | 1010 | help |
1010 | The raw driver permits block devices to be bound to /dev/raw/rawN. | 1011 | The raw driver permits block devices to be bound to /dev/raw/rawN. |
1011 | Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O. | 1012 | Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O. |
diff --git a/drivers/char/random.c b/drivers/char/random.c index 4c3a5ca9d8f7..b430a12eb819 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -655,6 +655,7 @@ void add_interrupt_randomness(int irq) | |||
655 | add_timer_randomness(irq_timer_state[irq], 0x100 + irq); | 655 | add_timer_randomness(irq_timer_state[irq], 0x100 + irq); |
656 | } | 656 | } |
657 | 657 | ||
658 | #ifdef CONFIG_BLOCK | ||
658 | void add_disk_randomness(struct gendisk *disk) | 659 | void add_disk_randomness(struct gendisk *disk) |
659 | { | 660 | { |
660 | if (!disk || !disk->random) | 661 | if (!disk || !disk->random) |
@@ -667,6 +668,7 @@ void add_disk_randomness(struct gendisk *disk) | |||
667 | } | 668 | } |
668 | 669 | ||
669 | EXPORT_SYMBOL(add_disk_randomness); | 670 | EXPORT_SYMBOL(add_disk_randomness); |
671 | #endif | ||
670 | 672 | ||
671 | #define EXTRACT_SIZE 10 | 673 | #define EXTRACT_SIZE 10 |
672 | 674 | ||
@@ -918,6 +920,7 @@ void rand_initialize_irq(int irq) | |||
918 | } | 920 | } |
919 | } | 921 | } |
920 | 922 | ||
923 | #ifdef CONFIG_BLOCK | ||
921 | void rand_initialize_disk(struct gendisk *disk) | 924 | void rand_initialize_disk(struct gendisk *disk) |
922 | { | 925 | { |
923 | struct timer_rand_state *state; | 926 | struct timer_rand_state *state; |
@@ -932,6 +935,7 @@ void rand_initialize_disk(struct gendisk *disk) | |||
932 | disk->random = state; | 935 | disk->random = state; |
933 | } | 936 | } |
934 | } | 937 | } |
938 | #endif | ||
935 | 939 | ||
936 | static ssize_t | 940 | static ssize_t |
937 | random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) | 941 | random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index b6fb167e20f6..69d627bd537a 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -4,6 +4,8 @@ | |||
4 | # Andre Hedrick <andre@linux-ide.org> | 4 | # Andre Hedrick <andre@linux-ide.org> |
5 | # | 5 | # |
6 | 6 | ||
7 | if BLOCK | ||
8 | |||
7 | menu "ATA/ATAPI/MFM/RLL support" | 9 | menu "ATA/ATAPI/MFM/RLL support" |
8 | 10 | ||
9 | config IDE | 11 | config IDE |
@@ -1082,3 +1084,5 @@ config BLK_DEV_HD | |||
1082 | endif | 1084 | endif |
1083 | 1085 | ||
1084 | endmenu | 1086 | endmenu |
1087 | |||
1088 | endif | ||
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig index bf869ed03eed..6dd31a291d84 100644 --- a/drivers/md/Kconfig +++ b/drivers/md/Kconfig | |||
@@ -2,6 +2,8 @@ | |||
2 | # Block device driver configuration | 2 | # Block device driver configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | if BLOCK | ||
6 | |||
5 | menu "Multi-device support (RAID and LVM)" | 7 | menu "Multi-device support (RAID and LVM)" |
6 | 8 | ||
7 | config MD | 9 | config MD |
@@ -251,3 +253,4 @@ config DM_MULTIPATH_EMC | |||
251 | 253 | ||
252 | endmenu | 254 | endmenu |
253 | 255 | ||
256 | endif | ||
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index fef677103880..6443392bffff 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig | |||
@@ -88,7 +88,7 @@ config I2O_BUS | |||
88 | 88 | ||
89 | config I2O_BLOCK | 89 | config I2O_BLOCK |
90 | tristate "I2O Block OSM" | 90 | tristate "I2O Block OSM" |
91 | depends on I2O | 91 | depends on I2O && BLOCK |
92 | ---help--- | 92 | ---help--- |
93 | Include support for the I2O Block OSM. The Block OSM presents disk | 93 | Include support for the I2O Block OSM. The Block OSM presents disk |
94 | and other structured block devices to the operating system. If you | 94 | and other structured block devices to the operating system. If you |
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 45bcf098e762..f540bd88dc5a 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig | |||
@@ -21,7 +21,7 @@ config MMC_DEBUG | |||
21 | 21 | ||
22 | config MMC_BLOCK | 22 | config MMC_BLOCK |
23 | tristate "MMC block device driver" | 23 | tristate "MMC block device driver" |
24 | depends on MMC | 24 | depends on MMC && BLOCK |
25 | default y | 25 | default y |
26 | help | 26 | help |
27 | Say Y here to enable the MMC block device driver support. | 27 | Say Y here to enable the MMC block device driver support. |
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index d2957e35cc6f..b1f6e03e7aa9 100644 --- a/drivers/mmc/Makefile +++ b/drivers/mmc/Makefile | |||
@@ -24,7 +24,8 @@ obj-$(CONFIG_MMC_AU1X) += au1xmmc.o | |||
24 | obj-$(CONFIG_MMC_OMAP) += omap.o | 24 | obj-$(CONFIG_MMC_OMAP) += omap.o |
25 | obj-$(CONFIG_MMC_AT91RM9200) += at91_mci.o | 25 | obj-$(CONFIG_MMC_AT91RM9200) += at91_mci.o |
26 | 26 | ||
27 | mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o | 27 | mmc_core-y := mmc.o mmc_sysfs.o |
28 | mmc_core-$(CONFIG_BLOCK) += mmc_queue.o | ||
28 | 29 | ||
29 | ifeq ($(CONFIG_MMC_DEBUG),y) | 30 | ifeq ($(CONFIG_MMC_DEBUG),y) |
30 | EXTRA_CFLAGS += -DDEBUG | 31 | EXTRA_CFLAGS += -DDEBUG |
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index a03e862851db..a304b34c2632 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig | |||
@@ -166,7 +166,7 @@ config MTD_CHAR | |||
166 | 166 | ||
167 | config MTD_BLOCK | 167 | config MTD_BLOCK |
168 | tristate "Caching block device access to MTD devices" | 168 | tristate "Caching block device access to MTD devices" |
169 | depends on MTD | 169 | depends on MTD && BLOCK |
170 | ---help--- | 170 | ---help--- |
171 | Although most flash chips have an erase size too large to be useful | 171 | Although most flash chips have an erase size too large to be useful |
172 | as block devices, it is possible to use MTD devices which are based | 172 | as block devices, it is possible to use MTD devices which are based |
@@ -188,7 +188,7 @@ config MTD_BLOCK | |||
188 | 188 | ||
189 | config MTD_BLOCK_RO | 189 | config MTD_BLOCK_RO |
190 | tristate "Readonly block device access to MTD devices" | 190 | tristate "Readonly block device access to MTD devices" |
191 | depends on MTD_BLOCK!=y && MTD | 191 | depends on MTD_BLOCK!=y && MTD && BLOCK |
192 | help | 192 | help |
193 | This allows you to mount read-only file systems (such as cramfs) | 193 | This allows you to mount read-only file systems (such as cramfs) |
194 | from an MTD device, without the overhead (and danger) of the caching | 194 | from an MTD device, without the overhead (and danger) of the caching |
@@ -199,7 +199,7 @@ config MTD_BLOCK_RO | |||
199 | 199 | ||
200 | config FTL | 200 | config FTL |
201 | tristate "FTL (Flash Translation Layer) support" | 201 | tristate "FTL (Flash Translation Layer) support" |
202 | depends on MTD | 202 | depends on MTD && BLOCK |
203 | ---help--- | 203 | ---help--- |
204 | This provides support for the original Flash Translation Layer which | 204 | This provides support for the original Flash Translation Layer which |
205 | is part of the PCMCIA specification. It uses a kind of pseudo- | 205 | is part of the PCMCIA specification. It uses a kind of pseudo- |
@@ -215,7 +215,7 @@ config FTL | |||
215 | 215 | ||
216 | config NFTL | 216 | config NFTL |
217 | tristate "NFTL (NAND Flash Translation Layer) support" | 217 | tristate "NFTL (NAND Flash Translation Layer) support" |
218 | depends on MTD | 218 | depends on MTD && BLOCK |
219 | ---help--- | 219 | ---help--- |
220 | This provides support for the NAND Flash Translation Layer which is | 220 | This provides support for the NAND Flash Translation Layer which is |
221 | used on M-Systems' DiskOnChip devices. It uses a kind of pseudo- | 221 | used on M-Systems' DiskOnChip devices. It uses a kind of pseudo- |
@@ -238,7 +238,7 @@ config NFTL_RW | |||
238 | 238 | ||
239 | config INFTL | 239 | config INFTL |
240 | tristate "INFTL (Inverse NAND Flash Translation Layer) support" | 240 | tristate "INFTL (Inverse NAND Flash Translation Layer) support" |
241 | depends on MTD | 241 | depends on MTD && BLOCK |
242 | ---help--- | 242 | ---help--- |
243 | This provides support for the Inverse NAND Flash Translation | 243 | This provides support for the Inverse NAND Flash Translation |
244 | Layer which is used on M-Systems' newer DiskOnChip devices. It | 244 | Layer which is used on M-Systems' newer DiskOnChip devices. It |
@@ -255,7 +255,7 @@ config INFTL | |||
255 | 255 | ||
256 | config RFD_FTL | 256 | config RFD_FTL |
257 | tristate "Resident Flash Disk (Flash Translation Layer) support" | 257 | tristate "Resident Flash Disk (Flash Translation Layer) support" |
258 | depends on MTD | 258 | depends on MTD && BLOCK |
259 | ---help--- | 259 | ---help--- |
260 | This provides support for the flash translation layer known | 260 | This provides support for the flash translation layer known |
261 | as the Resident Flash Disk (RFD), as used by the Embedded BIOS | 261 | as the Resident Flash Disk (RFD), as used by the Embedded BIOS |
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig index 16c02b5ccf7e..440f6851da69 100644 --- a/drivers/mtd/devices/Kconfig +++ b/drivers/mtd/devices/Kconfig | |||
@@ -136,7 +136,7 @@ config MTDRAM_ABS_POS | |||
136 | 136 | ||
137 | config MTD_BLOCK2MTD | 137 | config MTD_BLOCK2MTD |
138 | tristate "MTD using block device" | 138 | tristate "MTD using block device" |
139 | depends on MTD | 139 | depends on MTD && BLOCK |
140 | help | 140 | help |
141 | This driver allows a block device to appear as an MTD. It would | 141 | This driver allows a block device to appear as an MTD. It would |
142 | generally be used in the following cases: | 142 | generally be used in the following cases: |
diff --git a/drivers/s390/block/Kconfig b/drivers/s390/block/Kconfig index 929d6fff6152..b250c5354503 100644 --- a/drivers/s390/block/Kconfig +++ b/drivers/s390/block/Kconfig | |||
@@ -1,4 +1,4 @@ | |||
1 | if S390 | 1 | if S390 && BLOCK |
2 | 2 | ||
3 | comment "S/390 block device drivers" | 3 | comment "S/390 block device drivers" |
4 | depends on S390 | 4 | depends on S390 |
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index c4dfcc91ddda..dab082002e6f 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -3,11 +3,13 @@ menu "SCSI device support" | |||
3 | config RAID_ATTRS | 3 | config RAID_ATTRS |
4 | tristate "RAID Transport Class" | 4 | tristate "RAID Transport Class" |
5 | default n | 5 | default n |
6 | depends on BLOCK | ||
6 | ---help--- | 7 | ---help--- |
7 | Provides RAID | 8 | Provides RAID |
8 | 9 | ||
9 | config SCSI | 10 | config SCSI |
10 | tristate "SCSI device support" | 11 | tristate "SCSI device support" |
12 | depends on BLOCK | ||
11 | ---help--- | 13 | ---help--- |
12 | If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or | 14 | If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or |
13 | any other SCSI device under Linux, say Y and make sure that you know | 15 | any other SCSI device under Linux, say Y and make sure that you know |