diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2006-02-24 16:03:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-24 17:31:37 -0500 |
commit | fe1db50c7222c67466e41241bc7ef17b469bcf1d (patch) | |
tree | 1956b61473d8e9cc8a1a0849e75a728b1395f902 /arch/um/drivers | |
parent | f462e8f913bdc7a28ce55508d0c045a0c445b157 (diff) |
[PATCH] uml: tidying COW code
Improve (especially for coherence) some prototypes, and return code of
init_cow_file in error case - for a short write return -EINVAL, otherwise
return the error we got!
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/drivers')
-rw-r--r-- | arch/um/drivers/cow.h | 2 | ||||
-rw-r--r-- | arch/um/drivers/cow_sys.h | 4 | ||||
-rw-r--r-- | arch/um/drivers/cow_user.c | 3 | ||||
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/arch/um/drivers/cow.h b/arch/um/drivers/cow.h index dc36b222100b..04e3958266e0 100644 --- a/arch/um/drivers/cow.h +++ b/arch/um/drivers/cow.h | |||
@@ -46,7 +46,7 @@ extern int file_reader(__u64 offset, char *buf, int len, void *arg); | |||
46 | extern int read_cow_header(int (*reader)(__u64, char *, int, void *), | 46 | extern int read_cow_header(int (*reader)(__u64, char *, int, void *), |
47 | void *arg, __u32 *version_out, | 47 | void *arg, __u32 *version_out, |
48 | char **backing_file_out, time_t *mtime_out, | 48 | char **backing_file_out, time_t *mtime_out, |
49 | unsigned long long *size_out, int *sectorsize_out, | 49 | __u64 *size_out, int *sectorsize_out, |
50 | __u32 *align_out, int *bitmap_offset_out); | 50 | __u32 *align_out, int *bitmap_offset_out); |
51 | 51 | ||
52 | extern int write_cow_header(char *cow_file, int fd, char *backing_file, | 52 | extern int write_cow_header(char *cow_file, int fd, char *backing_file, |
diff --git a/arch/um/drivers/cow_sys.h b/arch/um/drivers/cow_sys.h index df25263d2ad0..94de4ead4f7a 100644 --- a/arch/um/drivers/cow_sys.h +++ b/arch/um/drivers/cow_sys.h | |||
@@ -23,12 +23,12 @@ static inline char *cow_strdup(char *str) | |||
23 | return(uml_strdup(str)); | 23 | return(uml_strdup(str)); |
24 | } | 24 | } |
25 | 25 | ||
26 | static inline int cow_seek_file(int fd, unsigned long long offset) | 26 | static inline int cow_seek_file(int fd, __u64 offset) |
27 | { | 27 | { |
28 | return(os_seek_file(fd, offset)); | 28 | return(os_seek_file(fd, offset)); |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline int cow_file_size(char *file, unsigned long long *size_out) | 31 | static inline int cow_file_size(char *file, __u64 *size_out) |
32 | { | 32 | { |
33 | return(os_file_size(file, size_out)); | 33 | return(os_file_size(file, size_out)); |
34 | } | 34 | } |
diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c index d1c86bc377bd..61951b721268 100644 --- a/arch/um/drivers/cow_user.c +++ b/arch/um/drivers/cow_user.c | |||
@@ -362,7 +362,8 @@ int init_cow_file(int fd, char *cow_file, char *backing_file, int sectorsize, | |||
362 | if(err != sizeof(zero)){ | 362 | if(err != sizeof(zero)){ |
363 | cow_printf("Write of bitmap to new COW file '%s' failed, " | 363 | cow_printf("Write of bitmap to new COW file '%s' failed, " |
364 | "err = %d\n", cow_file, -err); | 364 | "err = %d\n", cow_file, -err); |
365 | err = -EINVAL; | 365 | if (err >= 0) |
366 | err = -EINVAL; | ||
366 | goto out; | 367 | goto out; |
367 | } | 368 | } |
368 | 369 | ||
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 101efd26d467..fa617e0719ab 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -1135,7 +1135,7 @@ static int path_requires_switch(char *from_cmdline, char *from_cow, char *cow) | |||
1135 | static int backing_file_mismatch(char *file, __u64 size, time_t mtime) | 1135 | static int backing_file_mismatch(char *file, __u64 size, time_t mtime) |
1136 | { | 1136 | { |
1137 | unsigned long modtime; | 1137 | unsigned long modtime; |
1138 | long long actual; | 1138 | unsigned long long actual; |
1139 | int err; | 1139 | int err; |
1140 | 1140 | ||
1141 | err = os_file_modtime(file, &modtime); | 1141 | err = os_file_modtime(file, &modtime); |