aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-10-16 04:25:08 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:42:55 -0400
commitd7777a25a07e88fcfceb30f1a6f799e2ed87abb5 (patch)
tree6aaee0ed9b821d5c189d411248f0c77e4d6e502d
parent89e107877b65bf6eff1d63a1302dee9a091586f5 (diff)
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>
-rw-r--r--fs/fat/inode.c27
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
144static int fat_prepare_write(struct file *file, struct page *page, 144static 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
151static int fat_commit_write(struct file *file, struct page *page, 154static 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};