aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/inode.c28
-rw-r--r--include/linux/fs.h1
2 files changed, 4 insertions, 25 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 8320bef7177e..82ca3562a688 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -306,29 +306,6 @@ void end_writeback(struct inode *inode)
306} 306}
307EXPORT_SYMBOL(end_writeback); 307EXPORT_SYMBOL(end_writeback);
308 308
309/**
310 * clear_inode - clear an inode
311 * @inode: inode to clear
312 *
313 * This is called by the filesystem to tell us
314 * that the inode is no longer useful. We just
315 * terminate it with extreme prejudice.
316 */
317void clear_inode(struct inode *inode)
318{
319 might_sleep();
320 invalidate_inode_buffers(inode);
321
322 BUG_ON(inode->i_data.nrpages);
323 BUG_ON(!(inode->i_state & I_FREEING));
324 BUG_ON(inode->i_state & I_CLEAR);
325 inode_sync_wait(inode);
326 if (inode->i_sb->s_op->clear_inode)
327 inode->i_sb->s_op->clear_inode(inode);
328 inode->i_state = I_FREEING | I_CLEAR;
329}
330EXPORT_SYMBOL(clear_inode);
331
332static void evict(struct inode *inode) 309static void evict(struct inode *inode)
333{ 310{
334 const struct super_operations *op = inode->i_sb->s_op; 311 const struct super_operations *op = inode->i_sb->s_op;
@@ -338,7 +315,10 @@ static void evict(struct inode *inode)
338 } else { 315 } else {
339 if (inode->i_data.nrpages) 316 if (inode->i_data.nrpages)
340 truncate_inode_pages(&inode->i_data, 0); 317 truncate_inode_pages(&inode->i_data, 0);
341 clear_inode(inode); 318 invalidate_inode_buffers(inode);
319 end_writeback(inode);
320 if (op->clear_inode)
321 op->clear_inode(inode);
342 } 322 }
343 if (S_ISBLK(inode->i_mode) && inode->i_bdev) 323 if (S_ISBLK(inode->i_mode) && inode->i_bdev)
344 bd_forget(inode); 324 bd_forget(inode);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2b1254771e46..4eaa6b2e35db 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2182,7 +2182,6 @@ extern void unlock_new_inode(struct inode *);
2182 2182
2183extern void __iget(struct inode * inode); 2183extern void __iget(struct inode * inode);
2184extern void iget_failed(struct inode *); 2184extern void iget_failed(struct inode *);
2185extern void clear_inode(struct inode *);
2186extern void end_writeback(struct inode *); 2185extern void end_writeback(struct inode *);
2187extern void destroy_inode(struct inode *); 2186extern void destroy_inode(struct inode *);
2188extern void __destroy_inode(struct inode *); 2187extern void __destroy_inode(struct inode *);