diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-07 13:44:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:12 -0400 |
commit | b522412aeabadbb302fd4338eaabf09d10e2d29c (patch) | |
tree | 6b6b73686bc77e10a3a8275e84bc545ddf7755b6 /fs/fat/file.c | |
parent | 964f5369667b342994fe3f384e9ba41d404ee796 (diff) |
Sanitize ->fsync() for FAT
* mark directory data blocks as assoc. metadata
* add new inode to deal with FAT, mark FAT blocks as assoc. metadata of that
* now ->fsync() is trivial both for files and directories
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fat/file.c')
-rw-r--r-- | fs/fat/file.c | 14 |
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 | ||
136 | int 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 | |||
136 | const struct file_operations fat_file_operations = { | 148 | const 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 | ||