mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-18 14:20:09 +01:00
Add reencryption progress function.
This commit is contained in:
@@ -103,6 +103,7 @@ void tools_clear_line(void);
|
|||||||
void tools_time_progress(uint64_t device_size, uint64_t bytes,
|
void tools_time_progress(uint64_t device_size, uint64_t bytes,
|
||||||
struct timeval *start_time, struct timeval *end_time);
|
struct timeval *start_time, struct timeval *end_time);
|
||||||
int tools_wipe_progress(uint64_t size, uint64_t offset, void *usrptr);
|
int tools_wipe_progress(uint64_t size, uint64_t offset, void *usrptr);
|
||||||
|
int tools_reencrypt_progress(uint64_t size, uint64_t offset, void *usrptr);
|
||||||
|
|
||||||
int tools_read_mk(const char *file, char **key, int keysize);
|
int tools_read_mk(const char *file, char **key, int keysize);
|
||||||
int tools_write_mk(const char *file, const char *key, int keysize);
|
int tools_write_mk(const char *file, const char *key, int keysize);
|
||||||
|
|||||||
@@ -592,3 +592,19 @@ int tools_is_stdin(const char *key_file)
|
|||||||
|
|
||||||
return strcmp(key_file, "-") ? 0 : 1;
|
return strcmp(key_file, "-") ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tools_reencrypt_progress(uint64_t size, uint64_t offset, void *usrptr)
|
||||||
|
{
|
||||||
|
static struct timeval start_time = {}, end_time = {};
|
||||||
|
int r = 0;
|
||||||
|
|
||||||
|
tools_time_progress(size, offset, &start_time, &end_time);
|
||||||
|
|
||||||
|
check_signal(&r);
|
||||||
|
if (r) {
|
||||||
|
tools_clear_line();
|
||||||
|
log_err("\nReencrypt interrupted.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user