]> git.hungrycats.org Git - linux/commitdiff
[PATCH] UML: 64-bit cleanups
authorJeff Dike <jdike@addtoit.com>
Tue, 11 Jan 2005 11:15:41 +0000 (03:15 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 11 Jan 2005 11:15:41 +0000 (03:15 -0800)
This makes a bunch of 64-bit cleanups exposed by x86_64.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/drivers/cow.h
arch/um/drivers/cow_sys.h
arch/um/drivers/cow_user.c
arch/um/drivers/mconsole_kern.c
arch/um/drivers/ubd_user.c
arch/um/include/um_uaccess.h

index 19517312aa863d69e5a76ea712fa0f04d3d729a8..4fcbe8b1b77e112767c3a144d6d08fbdf97768d3 100644 (file)
@@ -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 *),
                           void *arg, __u32 *version_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);
 
 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,
                      int bitmap_offset, unsigned long *bitmap_len_out,
index ce251f08305fe6bd82218ee477243eef04c3ffd3..c83fc5d68936d18e8bb97dff24c8d9541498b096 100644 (file)
@@ -23,12 +23,12 @@ static inline char *cow_strdup(char *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));
 }
 
-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));
 }
index 122664b6b16adaeb0699530e7f201c7c4a8faa87..c43425c1ee1f25b0aebcec53e76972f7cc781ce7 100644 (file)
@@ -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 sectorsize, int alignment, long long *size)
+                    int sectorsize, int alignment, unsigned long long *size)
 {
        struct cow_header_v3 *header;
        unsigned long modtime;
@@ -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,
                    __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 *bitmap_offset_out)
 {
@@ -329,7 +329,7 @@ int init_cow_file(int fd, char *cow_file, char *backing_file, int sectorsize,
                  int alignment, int *bitmap_offset_out,
                  unsigned long *bitmap_len_out, int *data_offset_out)
 {
-       __u64 size, offset;
+       unsigned long long size, offset;
        char zero = 0;
        int err;
 
index 0c87589c078134b385eefdb57721248fb8d3aae8..cb8c1ee24fc7654986f2e1660a09d3660abcb469 100644 (file)
@@ -73,11 +73,12 @@ DECLARE_WORK(mconsole_work, mc_work_proc, NULL);
 static irqreturn_t mconsole_interrupt(int irq, void *dev_id,
                                      struct pt_regs *regs)
 {
-       int fd;
+       /* long to avoid size mismatch warnings from gcc */
+       long fd;
        struct mconsole_entry *new;
        struct mc_request req;
 
-       fd = (int) dev_id;
+       fd = (long) dev_id;
        while (mconsole_get_request(fd, &req)){
                if(req.cmd->context == MCONSOLE_INTR)
                        (*req.cmd->handler)(&req);
@@ -457,7 +458,9 @@ static char *notify_socket = NULL;
 
 int mconsole_init(void)
 {
-       int err, sock;
+       /* long to avoid size mismatch warnings from gcc */
+       long sock;
+       int err;
        char file[256];
 
        if(umid_file_name("mconsole", file, sizeof(file))) return(-1);
index 882d2f7c1ee72a175d26c5d182ec80efb7d89f0c..c6d8ffa5641b52262085cdbd68caf8c6ecb0f037 100644 (file)
@@ -107,7 +107,7 @@ int open_ubd_file(char *file, struct openflags *openflags,
                  int *create_cow_out)
 {
        time_t mtime;
-       __u64 size;
+       unsigned long long size;
        __u32 version, align;
        char *backing_file;
        int fd, err, sectorsize, same, mode = 0644;
index 0924fcc95f1cf1becfaaf722add0e6be91555aa2..c72024219f23aea572dac0f8090bec4c97d906dc 100644 (file)
@@ -105,7 +105,7 @@ static inline int clear_user(void *mem, int len)
  * On exception, returns 0.
  * 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));
 }