[PATCH 1/6] uml: correct error messages in COW driver

From: Paolo 'Blaisorblade' Giarrusso
Date: Tue Feb 21 2006 - 12:15:50 EST



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@xxxxxxxx>
---

arch/um/drivers/cow_sys.h | 2 +-
arch/um/drivers/cow_user.c | 21 ++++++++++++---------
2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/um/drivers/cow_sys.h b/arch/um/drivers/cow_sys.h
index c83fc5d..df25263 100644
--- a/arch/um/drivers/cow_sys.h
+++ b/arch/um/drivers/cow_sys.h
@@ -33,7 +33,7 @@ static inline int cow_file_size(char *fi
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));
}
diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c
index fbe2217..d1c86bc 100644
--- a/arch/um/drivers/cow_user.c
+++ b/arch/um/drivers/cow_user.c
@@ -176,7 +176,7 @@ int write_cow_header(char *cow_file, int
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

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
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,
}
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;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/