diff options
Diffstat (limited to 'fs/hostfs')
-rw-r--r-- | fs/hostfs/hostfs.h | 1 | ||||
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 2 | ||||
-rw-r--r-- | fs/hostfs/hostfs_user.c | 16 |
3 files changed, 17 insertions, 2 deletions
diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h index c1516d013bf6..67bca0d4a33b 100644 --- a/fs/hostfs/hostfs.h +++ b/fs/hostfs/hostfs.h | |||
@@ -69,6 +69,7 @@ extern int read_file(int fd, unsigned long long *offset, char *buf, int len); | |||
69 | extern int write_file(int fd, unsigned long long *offset, const char *buf, | 69 | extern int write_file(int fd, unsigned long long *offset, const char *buf, |
70 | int len); | 70 | int len); |
71 | extern int lseek_file(int fd, long long offset, int whence); | 71 | extern int lseek_file(int fd, long long offset, int whence); |
72 | extern int fsync_file(int fd, int datasync); | ||
72 | extern int file_create(char *name, int ur, int uw, int ux, int gr, | 73 | extern int file_create(char *name, int ur, int uw, int ux, int gr, |
73 | int gw, int gx, int or, int ow, int ox); | 74 | int gw, int gx, int or, int ow, int ox); |
74 | extern int set_attr(const char *file, struct hostfs_iattr *attrs); | 75 | extern int set_attr(const char *file, struct hostfs_iattr *attrs); |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 88e68caa3784..b2d18200a003 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -382,7 +382,7 @@ int hostfs_file_open(struct inode *ino, struct file *file) | |||
382 | 382 | ||
383 | int hostfs_fsync(struct file *file, struct dentry *dentry, int datasync) | 383 | int hostfs_fsync(struct file *file, struct dentry *dentry, int datasync) |
384 | { | 384 | { |
385 | return(0); | 385 | return fsync_file(HOSTFS_I(dentry->d_inode)->fd, datasync); |
386 | } | 386 | } |
387 | 387 | ||
388 | static struct file_operations hostfs_file_fops = { | 388 | static struct file_operations hostfs_file_fops = { |
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)); |