Commit 62aff86fdf18657d9eca7878654415f94f16d027
1 parent
ea54400920
Exists in
master
and in
4 other branches
switch jfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 3 changed files with 20 additions and 25 deletions Side-by-side Diff
fs/jfs/inode.c
... | ... | @@ -145,31 +145,32 @@ |
145 | 145 | return 0; |
146 | 146 | } |
147 | 147 | |
148 | -void jfs_delete_inode(struct inode *inode) | |
148 | +void jfs_evict_inode(struct inode *inode) | |
149 | 149 | { |
150 | - jfs_info("In jfs_delete_inode, inode = 0x%p", inode); | |
150 | + jfs_info("In jfs_evict_inode, inode = 0x%p", inode); | |
151 | 151 | |
152 | - if (!is_bad_inode(inode)) | |
152 | + if (!inode->i_nlink && !is_bad_inode(inode)) { | |
153 | 153 | dquot_initialize(inode); |
154 | 154 | |
155 | - if (!is_bad_inode(inode) && | |
156 | - (JFS_IP(inode)->fileset == FILESYSTEM_I)) { | |
157 | - truncate_inode_pages(&inode->i_data, 0); | |
155 | + if (JFS_IP(inode)->fileset == FILESYSTEM_I) { | |
156 | + truncate_inode_pages(&inode->i_data, 0); | |
158 | 157 | |
159 | - if (test_cflag(COMMIT_Freewmap, inode)) | |
160 | - jfs_free_zero_link(inode); | |
158 | + if (test_cflag(COMMIT_Freewmap, inode)) | |
159 | + jfs_free_zero_link(inode); | |
161 | 160 | |
162 | - diFree(inode); | |
161 | + diFree(inode); | |
163 | 162 | |
164 | - /* | |
165 | - * Free the inode from the quota allocation. | |
166 | - */ | |
167 | - dquot_initialize(inode); | |
168 | - dquot_free_inode(inode); | |
169 | - dquot_drop(inode); | |
163 | + /* | |
164 | + * Free the inode from the quota allocation. | |
165 | + */ | |
166 | + dquot_initialize(inode); | |
167 | + dquot_free_inode(inode); | |
168 | + } | |
169 | + } else { | |
170 | + truncate_inode_pages(&inode->i_data, 0); | |
170 | 171 | } |
171 | - | |
172 | - clear_inode(inode); | |
172 | + end_writeback(inode); | |
173 | + dquot_drop(inode); | |
173 | 174 | } |
174 | 175 | |
175 | 176 | void jfs_dirty_inode(struct inode *inode) |
fs/jfs/jfs_inode.h
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | extern struct inode *jfs_iget(struct super_block *, unsigned long); |
28 | 28 | extern int jfs_commit_inode(struct inode *, int); |
29 | 29 | extern int jfs_write_inode(struct inode *, struct writeback_control *); |
30 | -extern void jfs_delete_inode(struct inode *); | |
30 | +extern void jfs_evict_inode(struct inode *); | |
31 | 31 | extern void jfs_dirty_inode(struct inode *); |
32 | 32 | extern void jfs_truncate(struct inode *); |
33 | 33 | extern void jfs_truncate_nolock(struct inode *, loff_t); |
fs/jfs/super.c
... | ... | @@ -132,11 +132,6 @@ |
132 | 132 | kmem_cache_free(jfs_inode_cachep, ji); |
133 | 133 | } |
134 | 134 | |
135 | -static void jfs_clear_inode(struct inode *inode) | |
136 | -{ | |
137 | - dquot_drop(inode); | |
138 | -} | |
139 | - | |
140 | 135 | static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
141 | 136 | { |
142 | 137 | struct jfs_sb_info *sbi = JFS_SBI(dentry->d_sb); |
... | ... | @@ -765,8 +760,7 @@ |
765 | 760 | .destroy_inode = jfs_destroy_inode, |
766 | 761 | .dirty_inode = jfs_dirty_inode, |
767 | 762 | .write_inode = jfs_write_inode, |
768 | - .delete_inode = jfs_delete_inode, | |
769 | - .clear_inode = jfs_clear_inode, | |
763 | + .evict_inode = jfs_evict_inode, | |
770 | 764 | .put_super = jfs_put_super, |
771 | 765 | .sync_fs = jfs_sync_fs, |
772 | 766 | .freeze_fs = jfs_freeze, |