mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Report data sync errors from storage wrapper.
This commit is contained in:
@@ -383,14 +383,14 @@ void crypt_storage_wrapper_destroy(struct crypt_storage_wrapper *cw)
|
||||
free(cw);
|
||||
}
|
||||
|
||||
void crypt_storage_wrapper_datasync(const struct crypt_storage_wrapper *cw)
|
||||
int crypt_storage_wrapper_datasync(const struct crypt_storage_wrapper *cw)
|
||||
{
|
||||
if (!cw)
|
||||
return;
|
||||
return -EINVAL;
|
||||
if (cw->type == DMCRYPT)
|
||||
fdatasync(cw->u.dm.dmcrypt_fd);
|
||||
return fdatasync(cw->u.dm.dmcrypt_fd);
|
||||
else
|
||||
fdatasync(cw->dev_fd);
|
||||
return fdatasync(cw->dev_fd);
|
||||
}
|
||||
|
||||
crypt_storage_wrapper_type crypt_storage_wrapper_get_type(const struct crypt_storage_wrapper *cw)
|
||||
|
||||
@@ -65,7 +65,7 @@ ssize_t crypt_storage_wrapper_encrypt_write(struct crypt_storage_wrapper *cw,
|
||||
ssize_t crypt_storage_wrapper_encrypt(struct crypt_storage_wrapper *cw,
|
||||
off_t offset, void *buffer, size_t buffer_length);
|
||||
|
||||
void crypt_storage_wrapper_datasync(const struct crypt_storage_wrapper *cw);
|
||||
int crypt_storage_wrapper_datasync(const struct crypt_storage_wrapper *cw);
|
||||
|
||||
crypt_storage_wrapper_type crypt_storage_wrapper_get_type(const struct crypt_storage_wrapper *cw);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user