remarkable-linux/drivers/block
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
..
aoe Driver core: convert block from raw kobjects to core devices 2008-01-24 20:40:36 -08:00
paride fix ! versus & precedence in various places 2008-02-06 10:40:59 -08:00
amiflop.c [BLOCK] Get rid of request_queue_t typedef 2007-07-24 09:28:11 +02:00
ataflop.c Atari floppy: Rename disk_type to atari_disk_type 2008-02-06 10:41:10 -08:00
brd.c rewrite rd 2008-02-08 09:22:30 -08:00
cciss.c cciss: use upper_32_bits() macro to eliminate warnings 2008-02-06 10:41:03 -08:00
cciss.h
cciss_cmd.h
cciss_scsi.c drivers/block/: Spelling fixes 2008-02-03 17:09:38 +02:00
cciss_scsi.h cciss: update copyright notices 2007-10-29 11:33:05 +01:00
cpqarray.c blk_end_request: changing cpqarray (take 4) 2008-01-28 10:37:00 +01:00
cpqarray.h
cryptoloop.c SG: Change sg_set_page() to take length and offset argument 2007-10-24 11:20:47 +02:00
DAC960.c blk_end_request: changing DAC960 (take 4) 2008-01-28 10:36:04 +01:00
DAC960.h Fix DAC960 driver on machines which don't support 64-bit DMA 2007-09-11 17:21:19 -07:00
floppy.c blk_end_request: changing floppy (take 4) 2008-01-28 10:36:21 +01:00
ida_cmd.h
ida_ioctl.h
Kconfig rewrite rd 2008-02-08 09:22:30 -08:00
loop.c Allow auto-destruction of loop devices 2008-02-06 10:41:01 -08:00
Makefile rewrite rd 2008-02-08 09:22:30 -08:00
nbd.c blk_end_request: changing nbd (take 4) 2008-01-28 10:36:37 +01:00
pktcdvd.c fix ! versus & precedence in various places 2008-02-06 10:40:59 -08:00
ps2esdi.c [BLOCK] Get rid of request_queue_t typedef 2007-07-24 09:28:11 +02:00
ps3disk.c blk_end_request: changing ps3disk (take 4) 2008-01-28 10:36:38 +01:00
smart1,2.h
sunvdc.c block/sunvdc.c:print_version() must be __devinit 2008-02-01 09:26:32 +01:00
swim3.c [BLOCK] Get rid of request_queue_t typedef 2007-07-24 09:28:11 +02:00
sx8.c blk_end_request: changing sx8 (take 4) 2008-01-28 10:36:42 +01:00
ub.c USB: Remove unnecessary zeroing from ub 2008-02-01 14:34:47 -08:00
umem.c Cleanup umem driver: fix most checkpatch warnings, conform to kernel 2007-12-18 08:29:28 +01:00
umem.h drivers/block/umem: trim trailing whitespace 2007-10-10 09:25:59 +02:00
viodasd.c blk_end_request: changing viodasd (take 4) 2008-01-28 10:36:44 +01:00
virtio_blk.c virtio_blk: implement naming for vda-vdz,vdaa-vdzz,vdaaa-vdzzz 2008-02-04 23:50:11 +11:00
xd.c [BLOCK] Get rid of request_queue_t typedef 2007-07-24 09:28:11 +02:00
xd.h [BLOCK] Get rid of request_queue_t typedef 2007-07-24 09:28:11 +02:00
xen-blkfront.c blk_end_request: changing xen-blkfront (take 4) 2008-01-28 10:36:46 +01:00
xsysace.c [POWERPC] Xilinx: Update compatible to use values generated by BSP generator. 2008-02-06 10:23:21 -07:00
z2ram.c [BLOCK] Get rid of request_queue_t typedef 2007-07-24 09:28:11 +02:00