aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/fs.c')
-rw-r--r--fs/jffs2/fs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index 459d39d1ea0b..6b2964a19850 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -2,6 +2,7 @@
2 * JFFS2 -- Journalling Flash File System, Version 2. 2 * JFFS2 -- Journalling Flash File System, Version 2.
3 * 3 *
4 * Copyright © 2001-2007 Red Hat, Inc. 4 * Copyright © 2001-2007 Red Hat, Inc.
5 * Copyright © 2004-2010 David Woodhouse <dwmw2@infradead.org>
5 * 6 *
6 * Created by David Woodhouse <dwmw2@infradead.org> 7 * Created by David Woodhouse <dwmw2@infradead.org>
7 * 8 *
@@ -169,13 +170,13 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
169 mutex_unlock(&f->sem); 170 mutex_unlock(&f->sem);
170 jffs2_complete_reservation(c); 171 jffs2_complete_reservation(c);
171 172
172 /* We have to do the simple_setsize() without f->sem held, since 173 /* We have to do the truncate_setsize() without f->sem held, since
173 some pages may be locked and waiting for it in readpage(). 174 some pages may be locked and waiting for it in readpage().
174 We are protected from a simultaneous write() extending i_size 175 We are protected from a simultaneous write() extending i_size
175 back past iattr->ia_size, because do_truncate() holds the 176 back past iattr->ia_size, because do_truncate() holds the
176 generic inode semaphore. */ 177 generic inode semaphore. */
177 if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) { 178 if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) {
178 simple_setsize(inode, iattr->ia_size); 179 truncate_setsize(inode, iattr->ia_size);
179 inode->i_blocks = (inode->i_size + 511) >> 9; 180 inode->i_blocks = (inode->i_size + 511) >> 9;
180 } 181 }
181 182
@@ -225,7 +226,7 @@ int jffs2_statfs(struct dentry *dentry, struct kstatfs *buf)
225} 226}
226 227
227 228
228void jffs2_clear_inode (struct inode *inode) 229void jffs2_evict_inode (struct inode *inode)
229{ 230{
230 /* We can forget about this inode for now - drop all 231 /* We can forget about this inode for now - drop all
231 * the nodelists associated with it, etc. 232 * the nodelists associated with it, etc.
@@ -233,7 +234,9 @@ void jffs2_clear_inode (struct inode *inode)
233 struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); 234 struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
234 struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); 235 struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
235 236
236 D1(printk(KERN_DEBUG "jffs2_clear_inode(): ino #%lu mode %o\n", inode->i_ino, inode->i_mode)); 237 D1(printk(KERN_DEBUG "jffs2_evict_inode(): ino #%lu mode %o\n", inode->i_ino, inode->i_mode));
238 truncate_inode_pages(&inode->i_data, 0);
239 end_writeback(inode);
237 jffs2_do_clear_inode(c, f); 240 jffs2_do_clear_inode(c, f);
238} 241}
239 242