Commit 21622676 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] UML: 64-bit cleanups

This makes a bunch of 64-bit cleanups exposed by x86_64.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6b854cd8
...@@ -21,11 +21,12 @@ extern int file_reader(__u64 offset, char *buf, int len, void *arg); ...@@ -21,11 +21,12 @@ extern int file_reader(__u64 offset, char *buf, int len, void *arg);
extern int read_cow_header(int (*reader)(__u64, char *, int, void *), extern int read_cow_header(int (*reader)(__u64, char *, int, void *),
void *arg, __u32 *version_out, void *arg, __u32 *version_out,
char **backing_file_out, time_t *mtime_out, char **backing_file_out, time_t *mtime_out,
__u64 *size_out, int *sectorsize_out, unsigned long long *size_out, int *sectorsize_out,
__u32 *align_out, int *bitmap_offset_out); __u32 *align_out, int *bitmap_offset_out);
extern int write_cow_header(char *cow_file, int fd, char *backing_file, extern int write_cow_header(char *cow_file, int fd, char *backing_file,
int sectorsize, int alignment, long long *size); int sectorsize, int alignment,
unsigned long long *size);
extern void cow_sizes(int version, __u64 size, int sectorsize, int align, extern void cow_sizes(int version, __u64 size, int sectorsize, int align,
int bitmap_offset, unsigned long *bitmap_len_out, int bitmap_offset, unsigned long *bitmap_len_out,
......
...@@ -23,12 +23,12 @@ static inline char *cow_strdup(char *str) ...@@ -23,12 +23,12 @@ static inline char *cow_strdup(char *str)
return(uml_strdup(str)); return(uml_strdup(str));
} }
static inline int cow_seek_file(int fd, __u64 offset) static inline int cow_seek_file(int fd, unsigned long long offset)
{ {
return(os_seek_file(fd, offset)); return(os_seek_file(fd, offset));
} }
static inline int cow_file_size(char *file, __u64 *size_out) static inline int cow_file_size(char *file, unsigned long long *size_out)
{ {
return(os_file_size(file, size_out)); return(os_file_size(file, size_out));
} }
......
...@@ -159,7 +159,7 @@ static int absolutize(char *to, int size, char *from) ...@@ -159,7 +159,7 @@ static int absolutize(char *to, int size, char *from)
} }
int write_cow_header(char *cow_file, int fd, char *backing_file, int write_cow_header(char *cow_file, int fd, char *backing_file,
int sectorsize, int alignment, long long *size) int sectorsize, int alignment, unsigned long long *size)
{ {
struct cow_header_v3 *header; struct cow_header_v3 *header;
unsigned long modtime; unsigned long modtime;
...@@ -236,7 +236,7 @@ int file_reader(__u64 offset, char *buf, int len, void *arg) ...@@ -236,7 +236,7 @@ int file_reader(__u64 offset, char *buf, int len, void *arg)
int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg,
__u32 *version_out, char **backing_file_out, __u32 *version_out, char **backing_file_out,
time_t *mtime_out, __u64 *size_out, time_t *mtime_out, unsigned long long *size_out,
int *sectorsize_out, __u32 *align_out, int *sectorsize_out, __u32 *align_out,
int *bitmap_offset_out) int *bitmap_offset_out)
{ {
...@@ -329,7 +329,7 @@ int init_cow_file(int fd, char *cow_file, char *backing_file, int sectorsize, ...@@ -329,7 +329,7 @@ int init_cow_file(int fd, char *cow_file, char *backing_file, int sectorsize,
int alignment, int *bitmap_offset_out, int alignment, int *bitmap_offset_out,
unsigned long *bitmap_len_out, int *data_offset_out) unsigned long *bitmap_len_out, int *data_offset_out)
{ {
__u64 size, offset; unsigned long long size, offset;
char zero = 0; char zero = 0;
int err; int err;
......
...@@ -73,11 +73,12 @@ DECLARE_WORK(mconsole_work, mc_work_proc, NULL); ...@@ -73,11 +73,12 @@ DECLARE_WORK(mconsole_work, mc_work_proc, NULL);
static irqreturn_t mconsole_interrupt(int irq, void *dev_id, static irqreturn_t mconsole_interrupt(int irq, void *dev_id,
struct pt_regs *regs) struct pt_regs *regs)
{ {
int fd; /* long to avoid size mismatch warnings from gcc */
long fd;
struct mconsole_entry *new; struct mconsole_entry *new;
struct mc_request req; struct mc_request req;
fd = (int) dev_id; fd = (long) dev_id;
while (mconsole_get_request(fd, &req)){ while (mconsole_get_request(fd, &req)){
if(req.cmd->context == MCONSOLE_INTR) if(req.cmd->context == MCONSOLE_INTR)
(*req.cmd->handler)(&req); (*req.cmd->handler)(&req);
...@@ -457,7 +458,9 @@ static char *notify_socket = NULL; ...@@ -457,7 +458,9 @@ static char *notify_socket = NULL;
int mconsole_init(void) int mconsole_init(void)
{ {
int err, sock; /* long to avoid size mismatch warnings from gcc */
long sock;
int err;
char file[256]; char file[256];
if(umid_file_name("mconsole", file, sizeof(file))) return(-1); if(umid_file_name("mconsole", file, sizeof(file))) return(-1);
......
...@@ -107,7 +107,7 @@ int open_ubd_file(char *file, struct openflags *openflags, ...@@ -107,7 +107,7 @@ int open_ubd_file(char *file, struct openflags *openflags,
int *create_cow_out) int *create_cow_out)
{ {
time_t mtime; time_t mtime;
__u64 size; unsigned long long size;
__u32 version, align; __u32 version, align;
char *backing_file; char *backing_file;
int fd, err, sectorsize, same, mode = 0644; int fd, err, sectorsize, same, mode = 0644;
......
...@@ -105,7 +105,7 @@ static inline int clear_user(void *mem, int len) ...@@ -105,7 +105,7 @@ static inline int clear_user(void *mem, int len)
* On exception, returns 0. * On exception, returns 0.
* If the string is too long, returns a value greater than @n. * If the string is too long, returns a value greater than @n.
*/ */
static inline int strnlen_user(const void *str, int len) static inline int strnlen_user(const void *str, long len)
{ {
return(CHOOSE_MODE_PROC(strnlen_user_tt, strnlen_user_skas, str, len)); return(CHOOSE_MODE_PROC(strnlen_user_tt, strnlen_user_skas, str, len));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment