mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
vfs: vfs_iscacheable
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user