Convert all open coded mutex_lock/unlock calls to the i_mmap_[lock/unlock]_write() helpers.
Showing the changes to kernel (2 of 12 files). Show all
Unified · Split
| @@ -724,7 +724,7 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register) · 723 unmodified lines | ||
| 724 | 724 | int more = 0; |
| 725 | 725 | |
| 726 | 726 | again: |
| 727 | − mutex_lock(&mapping->i_mmap_mutex); | |
| 727 | + i_mmap_lock_write(mapping); | |
| 728 | 728 | vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) { |
| 729 | 729 | if (!valid_vma(vma, is_register)) |
| 730 | 730 | continue; |
| @@ -755,7 +755,7 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register) · 24 unmodified lines | ||
| 755 | 755 | info->mm = vma->vm_mm; |
| 756 | 756 | info->vaddr = offset_to_vaddr(vma, offset); |
| 757 | 757 | } |
| 758 | − mutex_unlock(&mapping->i_mmap_mutex); | |
| 758 | + i_mmap_unlock_write(mapping); | |
| 759 | 759 | |
| 760 | 760 | if (!more) |
| 761 | 761 | goto out; |
| @@ -433,7 +433,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) · 432 unmodified lines | ||
| 433 | 433 | get_file(file); |
| 434 | 434 | if (tmp->vm_flags & VM_DENYWRITE) |
| 435 | 435 | atomic_dec(&inode->i_writecount); |
| 436 | − mutex_lock(&mapping->i_mmap_mutex); | |
| 436 | + i_mmap_lock_write(mapping); | |
| 437 | 437 | if (tmp->vm_flags & VM_SHARED) |
| 438 | 438 | atomic_inc(&mapping->i_mmap_writable); |
| 439 | 439 | flush_dcache_mmap_lock(mapping); |
| @@ -445,7 +445,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) · 5 unmodified lines | ||
| 445 | 445 | vma_interval_tree_insert_after(tmp, mpnt, |
| 446 | 446 | &mapping->i_mmap); |
| 447 | 447 | flush_dcache_mmap_unlock(mapping); |
| 448 | − mutex_unlock(&mapping->i_mmap_mutex); | |
| 448 | + i_mmap_unlock_write(mapping); | |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | /* |