mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
vfs: leave handling of VOP_LOCK and VOP_UNLOCK to each filesystem
This commit is contained in:
+13
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user