diff options
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r-- | fs/hugetlbfs/inode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 8bbf7f3e2a27..e1f465a389d5 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -141,7 +141,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
141 | 141 | ||
142 | vma_len = (loff_t)(vma->vm_end - vma->vm_start); | 142 | vma_len = (loff_t)(vma->vm_end - vma->vm_start); |
143 | 143 | ||
144 | mutex_lock(&inode->i_mutex); | 144 | inode_lock(inode); |
145 | file_accessed(file); | 145 | file_accessed(file); |
146 | 146 | ||
147 | ret = -ENOMEM; | 147 | ret = -ENOMEM; |
@@ -157,7 +157,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
157 | if (vma->vm_flags & VM_WRITE && inode->i_size < len) | 157 | if (vma->vm_flags & VM_WRITE && inode->i_size < len) |
158 | inode->i_size = len; | 158 | inode->i_size = len; |
159 | out: | 159 | out: |
160 | mutex_unlock(&inode->i_mutex); | 160 | inode_unlock(inode); |
161 | 161 | ||
162 | return ret; | 162 | return ret; |
163 | } | 163 | } |
@@ -530,7 +530,7 @@ static long hugetlbfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) | |||
530 | if (hole_end > hole_start) { | 530 | if (hole_end > hole_start) { |
531 | struct address_space *mapping = inode->i_mapping; | 531 | struct address_space *mapping = inode->i_mapping; |
532 | 532 | ||
533 | mutex_lock(&inode->i_mutex); | 533 | inode_lock(inode); |
534 | i_mmap_lock_write(mapping); | 534 | i_mmap_lock_write(mapping); |
535 | if (!RB_EMPTY_ROOT(&mapping->i_mmap)) | 535 | if (!RB_EMPTY_ROOT(&mapping->i_mmap)) |
536 | hugetlb_vmdelete_list(&mapping->i_mmap, | 536 | hugetlb_vmdelete_list(&mapping->i_mmap, |
@@ -538,7 +538,7 @@ static long hugetlbfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) | |||
538 | hole_end >> PAGE_SHIFT); | 538 | hole_end >> PAGE_SHIFT); |
539 | i_mmap_unlock_write(mapping); | 539 | i_mmap_unlock_write(mapping); |
540 | remove_inode_hugepages(inode, hole_start, hole_end); | 540 | remove_inode_hugepages(inode, hole_start, hole_end); |
541 | mutex_unlock(&inode->i_mutex); | 541 | inode_unlock(inode); |
542 | } | 542 | } |
543 | 543 | ||
544 | return 0; | 544 | return 0; |
@@ -572,7 +572,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, | |||
572 | start = offset >> hpage_shift; | 572 | start = offset >> hpage_shift; |
573 | end = (offset + len + hpage_size - 1) >> hpage_shift; | 573 | end = (offset + len + hpage_size - 1) >> hpage_shift; |
574 | 574 | ||
575 | mutex_lock(&inode->i_mutex); | 575 | inode_lock(inode); |
576 | 576 | ||
577 | /* We need to check rlimit even when FALLOC_FL_KEEP_SIZE */ | 577 | /* We need to check rlimit even when FALLOC_FL_KEEP_SIZE */ |
578 | error = inode_newsize_ok(inode, offset + len); | 578 | error = inode_newsize_ok(inode, offset + len); |
@@ -659,7 +659,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, | |||
659 | i_size_write(inode, offset + len); | 659 | i_size_write(inode, offset + len); |
660 | inode->i_ctime = CURRENT_TIME; | 660 | inode->i_ctime = CURRENT_TIME; |
661 | out: | 661 | out: |
662 | mutex_unlock(&inode->i_mutex); | 662 | inode_unlock(inode); |
663 | return error; | 663 | return error; |
664 | } | 664 | } |
665 | 665 | ||