New device access backend.

Allocate loop device late (only when real block device needed).
Rework underlying device/file access functions.
Move all device (and ioctl) access to utils_device.c.

Allows using file where appropriate without allocation loop device.
This commit is contained in:
Milan Broz
2012-08-12 21:56:09 +02:00
parent 0c1efd1f8a
commit 65f975655c
17 changed files with 745 additions and 728 deletions

View File

@@ -196,7 +196,7 @@ int LOOPAES_activate(struct crypt_device *cd,
.uuid = crypt_get_uuid(cd),
.size = 0,
.flags = flags,
.data_device = crypt_get_device_name(cd),
.data_device = crypt_data_device(cd),
.u.crypt = {
.cipher = NULL,
.vk = vk,
@@ -205,9 +205,8 @@ int LOOPAES_activate(struct crypt_device *cd,
}
};
r = device_check_and_adjust(cd, dmd.data_device, DEV_EXCL,
&dmd.size, &dmd.u.crypt.offset, &flags);
r = device_block_adjust(cd, dmd.data_device, DEV_EXCL,
dmd.u.crypt.offset, &dmd.size, &dmd.flags);
if (r)
return r;