Go to the source code of this file.
◆ loopback_disk_access_register()
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.
- Parameters
-
ctx | Preallocated context structure |
file_path | Path to backing file |
disk_access_name | Name of the created disk access (for disk_access_*() functions) |
- Return values
-
0 | on success; |
<0 | negative errno code, depending on file system of the backing file. |
◆ loopback_disk_access_unregister()
Unregister a previously registered loopback disk device.
Cleans up resources used by the disk access.
- Parameters
-
- Return values
-
0 | on success; |
<0 | negative errno code, depending on file system of the backing file. |