Commit d7777a25a07e88fcfceb30f1a6f799e2ed87abb5

Authored by Nick Piggin
Committed by Linus Torvalds
1 parent 89e107877b

fat: convert to new aops

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 16 additions and 11 deletions Side-by-side Diff

... ... @@ -141,19 +141,24 @@
141 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,
145   - unsigned from, unsigned to)
  144 +static int fat_write_begin(struct file *file, struct address_space *mapping,
  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   - &MSDOS_I(page->mapping->host)->mmu_private);
  148 + *pagep = NULL;
  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,
152   - unsigned from, unsigned to)
  154 +static int fat_write_end(struct file *file, struct address_space *mapping,
  155 + loff_t pos, unsigned len, unsigned copied,
  156 + struct page *pagep, void *fsdata)
153 157 {
154   - struct inode *inode = page->mapping->host;
155   - int err = generic_commit_write(file, page, from, to);
156   - if (!err && !(MSDOS_I(inode)->i_attrs & ATTR_ARCH)) {
  158 + struct inode *inode = mapping->host;
  159 + int err;
  160 + err = generic_write_end(file, mapping, pos, len, copied, pagep, fsdata);
  161 + if (!(err < 0) && !(MSDOS_I(inode)->i_attrs & ATTR_ARCH)) {
157 162 inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
158 163 MSDOS_I(inode)->i_attrs |= ATTR_ARCH;
159 164 mark_inode_dirty(inode);
... ... @@ -202,8 +207,8 @@
202 207 .writepage = fat_writepage,
203 208 .writepages = fat_writepages,
204 209 .sync_page = block_sync_page,
205   - .prepare_write = fat_prepare_write,
206   - .commit_write = fat_commit_write,
  210 + .write_begin = fat_write_begin,
  211 + .write_end = fat_write_end,
207 212 .direct_IO = fat_direct_IO,
208 213 .bmap = _fat_bmap
209 214 };