diff options
-rw-r--r-- | fs/affs/affs.h | 1 | ||||
-rw-r--r-- | fs/affs/dir.c | 2 | ||||
-rw-r--r-- | fs/affs/file.c | 14 |
3 files changed, 15 insertions, 2 deletions
diff --git a/fs/affs/affs.h b/fs/affs/affs.h index 1a2d5e3c7f4e..e511dc621a2e 100644 --- a/fs/affs/affs.h +++ b/fs/affs/affs.h | |||
@@ -182,6 +182,7 @@ extern int affs_add_entry(struct inode *dir, struct inode *inode, struct dent | |||
182 | 182 | ||
183 | void affs_free_prealloc(struct inode *inode); | 183 | void affs_free_prealloc(struct inode *inode); |
184 | extern void affs_truncate(struct inode *); | 184 | extern void affs_truncate(struct inode *); |
185 | int affs_file_fsync(struct file *, struct dentry *, int); | ||
185 | 186 | ||
186 | /* dir.c */ | 187 | /* dir.c */ |
187 | 188 | ||
diff --git a/fs/affs/dir.c b/fs/affs/dir.c index 7b36904dbeac..8ca8f3a55599 100644 --- a/fs/affs/dir.c +++ b/fs/affs/dir.c | |||
@@ -21,7 +21,7 @@ const struct file_operations affs_dir_operations = { | |||
21 | .read = generic_read_dir, | 21 | .read = generic_read_dir, |
22 | .llseek = generic_file_llseek, | 22 | .llseek = generic_file_llseek, |
23 | .readdir = affs_readdir, | 23 | .readdir = affs_readdir, |
24 | .fsync = file_fsync, | 24 | .fsync = affs_file_fsync, |
25 | }; | 25 | }; |
26 | 26 | ||
27 | /* | 27 | /* |
diff --git a/fs/affs/file.c b/fs/affs/file.c index 9246cb4aa018..184e55c1c9ba 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c | |||
@@ -34,7 +34,7 @@ const struct file_operations affs_file_operations = { | |||
34 | .mmap = generic_file_mmap, | 34 | .mmap = generic_file_mmap, |
35 | .open = affs_file_open, | 35 | .open = affs_file_open, |
36 | .release = affs_file_release, | 36 | .release = affs_file_release, |
37 | .fsync = file_fsync, | 37 | .fsync = affs_file_fsync, |
38 | .splice_read = generic_file_splice_read, | 38 | .splice_read = generic_file_splice_read, |
39 | }; | 39 | }; |
40 | 40 | ||
@@ -915,3 +915,15 @@ affs_truncate(struct inode *inode) | |||
915 | } | 915 | } |
916 | affs_free_prealloc(inode); | 916 | affs_free_prealloc(inode); |
917 | } | 917 | } |
918 | |||
919 | int affs_file_fsync(struct file *filp, struct dentry *dentry, int datasync) | ||
920 | { | ||
921 | struct inode * inode = dentry->d_inode; | ||
922 | int ret, err; | ||
923 | |||
924 | ret = write_inode_now(inode, 0); | ||
925 | err = sync_blockdev(inode->i_sb->s_bdev); | ||
926 | if (!ret) | ||
927 | ret = err; | ||
928 | return ret; | ||
929 | } | ||