[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>
This commit is contained in:
committed by
Linus Torvalds
parent
30f417c65e
commit
a2d76bd8fa
@@ -153,10 +153,24 @@ int lseek_file(int fd, long long offset, int whence)
|
||||
int ret;
|
||||
|
||||
ret = lseek64(fd, offset, whence);
|
||||
if(ret < 0) return(-errno);
|
||||
if(ret < 0)
|
||||
return(-errno);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int fsync_file(int fd, int datasync)
|
||||
{
|
||||
int ret;
|
||||
if (datasync)
|
||||
ret = fdatasync(fd);
|
||||
else
|
||||
ret = fsync(fd);
|
||||
|
||||
if (ret < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void close_file(void *stream)
|
||||
{
|
||||
close(*((int *) stream));
|
||||
|
Reference in New Issue
Block a user