Skip to content

Commit 2bbbda3

Browse files
author
Al Viro
committed
switch hugetlbfs to ->evict_inode()
The first spoils - hugetlb can use default ->drop_inode() now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent be7ce41 commit 2bbbda3

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

‎fs/hugetlbfs/inode.c‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -371,29 +371,12 @@ static void truncate_hugepages(struct inode *inode, loff_t lstart)
371371
hugetlb_unreserve_pages(inode, start, freed);
372372
}
373373

374-
static void hugetlbfs_delete_inode(struct inode *inode)
374+
static void hugetlbfs_evict_inode(struct inode *inode)
375375
{
376376
truncate_hugepages(inode, 0);
377377
clear_inode(inode);
378378
}
379379

380-
static void hugetlbfs_forget_inode(struct inode *inode) __releases(inode_lock)
381-
{
382-
if (generic_detach_inode(inode)) {
383-
truncate_hugepages(inode, 0);
384-
clear_inode(inode);
385-
destroy_inode(inode);
386-
}
387-
}
388-
389-
static void hugetlbfs_drop_inode(struct inode *inode)
390-
{
391-
if (!inode->i_nlink)
392-
generic_delete_inode(inode);
393-
else
394-
hugetlbfs_forget_inode(inode);
395-
}
396-
397380
static inline void
398381
hugetlb_vmtruncate_list(struct prio_tree_root *root, pgoff_t pgoff)
399382
{
@@ -713,9 +696,8 @@ static const struct inode_operations hugetlbfs_inode_operations = {
713696
static const struct super_operations hugetlbfs_ops = {
714697
.alloc_inode = hugetlbfs_alloc_inode,
715698
.destroy_inode = hugetlbfs_destroy_inode,
699+
.evict_inode = hugetlbfs_evict_inode,
716700
.statfs = hugetlbfs_statfs,
717-
.delete_inode = hugetlbfs_delete_inode,
718-
.drop_inode = hugetlbfs_drop_inode,
719701
.put_super = hugetlbfs_put_super,
720702
.show_options = generic_show_options,
721703
};

0 commit comments

Comments
 (0)