diff options
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r-- | fs/hugetlbfs/inode.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 1e2872b25343..5eba47f593f8 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -412,10 +412,10 @@ static int hugetlb_vmtruncate(struct inode *inode, loff_t offset) | |||
412 | pgoff = offset >> PAGE_SHIFT; | 412 | pgoff = offset >> PAGE_SHIFT; |
413 | 413 | ||
414 | i_size_write(inode, offset); | 414 | i_size_write(inode, offset); |
415 | mutex_lock(&mapping->i_mmap_mutex); | 415 | i_mmap_lock_write(mapping); |
416 | if (!RB_EMPTY_ROOT(&mapping->i_mmap)) | 416 | if (!RB_EMPTY_ROOT(&mapping->i_mmap)) |
417 | hugetlb_vmtruncate_list(&mapping->i_mmap, pgoff); | 417 | hugetlb_vmtruncate_list(&mapping->i_mmap, pgoff); |
418 | mutex_unlock(&mapping->i_mmap_mutex); | 418 | i_mmap_unlock_write(mapping); |
419 | truncate_hugepages(inode, offset); | 419 | truncate_hugepages(inode, offset); |
420 | return 0; | 420 | return 0; |
421 | } | 421 | } |
@@ -472,12 +472,12 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, | |||
472 | } | 472 | } |
473 | 473 | ||
474 | /* | 474 | /* |
475 | * Hugetlbfs is not reclaimable; therefore its i_mmap_mutex will never | 475 | * Hugetlbfs is not reclaimable; therefore its i_mmap_rwsem will never |
476 | * be taken from reclaim -- unlike regular filesystems. This needs an | 476 | * be taken from reclaim -- unlike regular filesystems. This needs an |
477 | * annotation because huge_pmd_share() does an allocation under | 477 | * annotation because huge_pmd_share() does an allocation under |
478 | * i_mmap_mutex. | 478 | * i_mmap_rwsem. |
479 | */ | 479 | */ |
480 | static struct lock_class_key hugetlbfs_i_mmap_mutex_key; | 480 | static struct lock_class_key hugetlbfs_i_mmap_rwsem_key; |
481 | 481 | ||
482 | static struct inode *hugetlbfs_get_inode(struct super_block *sb, | 482 | static struct inode *hugetlbfs_get_inode(struct super_block *sb, |
483 | struct inode *dir, | 483 | struct inode *dir, |
@@ -495,8 +495,8 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, | |||
495 | struct hugetlbfs_inode_info *info; | 495 | struct hugetlbfs_inode_info *info; |
496 | inode->i_ino = get_next_ino(); | 496 | inode->i_ino = get_next_ino(); |
497 | inode_init_owner(inode, dir, mode); | 497 | inode_init_owner(inode, dir, mode); |
498 | lockdep_set_class(&inode->i_mapping->i_mmap_mutex, | 498 | lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, |
499 | &hugetlbfs_i_mmap_mutex_key); | 499 | &hugetlbfs_i_mmap_rwsem_key); |
500 | inode->i_mapping->a_ops = &hugetlbfs_aops; | 500 | inode->i_mapping->a_ops = &hugetlbfs_aops; |
501 | inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info; | 501 | inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info; |
502 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 502 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |