Refactor VFS shared operations and remove unused legacy storage wrappers

This commit is contained in:
Aaron committed 2026-10-31 20:46:48 +00:00
1 parent c28b9dd77f
commit d318eca262
3 files changed
+151 -292

No files matched your search

+1 -10
View File
@@ -14,7 +14,7 @@ The I/O model operates as follows:
- `storage_read` / `storage_write` are convenience wrappers that build a stack-local `TIORequest` and call `submit_io_wait`.
- `storage_read_async` / `storage_write_async` build and submit a request with a caller-supplied callback, returning immediately.
Legacy `storage_read_legacy` / `storage_write_legacy` procedure wrappers are retained for callers not yet migrated to the function-returning API.
Blocking callers use `storage_read` / `storage_write` and check the returned `TError`.
## Dependencies
@@ -205,15 +205,6 @@ function storage_write_async(device : PStorage_Device; addr : uint32; sectors :
Non-blocking write. Analogous to `storage_read_async`.
### storage_read_legacy / storage_write_legacy
```pascal
procedure storage_read_legacy(device : PStorage_Device; addr : uint32; sectors : uint32; buffer : puint32);
procedure storage_write_legacy(device : PStorage_Device; addr : uint32; sectors : uint32; buffer : puint32);
```
Drop-in procedure replacements for callers using the old void-returning API. Forward to `storage_read` / `storage_write` and discard the error code. Marked for removal once all callers are migrated.
## Notes
- `dispatch_next` is an internal procedure called with interrupts disabled. It dequeues the head of the CFIFO, allocates a heap copy via `ioreq_copy` (for ISR safety), and invokes the appropriate `dispatchRead` or `dispatchWrite` on the device. If neither dispatch pointer is set, the request is failed with `eDeviceNotFound`.