Fix two mem leaks in crypt_init_by_name_and_header().
[platform/upstream/cryptsetup.git] / lib / internal.h
index 606c234..d574911 100644 (file)
@@ -15,6 +15,9 @@
 #include "utils_loop.h"
 #include "utils_dm.h"
 
+/* to silent gcc -Wcast-qual for const cast */
+#define CONST_CAST(x) (x)(uintptr_t)
+
 #define SECTOR_SHIFT           9
 #define SECTOR_SIZE            (1 << SECTOR_SHIFT)
 #define DEFAULT_DISK_ALIGNMENT 1048576 /* 1MiB */
@@ -55,6 +58,7 @@ ssize_t write_blockwise(int fd, void *buf, size_t count);
 ssize_t read_blockwise(int fd, void *_buf, size_t count);
 ssize_t write_lseek_blockwise(int fd, char *buf, size_t count, off_t offset);
 int device_ready(struct crypt_device *cd, const char *device, int mode);
+int device_size(const char *device, uint64_t *size);
 
 enum devcheck { DEV_OK = 0, DEV_EXCL = 1, DEV_SHARED = 2 };
 int device_check_and_adjust(struct crypt_device *cd,
@@ -98,7 +102,6 @@ int PLAIN_activate(struct crypt_device *cd,
                     const char *name,
                     struct volume_key *vk,
                     uint64_t size,
-                    uint64_t iv_offset,
                     uint32_t flags);
 
 #endif /* INTERNAL_H */