|
CardSight 0.1.0
C API reference for the CardSight firmware and application
|
Public interface of the lazy exFAT proxy view. More...
Go to the source code of this file.
Data Structures | |
| struct | storage_proxy_lazy_layout |
| Geometry and reservation regions of a running lazy view. More... | |
Functions | |
| int | storage_proxy_lazy_start (const char *source_disk, uint32_t selected_partitions) |
| Start the lazy view over selected partitions of a disk. | |
| void | storage_proxy_lazy_stop (void) |
| Stop the lazy view and release everything it holds. | |
| bool | storage_proxy_lazy_running (void) |
| Report whether the lazy view is registered as a block device. | |
| const char * | storage_proxy_lazy_device_name (void) |
| Return the block device name the lazy view is registered under. | |
| int | storage_proxy_lazy_layout (struct storage_proxy_lazy_layout *layout) |
| Copy the geometry and reservation regions of the running view. | |
| size_t | storage_proxy_lazy_directory_count (void) |
| Return the number of source directories the view has indexed. | |
| uint32_t | storage_proxy_lazy_cached_entries (void) |
| Return the number of directory entries currently cached. | |
| uint32_t | storage_proxy_lazy_cached_bytes (void) |
| Return the number of bytes the directory entry caches currently hold. | |
| bool | storage_proxy_lazy_truncated (void) |
| Report whether any index limit made part of the source tree invisible. | |
| uint32_t | storage_proxy_lazy_cache_evictions (void) |
| Return the number of entry caches evicted since start. | |
| void | storage_proxy_lazy_set_progress (void(*callback)(void *context, uint32_t entries, const char *path), void *context) |
| Install a directory indexing progress callback. | |
| void | storage_proxy_lazy_cancel (void) |
| Ask a running directory count or load to stop at its next check. | |
| void | storage_proxy_lazy_cache_drop (void) |
| Drop every cached directory entry, keeping extents and the overlay. | |
Public interface of the lazy exFAT proxy view.
The lazy engine synthesises a second exFAT volume, exposed as block device cardview1, whose partition folders are backed by the mounted source file systems. Unlike the eager engine it indexes a source directory only when the host first reads it, keeps those indexes in a bounded LRU cache, and never changes the allocation bitmap after the volume is registered. The view is read-write: host changes go back to the source volumes through a bounded per-view overlay and pending-data table.
| void storage_proxy_lazy_cache_drop | ( | void | ) |
Drop every cached directory entry, keeping extents and the overlay.
A test or diagnostic helper: the next read reloads each directory from the source readdir result merged with the overlay, which is what proves host-created entries survive cache eviction.
| uint32_t storage_proxy_lazy_cache_evictions | ( | void | ) |
Return the number of entry caches evicted since start.
| uint32_t storage_proxy_lazy_cached_bytes | ( | void | ) |
Return the number of bytes the directory entry caches currently hold.
| uint32_t storage_proxy_lazy_cached_entries | ( | void | ) |
Return the number of directory entries currently cached.
| void storage_proxy_lazy_cancel | ( | void | ) |
Ask a running directory count or load to stop at its next check.
Safe to call from any context, including from a progress callback. The interrupted read returns -ECANCELED and leaves no partial cache behind; a later start clears the flag.
| const char * storage_proxy_lazy_device_name | ( | void | ) |
Return the block device name the lazy view is registered under.
| size_t storage_proxy_lazy_directory_count | ( | void | ) |
Return the number of source directories the view has indexed.
| int storage_proxy_lazy_layout | ( | struct storage_proxy_lazy_layout * | layout | ) |
Copy the geometry and reservation regions of the running view.
| [out] | layout | Receives the layout. |
| bool storage_proxy_lazy_running | ( | void | ) |
Report whether the lazy view is registered as a block device.
cardview1 exists. | void storage_proxy_lazy_set_progress | ( | void(* | callback )(void *context, uint32_t entries, const char *path), |
| void * | context ) |
Install a directory indexing progress callback.
The callback runs under the view lock while a source directory is counted or loaded, once every 64 entries, so it must stay short and must not call any other function of this interface except storage_proxy_lazy_cancel(). Set the callback before starting the view.
| [in] | callback | Receives the entry count and the source directory path, or NULL to remove the callback. |
| [in] | context | Opaque pointer passed to callback. |
| int storage_proxy_lazy_start | ( | const char * | source_disk, |
| uint32_t | selected_partitions ) |
Start the lazy view over selected partitions of a disk.
Probes and mounts the selected partitions, sizes one reservation region per partition, builds the boot region, FAT, allocation bitmap, up-case table and root directory, marks every reservation used, and registers cardview1. No source directory is indexed here.
| [in] | source_disk | Whole-disk block device name. |
| [in] | selected_partitions | Bit mask of partitions; bit zero is partition one. |
| bool storage_proxy_lazy_truncated | ( | void | ) |
Report whether any index limit made part of the source tree invisible.