libblock ramdisk.c

Brett Swimley brett.swimley at
Thu Apr 10 22:07:57 UTC 2003

Hello all -

I'm implementing a block device driver for a smartmedia card and wanted to use
the ramdisk.c function as a reference.

I believe I understand the concept of how the driver interacts with the block
device read and write requests, but it seems to me that there is an error in
both ramdisk_read and ramdisk_write.

The "from" and "to" locations are calculated as the start of the block within
the ram that data is to be transferred from/to for reads and writes
respectively.  However, within the loops, the "from" and "to" locations are
never updated.  Shouldn't they be updated as:

from += rd->block_size;


to += rd->block_size;

within the for loops in the ramdisk_read and ramdisk_write routines, respectively?

It appears to me upon examination of the bdbuf.c source that only one
scatter/gather buffer is ever being used, but I bring this issue up for

Any comments would be appreciated.


Brett Swimley

Brett Swimley
Advanced Electronic Designs
406-585-8892 / 406-585-8893 (fax)
brett.swimley at

More information about the users mailing list