fs_crypto_migrate_status()
Get the status of migration in the filesystem
Synopsis:
#include <fs_crypto_api.h>
#include <sys/fs_crypto.h>
int fs_crypto_migrate_status( const char *path,
migrate_status_t *status,
int *preply );
Arguments:
- path
- The path to the filesystem's mountpoint.
- status
- A pointer to a migrate_status_t structure where the function can store the status information; see below.
- preply
- A pointer to a location where the function can store additional success or error information.
Library:
libfscrypto
Use the -l fscrypto option to qcc to link against this library.
Description:
The fs_crypto_migrate_status() function queries the status of migration within the filesystem.
The migrate_status_t structure is defined as follows:
typedef struct migrate_status_s {
uint32_t s_version; /* The version of this structure. */
migrate_state_t s_state; /* The current state of migration. */
uint64_t s_remaining; /* Number of bytes to be migrated. */
uint64_t s_migrate_inode; /* Inode # of last migration unit. */
int s_migrate_error; /* Error of last migration unit. */
/* Version 1 END */
} migrate_status_t;
You must specify the version of the status information in the provided status structure's s_version field. The status provided will match that of the version specified. Any fields in the structure that are not valid for the version provided will contain zeroed data and are invalid.
You can inject an error into the migration process by specifying an error value in the s_migrate_error field of the status structure. If this field contains any value other than EOK (0), that error is propagated into the migration process, detected on the next state machine transition. The error won't be reported by fs_crypto_migrate_status() until the next state machine transition occurs. If no error is to be injected, set the s_migrate_error field to EOK.
This function sets the variable pointed to by preply to one of the following values:
- FS_CRYPTO_REPLY_COMPLETE
- The status information was successfully obtained.
- FS_CRYPTO_REPLY_INVALID
- The command wasn't completed successfully.
Returns:
- EOK
- Success.
- EINVAL
- Invalid arguments.
- ENOMEM
- Insufficient free memory.
This function can also return any of the errors indicated by devctl() or open().
Classification:
Safety: | |
---|---|
Cancellation point | Yes |
Signal handler | No |
Thread | Yes |