diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2006-02-24 16:03:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-24 17:31:36 -0500 |
commit | 31bc5a33346b6dd35be219d1416449e0064e9123 (patch) | |
tree | ce4c3d105b5ec6cfa69b8300a885c9c26908eafe /arch/um | |
parent | b1a3aa209161af3b7ca8ce8eae89b15faa96f612 (diff) |
[PATCH] uml: correct error messages in COW driver
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>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/cow_sys.h | 2 | ||||
-rw-r--r-- | 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 c83fc5d68936..df25263d2ad0 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 *file, unsigned long long *size_out) | |||
33 | return(os_file_size(file, size_out)); | 33 | return(os_file_size(file, size_out)); |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline int cow_write_file(int fd, char *buf, int size) | 36 | static inline int cow_write_file(int fd, void *buf, int size) |
37 | { | 37 | { |
38 | return(os_write_file(fd, buf, size)); | 38 | return(os_write_file(fd, buf, size)); |
39 | } | 39 | } |
diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c index fbe2217db5dd..d1c86bc377bd 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 fd, char *backing_file, | |||
176 | err = -ENOMEM; | 176 | err = -ENOMEM; |
177 | header = cow_malloc(sizeof(*header)); | 177 | header = cow_malloc(sizeof(*header)); |
178 | if(header == NULL){ | 178 | if(header == NULL){ |
179 | cow_printf("Failed to allocate COW V3 header\n"); | 179 | cow_printf("write_cow_header - failed to allocate COW V3 header\n"); |
180 | goto out; | 180 | goto out; |
181 | } | 181 | } |
182 | header->magic = htonl(COW_MAGIC); | 182 | header->magic = htonl(COW_MAGIC); |
@@ -196,15 +196,17 @@ int write_cow_header(char *cow_file, int fd, char *backing_file, | |||
196 | 196 | ||
197 | err = os_file_modtime(header->backing_file, &modtime); | 197 | err = os_file_modtime(header->backing_file, &modtime); |
198 | if(err < 0){ | 198 | if(err < 0){ |
199 | cow_printf("Backing file '%s' mtime request failed, " | 199 | cow_printf("write_cow_header - backing file '%s' mtime " |
200 | "err = %d\n", header->backing_file, -err); | 200 | "request failed, err = %d\n", header->backing_file, |
201 | -err); | ||
201 | goto out_free; | 202 | goto out_free; |
202 | } | 203 | } |
203 | 204 | ||
204 | err = cow_file_size(header->backing_file, size); | 205 | err = cow_file_size(header->backing_file, size); |
205 | if(err < 0){ | 206 | if(err < 0){ |
206 | cow_printf("Couldn't get size of backing file '%s', " | 207 | cow_printf("write_cow_header - couldn't get size of " |
207 | "err = %d\n", header->backing_file, -err); | 208 | "backing file '%s', err = %d\n", |
209 | header->backing_file, -err); | ||
208 | goto out_free; | 210 | goto out_free; |
209 | } | 211 | } |
210 | 212 | ||
@@ -214,10 +216,11 @@ int write_cow_header(char *cow_file, int fd, char *backing_file, | |||
214 | header->alignment = htonl(alignment); | 216 | header->alignment = htonl(alignment); |
215 | header->cow_format = COW_BITMAP; | 217 | header->cow_format = COW_BITMAP; |
216 | 218 | ||
217 | err = os_write_file(fd, header, sizeof(*header)); | 219 | err = cow_write_file(fd, header, sizeof(*header)); |
218 | if(err != sizeof(*header)){ | 220 | if(err != sizeof(*header)){ |
219 | cow_printf("Write of header to new COW file '%s' failed, " | 221 | cow_printf("write_cow_header - write of header to " |
220 | "err = %d\n", cow_file, -err); | 222 | "new COW file '%s' failed, err = %d\n", cow_file, |
223 | -err); | ||
221 | goto out_free; | 224 | goto out_free; |
222 | } | 225 | } |
223 | err = 0; | 226 | err = 0; |
@@ -299,7 +302,7 @@ int read_cow_header(int (*reader)(__u64, char *, int, void *), void *arg, | |||
299 | } | 302 | } |
300 | else if(version == 3){ | 303 | else if(version == 3){ |
301 | if(n < sizeof(header->v3)){ | 304 | if(n < sizeof(header->v3)){ |
302 | cow_printf("read_cow_header - failed to read V2 " | 305 | cow_printf("read_cow_header - failed to read V3 " |
303 | "header\n"); | 306 | "header\n"); |
304 | goto out; | 307 | goto out; |
305 | } | 308 | } |