[PATCH] uml: correct error messages in COW driver
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Fri, 24 Feb 2006 21:03:53 +0000 (13:03 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 24 Feb 2006 22:31:36 +0000 (14:31 -0800)
Improve some error messages in the COW driver, and say V3, not V2, when
talking about V3 format.  Also resync with our userspace code utility a bit
more.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-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_sys.h
arch/um/drivers/cow_user.c

index c83fc5d68936d18e8bb97dff24c8d9541498b096..df25263d2ad0a84a6d5622ed6ff80aa291e12f07 100644 (file)
@@ -33,7 +33,7 @@ static inline int cow_file_size(char *file, unsigned long long *size_out)
        return(os_file_size(file, size_out));
 }
 
-static inline int cow_write_file(int fd, char *buf, int size)
+static inline int cow_write_file(int fd, void *buf, int size)
 {
        return(os_write_file(fd, buf, size));
 }
index fbe2217db5dd29676462ea9567b443579b9767a6..d1c86bc377bd25effebfca1b3565bf98e55811f1 100644 (file)
@@ -176,7 +176,7 @@ int write_cow_header(char *cow_file, int fd, char *backing_file,
        err = -ENOMEM;
        header = cow_malloc(sizeof(*header));
        if(header == NULL){
-               cow_printf("Failed to allocate COW V3 header\n");
+               cow_printf("write_cow_header - failed to allocate COW V3 header\n");
                goto out;
        }
        header->magic = htonl(COW_MAGIC);
@@ -196,15 +196,17 @@ int write_cow_header(char *cow_file, int fd, char *backing_file,
 
        err = os_file_modtime(header->backing_file, &modtime);
        if(err < 0){
-               cow_printf("Backing file '%s' mtime request failed, "
-                          "err = %d\n", header->backing_file, -err);
+               cow_printf("write_cow_header - backing file '%s' mtime "
+                          "request failed, err = %d\n", header->backing_file,
+                          -err);
                goto out_free;
        }
 
        err = cow_file_size(header->backing_file, size);
        if(err < 0){
-               cow_printf("Couldn't get size of backing file '%s', "
-                          "err = %d\n", header->backing_file, -err);
+               cow_printf("write_cow_header - couldn't get size of "
+                          "backing file '%s', err = %d\n",
+                          header->backing_file, -err);
                goto out_free;
        }
 
@@ -214,10 +216,11 @@ int write_cow_header(char *cow_file, int fd, char *backing_file,
        header->alignment = htonl(alignment);
        header->cow_format = COW_BITMAP;
 
-       err = os_write_file(fd, header, sizeof(*header));
+       err = cow_write_file(fd, header, sizeof(*header));
        if(err != sizeof(*header)){
-               cow_printf("Write of header to new COW file '%s' failed, "
-                          "err = %d\n", cow_file, -err);
+               cow_printf("write_cow_header - write of header to "
+                          "new COW file '%s' failed, err = %d\n", cow_file,
+                          -err);
                goto out_free;
        }
        err = 0;
@@ -299,7 +302,7 @@ int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg,
        }
        else if(version == 3){
                if(n < sizeof(header->v3)){
-                       cow_printf("read_cow_header - failed to read V2 "
+                       cow_printf("read_cow_header - failed to read V3 "
                                   "header\n");
                        goto out;
                }