}
}
-struct pcache_pg*
+int
pcache_get_page(struct pcache* pcache,
uint32_t index,
uint32_t* offset,
errno = inode->default_fops->read(inode, pg->pg, PG_SIZE, pg->fpos);
if (errno >= 0 && errno < PG_SIZE) {
// EOF
- len = buf_off + errno;
+ len = MIN(len, buf_off + errno);
} else if (errno < 0) {
break;
}