Lock VFS mountpoint access for ops
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user