linux/drivers
Nick Piggin 9db5579be4 rewrite rd
This is a rewrite of the ramdisk block device driver.

The old one is really difficult because it effectively implements a block
device which serves data out of its own buffer cache.  It relies on the dirty
bit being set, to pin its backing store in cache, however there are non
trivial paths which can clear the dirty bit (eg.  try_to_free_buffers()),
which had recently lead to data corruption.  And in general it is completely
wrong for a block device driver to do this.

The new one is more like a regular block device driver.  It has no idea about
vm/vfs stuff.  It's backing store is similar to the buffer cache (a simple
radix-tree of pages), but it doesn't know anything about page cache (the pages
in the radix tree are not pagecache pages).

There is one slight downside -- direct block device access and filesystem
metadata access goes through an extra copy and gets stored in RAM twice.
However, this downside is only slight, because the real buffercache of the
device is now reclaimable (because we're not playing crazy games with it), so
under memory intensive situations, footprint should effectively be the same --
maybe even a slight advantage to the new driver because it can also reclaim
buffer heads.

The fact that it now goes through all the regular vm/fs paths makes it
much more useful for testing, too.

   text    data     bss     dec     hex filename
   2837     849     384    4070     fe6 drivers/block/rd.o
   3528     371      12    3911     f47 drivers/block/brd.o

Text is larger, but data and bss are smaller, making total size smaller.

A few other nice things about it:
- Similar structure and layout to the new loop device handlinag.
- Dynamic ramdisk creation.
- Runtime flexible buffer head size (because it is no longer part of the
  ramdisk code).
- Boot / load time flexible ramdisk size, which could easily be extended
  to a per-ramdisk runtime changeable size (eg. with an ioctl).
- Can use highmem for the backing store.

[akpm@linux-foundation.org: fix build]
[byron.bbradley@gmail.com: make rd_size non-static]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:30 -08:00
..
acorn/char
acpi ACPI: fix build warning 2008-02-07 04:24:01 -05:00
amba
ata ata_piix.c:piix_init_one() must be __devinit 2008-02-06 07:01:56 -05:00
atm
auxdisplay
base Driver core: Revert "Fix Firmware class name collision" 2008-02-07 11:31:46 -08:00
block rewrite rd 2008-02-08 09:22:30 -08:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-02-05 10:09:07 -08:00
cdrom Merge branch 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-02-07 09:02:26 -08:00
char tty_ioctl: drag screaming into compliance with the coding style 2008-02-08 09:22:25 -08:00
clocksource
connector
cpufreq [CPUFREQ] fix configuration help message 2008-02-06 22:57:58 -05:00
cpuidle Revert "cpuidle: build fix for non-x86" 2008-02-07 04:16:34 -05:00
crypto
dca
dio dio: ARRAY_SIZE() cleanup 2008-02-05 09:44:23 -08:00
dma async_tx: replace 'int_en' with operation preparation flags 2008-02-06 10:12:18 -07:00
edac drivers/edac/i3000: document type promotion 2008-02-07 08:42:23 -08:00
eisa
firewire
firmware dmi: Let drivers walk the DMI table 2008-02-07 20:39:40 -05:00
gpio gpio: handle pca953{4,5,6,7,8} too 2008-02-06 10:41:15 -08:00
hid
hwmon hwmon: (lm80) Add individual alarm files 2008-02-07 20:39:45 -05:00
i2c hwmon: Discard useless I2C driver IDs 2008-02-07 20:39:44 -05:00
ide aout: remove unnecessary inclusions of {asm, linux}/a.out.h 2008-02-08 09:22:30 -08:00
ieee1394 ieee1394: sbp2: fix bogus s/g access change 2008-02-02 13:48:16 +01:00
infiniband RDMA/nes: Add a driver for NetEffect RNICs 2008-02-04 20:20:45 -08:00
input mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
isdn drivers/isdn/hardware/eicon/debug.c: fix uninitialized var warning 2008-02-06 10:41:12 -08:00
leds leds: Add HP Jornada 6xx driver 2008-02-07 10:10:28 +00:00
lguest virtio: reset function 2008-02-04 23:50:03 +11:00
macintosh ppc: fix #ifdef-s in mediabay driver (take 2) 2008-02-06 02:57:50 +01:00
mca
md dm raid1: report fault status 2008-02-08 02:11:39 +00:00
media Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2008-02-07 12:57:44 -08:00
message drivers/message/: Spelling fixes 2008-02-03 17:21:01 +02:00
mfd ASIC3 driver 2008-02-07 08:42:23 -08:00
misc [SCSI] enclosure: add support for enclosure services 2008-02-07 18:04:10 -06:00
mmc
mtd Merge git://git.infradead.org/mtd-2.6 2008-02-07 10:20:31 -08:00
net mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
nubus nubus: kill drivers/nubus/nubus_syms.c 2008-02-05 09:44:23 -08:00
of [POWERPC] Create and hook up of_platform_device_shutdown 2008-02-06 16:29:59 +11:00
oprofile
parisc iommu sg merging: parisc: make iommu respect the segment size limits 2008-02-05 09:44:10 -08:00
parport mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
pci mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
pcmcia drivers/pcmcia: add missing pci_dev_get 2008-02-05 09:44:09 -08:00
pnp Merge branches 'release', 'bugzilla-6217', 'bugzilla-6629', 'bugzilla-6933', 'bugzilla-7186', 'bugzilla-8269', 'bugzilla-8570', 'bugzilla-9139', 'bugzilla-9277', 'bugzilla-9341', 'bugzilla-9444', 'bugzilla-9614', 'bugzilla-9643' and 'bugzilla-9644' into release 2008-02-07 03:09:43 -05:00
power Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2008-02-07 09:45:58 -08:00
ps3 ps3: use symbolic names for video modes 2008-02-06 10:41:17 -08:00
rapidio
rtc rtc: at91sam9 RTC support (RTT and/or RTC) 2008-02-06 10:41:14 -08:00
s390 calibrate_delay() must be __cpuinit 2008-02-06 10:41:08 -08:00
sbus
scsi Convert SG from nopage to fault. 2008-02-07 19:09:22 -08:00
serial serial_core: bring mostly into line with coding style 2008-02-08 09:22:25 -08:00
sh
sn
spi spi: remove more dev->power.power_state usage 2008-02-06 10:41:11 -08:00
ssb drivers/ssb/: Spelling fixes 2008-02-03 17:30:25 +02:00
tc
telephony
thermal the generic thermal sysfs driver 2008-02-01 23:12:19 -05:00
uio uio: nopage 2008-02-06 10:41:07 -08:00
usb usb: net2280 can't have a function called show_registers() 2008-02-08 09:22:30 -08:00
video mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
virtio virtio: add missing #include <linux/delay.h> 2008-02-06 10:41:21 -08:00
w1 DS1WM: decouple host IRQ and INTR active state settings 2008-02-07 08:42:06 -08:00
watchdog drivers/watchdog/: Spelling fixes 2008-02-03 17:32:52 +02:00
xen
zorro
Kconfig Merge branches 'release' and 'menlo' into release 2008-02-07 03:18:04 -05:00
Makefile Merge branches 'release' and 'menlo' into release 2008-02-07 03:18:04 -05:00