Updated: April 19, 2023 |
Get the status of migration in the filesystem
#include <fs_crypto_api.h> #include <sys/fs_crypto.h> int fs_crypto_migrate_status( const char *path, migrate_status_t *status, int *preply );
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:
This function can also return any of the errors indicated by devctl() or open().
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |