mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Add support for larger block size in loop.
This commit is contained in:
@@ -773,10 +773,10 @@ static int device_internal_prepare(struct crypt_device *cd, struct device *devic
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
log_dbg(cd, "Allocating a free loop device.");
|
||||
log_dbg(cd, "Allocating a free loop device (block size: %zu).", SECTOR_SIZE);
|
||||
|
||||
/* Keep the loop open, detached on last close. */
|
||||
loop_fd = crypt_loop_attach(&loop_device, device->path, 0, 1, &readonly);
|
||||
loop_fd = crypt_loop_attach(&loop_device, device->path, 0, 1, &readonly, SECTOR_SIZE);
|
||||
if (loop_fd == -1) {
|
||||
log_err(cd, _("Attaching loopback device failed "
|
||||
"(loop device with autoclear flag is required)."));
|
||||
@@ -795,6 +795,8 @@ static int device_internal_prepare(struct crypt_device *cd, struct device *devic
|
||||
return r;
|
||||
}
|
||||
|
||||
log_dbg(cd, "Attached loop device block size is %zu bytes.", device_block_size_fd(loop_fd, NULL));
|
||||
|
||||
device->loop_fd = loop_fd;
|
||||
device->file_path = file_path;
|
||||
device->init_done = 1;
|
||||
|
||||
Reference in New Issue
Block a user