diff options
Diffstat (limited to 'fs/fat')
-rw-r--r-- | fs/fat/cache.c | 2 | ||||
-rw-r--r-- | fs/fat/inode.c | 29 |
2 files changed, 18 insertions, 13 deletions
diff --git a/fs/fat/cache.c b/fs/fat/cache.c index be6f89b152..639b3b4f86 100644 --- a/fs/fat/cache.c +++ b/fs/fat/cache.c | |||
@@ -36,7 +36,7 @@ static inline int fat_max_cache(struct inode *inode) | |||
36 | 36 | ||
37 | static struct kmem_cache *fat_cache_cachep; | 37 | static struct kmem_cache *fat_cache_cachep; |
38 | 38 | ||
39 | static void init_once(void *foo, struct kmem_cache *cachep, unsigned long flags) | 39 | static void init_once(struct kmem_cache *cachep, void *foo) |
40 | { | 40 | { |
41 | struct fat_cache *cache = (struct fat_cache *)foo; | 41 | struct fat_cache *cache = (struct fat_cache *)foo; |
42 | 42 | ||
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 4baa5f2053..c0c5e9c55b 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 | }; |
@@ -496,7 +501,7 @@ static void fat_destroy_inode(struct inode *inode) | |||
496 | kmem_cache_free(fat_inode_cachep, MSDOS_I(inode)); | 501 | kmem_cache_free(fat_inode_cachep, MSDOS_I(inode)); |
497 | } | 502 | } |
498 | 503 | ||
499 | static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags) | 504 | static void init_once(struct kmem_cache *cachep, void *foo) |
500 | { | 505 | { |
501 | struct msdos_inode_info *ei = (struct msdos_inode_info *)foo; | 506 | struct msdos_inode_info *ei = (struct msdos_inode_info *)foo; |
502 | 507 | ||