X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/fb2d2e17e3ffc4bddf944dc67a6d86fe9453bb5a..bc4c6e1218d6903b07c32b11ea7d3c82c463686e:/lunaix-os/kernel/fs/pcache.c diff --git a/lunaix-os/kernel/fs/pcache.c b/lunaix-os/kernel/fs/pcache.c index 9d883f9..0094ec4 100644 --- a/lunaix-os/kernel/fs/pcache.c +++ b/lunaix-os/kernel/fs/pcache.c @@ -137,7 +137,7 @@ pcache_read(struct v_inode* inode, void* data, uint32_t len, uint32_t fpos) } // Filling up the page - errno = inode->default_fops.read(inode, pg->pg, PG_SIZE, pg->fpos); + errno = inode->default_fops->read(inode, pg->pg, PG_SIZE, pg->fpos); if (errno >= 0 && errno < PG_SIZE) { // EOF len = buf_off + errno; @@ -175,7 +175,8 @@ pcache_commit(struct v_inode* inode, struct pcache_pg* page) return; } - int errno = inode->default_fops.write(inode, page->pg, PG_SIZE, page->fpos); + int errno = + inode->default_fops->write(inode, page->pg, PG_SIZE, page->fpos); if (!errno) { page->flags &= ~PCACHE_DIRTY; @@ -189,6 +190,10 @@ pcache_commit(struct v_inode* inode, struct pcache_pg* page) void pcache_commit_all(struct v_inode* inode) { + if (!inode->pg_cache) { + return; + } + struct pcache* cache = inode->pg_cache; struct pcache_pg *pos, *n;