aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/hugetlbfs/inode.c2
-rw-r--r--fs/inode.c12
-rw-r--r--include/linux/fs.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index bf1a2f400e70..6e5bd42f3860 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -374,7 +374,7 @@ static void truncate_hugepages(struct inode *inode, loff_t lstart)
374static void hugetlbfs_evict_inode(struct inode *inode) 374static void hugetlbfs_evict_inode(struct inode *inode)
375{ 375{
376 truncate_hugepages(inode, 0); 376 truncate_hugepages(inode, 0);
377 clear_inode(inode); 377 end_writeback(inode);
378} 378}
379 379
380static inline void 380static inline void
diff --git a/fs/inode.c b/fs/inode.c
index 9aff7deaf816..93e7a5ecbc26 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -294,6 +294,18 @@ void __iget(struct inode *inode)
294 inodes_stat.nr_unused--; 294 inodes_stat.nr_unused--;
295} 295}
296 296
297void end_writeback(struct inode *inode)
298{
299 might_sleep();
300 BUG_ON(inode->i_data.nrpages);
301 BUG_ON(!list_empty(&inode->i_data.private_list));
302 BUG_ON(!(inode->i_state & I_FREEING));
303 BUG_ON(inode->i_state & I_CLEAR);
304 inode_sync_wait(inode);
305 inode->i_state = I_FREEING | I_CLEAR;
306}
307EXPORT_SYMBOL(end_writeback);
308
297/** 309/**
298 * clear_inode - clear an inode 310 * clear_inode - clear an inode
299 * @inode: inode to clear 311 * @inode: inode to clear
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e0ecb8e75ebf..3c23c1dcb1bd 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2184,6 +2184,7 @@ extern void unlock_new_inode(struct inode *);
2184extern void __iget(struct inode * inode); 2184extern void __iget(struct inode * inode);
2185extern void iget_failed(struct inode *); 2185extern void iget_failed(struct inode *);
2186extern void clear_inode(struct inode *); 2186extern void clear_inode(struct inode *);
2187extern void end_writeback(struct inode *);
2187extern void destroy_inode(struct inode *); 2188extern void destroy_inode(struct inode *);
2188extern void __destroy_inode(struct inode *); 2189extern void __destroy_inode(struct inode *);
2189extern struct inode *new_inode(struct super_block *); 2190extern struct inode *new_inode(struct super_block *);