Skip to content

Commit 2dfab55

Browse files
committed
Make offset in loop device helper uint64_t
It is actually never used other than for 0, but it should be correct.
1 parent 99d3edd commit 2dfab55

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/utils_loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static char *crypt_loop_get_device(void)
102102
return strdup(dev);
103103
}
104104

105-
int crypt_loop_attach(char **loop, const char *file, int offset,
105+
int crypt_loop_attach(char **loop, const char *file, uint64_t offset,
106106
int autoclear, int *readonly, size_t blocksize)
107107
{
108108
struct loop_config config = {0};

lib/utils_loop.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
#ifndef _UTILS_LOOP_H
1010
#define _UTILS_LOOP_H
1111

12+
#include <stdint.h>
13+
1214
/* loopback device helpers */
1315

1416
char *crypt_loop_backing_file(const char *loop);
1517
int crypt_loop_device(const char *loop);
16-
int crypt_loop_attach(char **loop, const char *file, int offset,
18+
int crypt_loop_attach(char **loop, const char *file, uint64_t offset,
1719
int autoclear, int *readonly, size_t blocksize);
1820
int crypt_loop_detach(const char *loop);
1921
int crypt_loop_resize(const char *loop);

tests/api_test.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void xlog(const char *msg, const char *tst, const char *func, int line, const ch
139139

140140
/* loop helpers */
141141
int loop_device(const char *loop);
142-
int loop_attach(char **loop, const char *file, int offset,
142+
int loop_attach(char **loop, const char *file, uint64_t offset,
143143
int autoclear, int *readonly);
144144
int loop_detach(const char *loop);
145145

tests/test_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ static char *crypt_loop_get_device(void)
776776
return strdup(dev);
777777
}
778778

779-
int loop_attach(char **loop, const char *file, int offset,
779+
int loop_attach(char **loop, const char *file, uint64_t offset,
780780
int autoclear, int *readonly)
781781
{
782782
struct loop_config config = {0};

0 commit comments

Comments
 (0)