Ok, rev. 2, slightly cleaned up:
--- orig/drivers/block/rd.c Wed May 29 21:40:26 2002
+++ linux/drivers/block/rd.c Tue Jun 4 09:44:21 2002
@@ -144,6 +144,7 @@
{
struct address_space * mapping;
unsigned long index;
+ unsigned int vec_offset;
int offset, size, err;
err = 0;
@@ -152,6 +153,7 @@
index = sector >> (PAGE_CACHE_SHIFT - 9);
offset = (sector << 9) & ~PAGE_CACHE_MASK;
size = vec->bv_len;
+ vec_offset = vec->bv_offset;
do {
int count;
@@ -186,13 +188,14 @@
if (rw == READ) {
src = kmap(page);
src += offset;
- dst = kmap(vec->bv_page) + vec->bv_offset;
+ dst = kmap(vec->bv_page) + vec_offset;
} else {
dst = kmap(page);
dst += offset;
- src = kmap(vec->bv_page) + vec->bv_offset;
+ src = kmap(vec->bv_page) + vec_offset;
}
offset = 0;
+ vec_offset += count;
memcpy(dst, src, count);
-- Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/