[PATCH 2/2] ROMFS: Advance destination buffer pointer when readingfrom a blockdev

From: David Howells
Date: Thu Apr 23 2009 - 11:43:40 EST


RomFS should advance the destination buffer pointer when reading data from a
blockdev source (the data may be split over multiple blocks, each requiring its
own sb_read() call). Without this, all the data is copied to the beginning of
the output buffer.

Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
Tested-by: Michal Simek <monstr@xxxxxxxxx>
---

fs/romfs/storage.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/fs/romfs/storage.c b/fs/romfs/storage.c
index 66ce9dd..b3208ad 100644
--- a/fs/romfs/storage.c
+++ b/fs/romfs/storage.c
@@ -120,6 +120,7 @@ static int romfs_blk_read(struct super_block *sb, unsigned long pos,
return -EIO;
memcpy(buf, bh->b_data + offset, segment);
brelse(bh);
+ buf += segment;
buflen -= segment;
pos += segment;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/