提交 4b2b0b97 编写于 作者: D David Howells 提交者: Linus Torvalds

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: NDavid Howells <dhowells@redhat.com>
Tested-by: NMichal Simek <monstr@monstr.eu>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 84baf74b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册