Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
|
4.0.0 |
Go to the source code of this file.
Data Structures | |
struct | loopback_disk_access |
Context object for an active loopback disk device. More... | |
Functions | |
int | loopback_disk_access_register (struct loopback_disk_access *ctx, const char *file_path, const char *disk_access_name) |
Register a loopback disk device. | |
int | loopback_disk_access_unregister (struct loopback_disk_access *ctx) |
Unregister a previously registered loopback disk device. | |
int loopback_disk_access_register | ( | struct loopback_disk_access * | ctx, |
const char * | file_path, | ||
const char * | disk_access_name ) |
Register a loopback disk device.
Registers a new loopback disk deviced backed by a file at the specified path.
All
parameters (ctx, file_path and disk_access_name) must point to data that will remain valid until the disk access is unregistered. This is trivially true for file_path and disk_access_name if they are string literals, but care must be taken for ctx, as well as for file_path and disk_access_name if they are constructed dynamically.
ctx | Preallocated context structure |
file_path | Path to backing file |
disk_access_name | Name of the created disk access (for disk_access_*() functions) |
0 | on success; |
<0 | negative errno code, depending on file system of the backing file. |
int loopback_disk_access_unregister | ( | struct loopback_disk_access * | ctx | ) |
Unregister a previously registered loopback disk device.
Cleans up resources used by the disk access.
ctx | Context structure previously passed to a successful invocation of loopback_disk_access_register() |
0 | on success; |
<0 | negative errno code, depending on file system of the backing file. |