diff options
Diffstat (limited to 'fs/hugetlbfs')
-rw-r--r-- | fs/hugetlbfs/inode.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index eba6d552d9c9..478a169a262d 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -380,36 +380,11 @@ static void hugetlbfs_delete_inode(struct inode *inode) | |||
380 | 380 | ||
381 | static void hugetlbfs_forget_inode(struct inode *inode) __releases(inode_lock) | 381 | static void hugetlbfs_forget_inode(struct inode *inode) __releases(inode_lock) |
382 | { | 382 | { |
383 | struct super_block *sb = inode->i_sb; | 383 | if (generic_detach_inode(inode)) { |
384 | 384 | truncate_hugepages(inode, 0); | |
385 | if (!hlist_unhashed(&inode->i_hash)) { | 385 | clear_inode(inode); |
386 | if (!(inode->i_state & (I_DIRTY|I_SYNC))) | 386 | destroy_inode(inode); |
387 | list_move(&inode->i_list, &inode_unused); | ||
388 | inodes_stat.nr_unused++; | ||
389 | if (!sb || (sb->s_flags & MS_ACTIVE)) { | ||
390 | spin_unlock(&inode_lock); | ||
391 | return; | ||
392 | } | ||
393 | inode->i_state |= I_WILL_FREE; | ||
394 | spin_unlock(&inode_lock); | ||
395 | /* | ||
396 | * write_inode_now is a noop as we set BDI_CAP_NO_WRITEBACK | ||
397 | * in our backing_dev_info. | ||
398 | */ | ||
399 | write_inode_now(inode, 1); | ||
400 | spin_lock(&inode_lock); | ||
401 | inode->i_state &= ~I_WILL_FREE; | ||
402 | inodes_stat.nr_unused--; | ||
403 | hlist_del_init(&inode->i_hash); | ||
404 | } | 387 | } |
405 | list_del_init(&inode->i_list); | ||
406 | list_del_init(&inode->i_sb_list); | ||
407 | inode->i_state |= I_FREEING; | ||
408 | inodes_stat.nr_inodes--; | ||
409 | spin_unlock(&inode_lock); | ||
410 | truncate_hugepages(inode, 0); | ||
411 | clear_inode(inode); | ||
412 | destroy_inode(inode); | ||
413 | } | 388 | } |
414 | 389 | ||
415 | static void hugetlbfs_drop_inode(struct inode *inode) | 390 | static void hugetlbfs_drop_inode(struct inode *inode) |