diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2005-07-29 00:16:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-29 00:46:05 -0400 |
commit | a2d76bd8fa29f9b6dbf3ee8f6bc7bdda21bc5ce8 (patch) | |
tree | 88387f513bb2c09b7195117b1d7bbf389dab5d52 /fs/hostfs/hostfs_user.c | |
parent | 30f417c65e151dc96998a8ef721149a43998bc65 (diff) |
[PATCH] uml: implement hostfs syncing
Actually implement the hostfs "sync" method.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/hostfs/hostfs_user.c')
-rw-r--r-- | fs/hostfs/hostfs_user.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/hostfs/hostfs_user.c b/fs/hostfs/hostfs_user.c index 4796e8490f7d..b97809deba66 100644 --- a/fs/hostfs/hostfs_user.c +++ b/fs/hostfs/hostfs_user.c | |||
@@ -153,10 +153,24 @@ int lseek_file(int fd, long long offset, int whence) | |||
153 | int ret; | 153 | int ret; |
154 | 154 | ||
155 | ret = lseek64(fd, offset, whence); | 155 | ret = lseek64(fd, offset, whence); |
156 | if(ret < 0) return(-errno); | 156 | if(ret < 0) |
157 | return(-errno); | ||
157 | return(0); | 158 | return(0); |
158 | } | 159 | } |
159 | 160 | ||
161 | int fsync_file(int fd, int datasync) | ||
162 | { | ||
163 | int ret; | ||
164 | if (datasync) | ||
165 | ret = fdatasync(fd); | ||
166 | else | ||
167 | ret = fsync(fd); | ||
168 | |||
169 | if (ret < 0) | ||
170 | return -errno; | ||
171 | return 0; | ||
172 | } | ||
173 | |||
160 | void close_file(void *stream) | 174 | void close_file(void *stream) |
161 | { | 175 | { |
162 | close(*((int *) stream)); | 176 | close(*((int *) stream)); |