diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/hugetlbfs/inode.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index a3f868ae3fd4..34423978b170 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -463,6 +463,14 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, | |||
463 | return inode; | 463 | return inode; |
464 | } | 464 | } |
465 | 465 | ||
466 | /* | ||
467 | * Hugetlbfs is not reclaimable; therefore its i_mmap_mutex will never | ||
468 | * be taken from reclaim -- unlike regular filesystems. This needs an | ||
469 | * annotation because huge_pmd_share() does an allocation under | ||
470 | * i_mmap_mutex. | ||
471 | */ | ||
472 | struct lock_class_key hugetlbfs_i_mmap_mutex_key; | ||
473 | |||
466 | static struct inode *hugetlbfs_get_inode(struct super_block *sb, | 474 | static struct inode *hugetlbfs_get_inode(struct super_block *sb, |
467 | struct inode *dir, | 475 | struct inode *dir, |
468 | umode_t mode, dev_t dev) | 476 | umode_t mode, dev_t dev) |
@@ -474,6 +482,8 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, | |||
474 | struct hugetlbfs_inode_info *info; | 482 | struct hugetlbfs_inode_info *info; |
475 | inode->i_ino = get_next_ino(); | 483 | inode->i_ino = get_next_ino(); |
476 | inode_init_owner(inode, dir, mode); | 484 | inode_init_owner(inode, dir, mode); |
485 | lockdep_set_class(&inode->i_mapping->i_mmap_mutex, | ||
486 | &hugetlbfs_i_mmap_mutex_key); | ||
477 | inode->i_mapping->a_ops = &hugetlbfs_aops; | 487 | inode->i_mapping->a_ops = &hugetlbfs_aops; |
478 | inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info; | 488 | inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info; |
479 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 489 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |