vfs: vfs_iscacheable

This commit is contained in:
Matheus
2024-09-04 21:33:59 -03:00
parent be27fb6f3b
commit ee254a81e9
4 changed files with 22 additions and 13 deletions
+10
View File
@@ -270,4 +270,14 @@ static inline mode_t vfs_getsystemtype(int type) {
}
}
static inline bool vfs_iscacheable(vnode_t *vnode) {
int type = vnode->type;
// vnodes will be cacheable if:
// - the vnode is a regular or block device
// AND
// - the filesystem implementation exposes the VOP_*PAGE operations.
return (type == V_TYPE_REGULAR || type == V_TYPE_BLKDEV) && vnode->ops->putpage && vnode->ops->getpage;
}
#endif