vfs: leave handling of VOP_LOCK and VOP_UNLOCK to each filesystem

This commit is contained in:
Matheus
2024-08-26 18:45:17 -03:00
parent 6066dc86ab
commit da150523ba
6 changed files with 133 additions and 55 deletions
+13 -1
View File
@@ -520,6 +520,16 @@ static int tmpfs_sync(vnode_t *node) {
return 0;
}
static int tmpfs_lock(vnode_t *node) {
MUTEX_ACQUIRE(&node->lock, false);
return 0;
}
static int tmpfs_unlock(vnode_t *node) {
MUTEX_RELEASE(&node->lock);
return 0;
}
static vfsops_t vfsops = {
.mount = tmpfs_mount,
.root = tmpfs_root
@@ -548,7 +558,9 @@ static vops_t vnops = {
.rename = tmpfs_rename,
.getpage = tmpfs_getpage,
.putpage = tmpfs_putpage,
.sync = tmpfs_sync
.sync = tmpfs_sync,
.lock = tmpfs_lock,
.unlock = tmpfs_unlock
};
static tmpfsnode_t *newnode(vfs_t *vfs, int type) {