aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/file.c')
-rw-r--r--fs/fat/file.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 0a7f4a9918b3..e955a56b4e5e 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -133,6 +133,18 @@ static int fat_file_release(struct inode *inode, struct file *filp)
133 return 0; 133 return 0;
134} 134}
135 135
136int fat_file_fsync(struct file *filp, struct dentry *dentry, int datasync)
137{
138 struct inode *inode = dentry->d_inode;
139 int res, err;
140
141 res = simple_fsync(filp, dentry, datasync);
142 err = sync_mapping_buffers(MSDOS_SB(inode->i_sb)->fat_inode->i_mapping);
143
144 return res ? res : err;
145}
146
147
136const struct file_operations fat_file_operations = { 148const struct file_operations fat_file_operations = {
137 .llseek = generic_file_llseek, 149 .llseek = generic_file_llseek,
138 .read = do_sync_read, 150 .read = do_sync_read,
@@ -142,7 +154,7 @@ const struct file_operations fat_file_operations = {
142 .mmap = generic_file_mmap, 154 .mmap = generic_file_mmap,
143 .release = fat_file_release, 155 .release = fat_file_release,
144 .ioctl = fat_generic_ioctl, 156 .ioctl = fat_generic_ioctl,
145 .fsync = file_fsync, 157 .fsync = fat_file_fsync,
146 .splice_read = generic_file_splice_read, 158 .splice_read = generic_file_splice_read,
147}; 159};
148 160