diff options
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/dir.c | 16 | ||||
-rw-r--r-- | fs/jffs2/fs.c | 10 | ||||
-rw-r--r-- | fs/jffs2/os-linux.h | 2 | ||||
-rw-r--r-- | fs/jffs2/super.c | 2 | ||||
-rw-r--r-- | fs/jffs2/xattr.c | 2 |
5 files changed, 13 insertions, 19 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 166062a68230..5fd3b5cecda5 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -232,9 +232,7 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode, | |||
232 | return 0; | 232 | return 0; |
233 | 233 | ||
234 | fail: | 234 | fail: |
235 | make_bad_inode(inode); | 235 | iget_failed(inode); |
236 | unlock_new_inode(inode); | ||
237 | iput(inode); | ||
238 | jffs2_free_raw_inode(ri); | 236 | jffs2_free_raw_inode(ri); |
239 | return ret; | 237 | return ret; |
240 | } | 238 | } |
@@ -454,9 +452,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
454 | return 0; | 452 | return 0; |
455 | 453 | ||
456 | fail: | 454 | fail: |
457 | make_bad_inode(inode); | 455 | iget_failed(inode); |
458 | unlock_new_inode(inode); | ||
459 | iput(inode); | ||
460 | return ret; | 456 | return ret; |
461 | } | 457 | } |
462 | 458 | ||
@@ -601,9 +597,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode) | |||
601 | return 0; | 597 | return 0; |
602 | 598 | ||
603 | fail: | 599 | fail: |
604 | make_bad_inode(inode); | 600 | iget_failed(inode); |
605 | unlock_new_inode(inode); | ||
606 | iput(inode); | ||
607 | return ret; | 601 | return ret; |
608 | } | 602 | } |
609 | 603 | ||
@@ -778,9 +772,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, de | |||
778 | return 0; | 772 | return 0; |
779 | 773 | ||
780 | fail: | 774 | fail: |
781 | make_bad_inode(inode); | 775 | iget_failed(inode); |
782 | unlock_new_inode(inode); | ||
783 | iput(inode); | ||
784 | return ret; | 776 | return ret; |
785 | } | 777 | } |
786 | 778 | ||
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 459d39d1ea0b..ac0638f04969 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -169,13 +169,13 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) | |||
169 | mutex_unlock(&f->sem); | 169 | mutex_unlock(&f->sem); |
170 | jffs2_complete_reservation(c); | 170 | jffs2_complete_reservation(c); |
171 | 171 | ||
172 | /* We have to do the simple_setsize() without f->sem held, since | 172 | /* We have to do the truncate_setsize() without f->sem held, since |
173 | some pages may be locked and waiting for it in readpage(). | 173 | some pages may be locked and waiting for it in readpage(). |
174 | We are protected from a simultaneous write() extending i_size | 174 | We are protected from a simultaneous write() extending i_size |
175 | back past iattr->ia_size, because do_truncate() holds the | 175 | back past iattr->ia_size, because do_truncate() holds the |
176 | generic inode semaphore. */ | 176 | generic inode semaphore. */ |
177 | if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) { | 177 | if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) { |
178 | simple_setsize(inode, iattr->ia_size); | 178 | truncate_setsize(inode, iattr->ia_size); |
179 | inode->i_blocks = (inode->i_size + 511) >> 9; | 179 | inode->i_blocks = (inode->i_size + 511) >> 9; |
180 | } | 180 | } |
181 | 181 | ||
@@ -225,7 +225,7 @@ int jffs2_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
225 | } | 225 | } |
226 | 226 | ||
227 | 227 | ||
228 | void jffs2_clear_inode (struct inode *inode) | 228 | void jffs2_evict_inode (struct inode *inode) |
229 | { | 229 | { |
230 | /* We can forget about this inode for now - drop all | 230 | /* We can forget about this inode for now - drop all |
231 | * the nodelists associated with it, etc. | 231 | * the nodelists associated with it, etc. |
@@ -233,7 +233,9 @@ void jffs2_clear_inode (struct inode *inode) | |||
233 | struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); | 233 | struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); |
234 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); | 234 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); |
235 | 235 | ||
236 | D1(printk(KERN_DEBUG "jffs2_clear_inode(): ino #%lu mode %o\n", inode->i_ino, inode->i_mode)); | 236 | D1(printk(KERN_DEBUG "jffs2_evict_inode(): ino #%lu mode %o\n", inode->i_ino, inode->i_mode)); |
237 | truncate_inode_pages(&inode->i_data, 0); | ||
238 | end_writeback(inode); | ||
237 | jffs2_do_clear_inode(c, f); | 239 | jffs2_do_clear_inode(c, f); |
238 | } | 240 | } |
239 | 241 | ||
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 4791aacf3084..00bae7cc2e48 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h | |||
@@ -171,7 +171,7 @@ extern const struct inode_operations jffs2_symlink_inode_operations; | |||
171 | int jffs2_setattr (struct dentry *, struct iattr *); | 171 | int jffs2_setattr (struct dentry *, struct iattr *); |
172 | int jffs2_do_setattr (struct inode *, struct iattr *); | 172 | int jffs2_do_setattr (struct inode *, struct iattr *); |
173 | struct inode *jffs2_iget(struct super_block *, unsigned long); | 173 | struct inode *jffs2_iget(struct super_block *, unsigned long); |
174 | void jffs2_clear_inode (struct inode *); | 174 | void jffs2_evict_inode (struct inode *); |
175 | void jffs2_dirty_inode(struct inode *inode); | 175 | void jffs2_dirty_inode(struct inode *inode); |
176 | struct inode *jffs2_new_inode (struct inode *dir_i, int mode, | 176 | struct inode *jffs2_new_inode (struct inode *dir_i, int mode, |
177 | struct jffs2_raw_inode *ri); | 177 | struct jffs2_raw_inode *ri); |
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 511e2d609d12..662bba099501 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c | |||
@@ -135,7 +135,7 @@ static const struct super_operations jffs2_super_operations = | |||
135 | .write_super = jffs2_write_super, | 135 | .write_super = jffs2_write_super, |
136 | .statfs = jffs2_statfs, | 136 | .statfs = jffs2_statfs, |
137 | .remount_fs = jffs2_remount_fs, | 137 | .remount_fs = jffs2_remount_fs, |
138 | .clear_inode = jffs2_clear_inode, | 138 | .evict_inode = jffs2_evict_inode, |
139 | .dirty_inode = jffs2_dirty_inode, | 139 | .dirty_inode = jffs2_dirty_inode, |
140 | .sync_fs = jffs2_sync_fs, | 140 | .sync_fs = jffs2_sync_fs, |
141 | }; | 141 | }; |
diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c index d258e261bdc7..9b572ca40a49 100644 --- a/fs/jffs2/xattr.c +++ b/fs/jffs2/xattr.c | |||
@@ -588,7 +588,7 @@ static void delete_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *re | |||
588 | 588 | ||
589 | void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) | 589 | void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) |
590 | { | 590 | { |
591 | /* It's called from jffs2_clear_inode() on inode removing. | 591 | /* It's called from jffs2_evict_inode() on inode removing. |
592 | When an inode with XATTR is removed, those XATTRs must be removed. */ | 592 | When an inode with XATTR is removed, those XATTRs must be removed. */ |
593 | struct jffs2_xattr_ref *ref, *_ref; | 593 | struct jffs2_xattr_ref *ref, *_ref; |
594 | 594 | ||