vfs: properly sync metadata

This commit is contained in:
Matheus
2026-09-14 10:05:18 -03:00
parent f0dc54e027
commit 3eaca91ff1
5 changed files with 26 additions and 2 deletions
+15
View File
@@ -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);