bcache should support reads shorter than sector size

dosfs (fat file systems) can perform reads of partial sectors
bcache should support such reads.

Submitted by:	Toomas Soome <tsoome@me.com>
Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D6475
This commit is contained in:
Allan Jude 2016-07-30 17:45:56 +00:00
parent a8ec75016f
commit 6bf8d16009

View file

@ -303,7 +303,9 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t offset,
break;
}
size = i * bcache_blksize;
if (size > i * bcache_blksize)
size = i * bcache_blksize;
if (size != 0) {
bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset,
buf, size);