X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/a7384053efe345d199440720b437a28e91058ff3..cb089e17fcc6bd4823bd919cce2b9e62631cd570:/lunaix-os/kernel/fs/pcache.c?ds=sidebyside diff --git a/lunaix-os/kernel/fs/pcache.c b/lunaix-os/kernel/fs/pcache.c index 0094ec4..c27f78b 100644 --- a/lunaix-os/kernel/fs/pcache.c +++ b/lunaix-os/kernel/fs/pcache.c @@ -76,7 +76,7 @@ pcache_set_dirty(struct pcache* pcache, struct pcache_pg* pg) } } -struct pcache_pg* +int pcache_get_page(struct pcache* pcache, uint32_t index, uint32_t* offset, @@ -140,7 +140,7 @@ pcache_read(struct v_inode* inode, void* data, uint32_t len, uint32_t fpos) 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; }