1
0
Fork 0

ROMFS: Advance destination buffer pointer when reading from a blockdev

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@redhat.com>
Tested-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
hifive-unleashed-5.1
David Howells 2009-04-23 16:41:18 +01:00 committed by Linus Torvalds
parent 84baf74bf2
commit 4b2b0b9753
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}