mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
vfs: properly sync metadata
This commit is contained in:
@@ -136,6 +136,21 @@ int vfs_register(vfsops_t *ops, char *name) {
|
||||
return hashtable_set(&fstable, ops, name, strlen(name), true);
|
||||
}
|
||||
|
||||
int vfs_sync(void) {
|
||||
int error = mm_cache_sync();
|
||||
|
||||
MUTEX_ACQUIRE(&listlock);
|
||||
for (vfs_t *vfs = vfslist; vfs; vfs = vfs->next) {
|
||||
if (vfs->ops->sync) {
|
||||
int e = VFS_SYNC(vfs);
|
||||
if (error == 0)
|
||||
error = e;
|
||||
}
|
||||
}
|
||||
MUTEX_RELEASE(&listlock);
|
||||
return error;
|
||||
}
|
||||
|
||||
void vfs_inactive(vnode_t *vnode) {
|
||||
if (vnode->type == V_TYPE_SOCKET && vnode->socketbinding) {
|
||||
localsock_leavebinding(vnode);
|
||||
|
||||
Reference in New Issue
Block a user