aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 1fb390359bc5..c6d365f9c663 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -167,11 +167,16 @@ int ext4_truncate_restart_trans(handle_t *handle, struct inode *inode,
167/* 167/*
168 * Called at the last iput() if i_nlink is zero. 168 * Called at the last iput() if i_nlink is zero.
169 */ 169 */
170void ext4_delete_inode(struct inode *inode) 170void ext4_evict_inode(struct inode *inode)
171{ 171{
172 handle_t *handle; 172 handle_t *handle;
173 int err; 173 int err;
174 174
175 if (inode->i_nlink) {
176 truncate_inode_pages(&inode->i_data, 0);
177 goto no_delete;
178 }
179
175 if (!is_bad_inode(inode)) 180 if (!is_bad_inode(inode))
176 dquot_initialize(inode); 181 dquot_initialize(inode);
177 182
@@ -245,13 +250,13 @@ void ext4_delete_inode(struct inode *inode)
245 */ 250 */
246 if (ext4_mark_inode_dirty(handle, inode)) 251 if (ext4_mark_inode_dirty(handle, inode))
247 /* If that failed, just do the required in-core inode clear. */ 252 /* If that failed, just do the required in-core inode clear. */
248 clear_inode(inode); 253 ext4_clear_inode(inode);
249 else 254 else
250 ext4_free_inode(handle, inode); 255 ext4_free_inode(handle, inode);
251 ext4_journal_stop(handle); 256 ext4_journal_stop(handle);
252 return; 257 return;
253no_delete: 258no_delete:
254 clear_inode(inode); /* We must guarantee clearing of inode... */ 259 ext4_clear_inode(inode); /* We must guarantee clearing of inode... */
255} 260}
256 261
257typedef struct { 262typedef struct {