diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fat/inode.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 4baa5f205368..46b8a67f55c6 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -141,19 +141,24 @@ static int fat_readpages(struct file *file, struct address_space *mapping, | |||
141 | return mpage_readpages(mapping, pages, nr_pages, fat_get_block); | 141 | return mpage_readpages(mapping, pages, nr_pages, fat_get_block); |
142 | } | 142 | } |
143 | 143 | ||
144 | static int fat_prepare_write(struct file *file, struct page *page, | 144 | static int fat_write_begin(struct file *file, struct address_space *mapping, |
145 | unsigned from, unsigned to) | 145 | loff_t pos, unsigned len, unsigned flags, |
146 | struct page **pagep, void **fsdata) | ||
146 | { | 147 | { |
147 | return cont_prepare_write(page, from, to, fat_get_block, | 148 | *pagep = NULL; |
148 | &MSDOS_I(page->mapping->host)->mmu_private); | 149 | return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata, |
150 | fat_get_block, | ||
151 | &MSDOS_I(mapping->host)->mmu_private); | ||
149 | } | 152 | } |
150 | 153 | ||
151 | static int fat_commit_write(struct file *file, struct page *page, | 154 | static int fat_write_end(struct file *file, struct address_space *mapping, |
152 | unsigned from, unsigned to) | 155 | loff_t pos, unsigned len, unsigned copied, |
156 | struct page *pagep, void *fsdata) | ||
153 | { | 157 | { |
154 | struct inode *inode = page->mapping->host; | 158 | struct inode *inode = mapping->host; |
155 | int err = generic_commit_write(file, page, from, to); | 159 | int err; |
156 | if (!err && !(MSDOS_I(inode)->i_attrs & ATTR_ARCH)) { | 160 | err = generic_write_end(file, mapping, pos, len, copied, pagep, fsdata); |
161 | if (!(err < 0) && !(MSDOS_I(inode)->i_attrs & ATTR_ARCH)) { | ||
157 | inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; | 162 | inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; |
158 | MSDOS_I(inode)->i_attrs |= ATTR_ARCH; | 163 | MSDOS_I(inode)->i_attrs |= ATTR_ARCH; |
159 | mark_inode_dirty(inode); | 164 | mark_inode_dirty(inode); |
@@ -202,8 +207,8 @@ static const struct address_space_operations fat_aops = { | |||
202 | .writepage = fat_writepage, | 207 | .writepage = fat_writepage, |
203 | .writepages = fat_writepages, | 208 | .writepages = fat_writepages, |
204 | .sync_page = block_sync_page, | 209 | .sync_page = block_sync_page, |
205 | .prepare_write = fat_prepare_write, | 210 | .write_begin = fat_write_begin, |
206 | .commit_write = fat_commit_write, | 211 | .write_end = fat_write_end, |
207 | .direct_IO = fat_direct_IO, | 212 | .direct_IO = fat_direct_IO, |
208 | .bmap = _fat_bmap | 213 | .bmap = _fat_bmap |
209 | }; | 214 | }; |