Lock VFS mountpoint access for ops

This commit is contained in:
2026-02-12 15:51:59 +01:00
parent f07e920270
commit fb54483e42

View File

@@ -80,7 +80,13 @@ int vfs_describe (const char* mountpoint, const char* path, struct fs_desc_buffe
if (vmp == NULL)
return -VFS_NOT_FOUND;
return vmp->driver_ops.describe (vmp, path, desc);
spin_lock (&vmp->lock);
int ret = vmp->driver_ops.describe (vmp, path, desc);
spin_unlock (&vmp->lock);
return ret;
}
int vfs_read (const char* mountpoint, const char* path, uint8_t* buffer, size_t off, size_t size) {
@@ -89,7 +95,13 @@ int vfs_read (const char* mountpoint, const char* path, uint8_t* buffer, size_t
if (vmp == NULL)
return -VFS_NOT_FOUND;
return vmp->driver_ops.read (vmp, path, buffer, off, size);
spin_lock (&vmp->lock);
int ret = vmp->driver_ops.read (vmp, path, buffer, off, size);
spin_unlock (&vmp->lock);
return ret;
}
void vfs_init (void) {