* Allow different data offset setting for detached header.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@576 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Milan Broz
2011-07-20 17:39:38 +00:00
parent f7f9e291f4
commit f80b506b65
10 changed files with 93 additions and 32 deletions

View File

@@ -336,6 +336,21 @@ int device_ready(struct crypt_device *cd, const char *device, int mode)
return r;
}
int device_size(const char *device, uint64_t *size)
{
int devfd, r = 0;
devfd = open(device, O_RDONLY);
if(devfd == -1)
return -EINVAL;
if (ioctl(devfd, BLKGETSIZE64, size) < 0)
r = -EINVAL;
close(devfd);
return r;
}
static int get_device_infos(const char *device, enum devcheck device_check,
int *readonly, uint64_t *size)
{