aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-10-29 21:16:45 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 00:40:43 -0400
commit0b1533f67cc1a595457af6d05ab3510294e2ca9c (patch)
tree4cebbfe7632c0967a52f7c7fb7b0c15954eaab3a /fs
parent6b09b9df05f319ec27e0dae1721efe097b8b23ad (diff)
[PATCH] cleanup hugelbfs_forget_inode
Reformat hugelbfs_forget_inode and add the missing but harmless write_inode_now call. It looks the same as generic_forget_inode now except for the call to truncate_hugepages instead of truncate_inode_pages. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/hugetlbfs/inode.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index ffdad4e64671..8f94feb24c0a 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -231,25 +231,28 @@ static void hugetlbfs_delete_inode(struct inode *inode)
231 231
232static void hugetlbfs_forget_inode(struct inode *inode) 232static void hugetlbfs_forget_inode(struct inode *inode)
233{ 233{
234 struct super_block *super_block = inode->i_sb; 234 struct super_block *sb = inode->i_sb;
235 235
236 if (hlist_unhashed(&inode->i_hash)) 236 if (!hlist_unhashed(&inode->i_hash)) {
237 goto out_truncate; 237 if (!(inode->i_state & (I_DIRTY|I_LOCK)))
238 238 list_move(&inode->i_list, &inode_unused);
239 if (!(inode->i_state & (I_DIRTY|I_LOCK))) { 239 inodes_stat.nr_unused++;
240 list_del(&inode->i_list); 240 if (!sb || (sb->s_flags & MS_ACTIVE)) {
241 list_add(&inode->i_list, &inode_unused); 241 spin_unlock(&inode_lock);
242 } 242 return;
243 inodes_stat.nr_unused++; 243 }
244 if (!super_block || (super_block->s_flags & MS_ACTIVE)) { 244 inode->i_state |= I_WILL_FREE;
245 spin_unlock(&inode_lock); 245 spin_unlock(&inode_lock);
246 return; 246 /*
247 * write_inode_now is a noop as we set BDI_CAP_NO_WRITEBACK
248 * in our backing_dev_info.
249 */
250 write_inode_now(inode, 1);
251 spin_lock(&inode_lock);
252 inode->i_state &= ~I_WILL_FREE;
253 inodes_stat.nr_unused--;
254 hlist_del_init(&inode->i_hash);
247 } 255 }
248
249 /* write_inode_now() ? */
250 inodes_stat.nr_unused--;
251 hlist_del_init(&inode->i_hash);
252out_truncate:
253 list_del_init(&inode->i_list); 256 list_del_init(&inode->i_list);
254 list_del_init(&inode->i_sb_list); 257 list_del_init(&inode->i_sb_list);
255 inode->i_state |= I_FREEING; 258 inode->i_state |= I_FREEING;
@@ -257,7 +260,6 @@ out_truncate:
257 spin_unlock(&inode_lock); 260 spin_unlock(&inode_lock);
258 if (inode->i_data.nrpages) 261 if (inode->i_data.nrpages)
259 truncate_hugepages(&inode->i_data, 0); 262 truncate_hugepages(&inode->i_data, 0);
260
261 clear_inode(inode); 263 clear_inode(inode);
262 destroy_inode(inode); 264 destroy_inode(inode);
263} 265}