History

mm: use new helper functions around the i_mmap_mutex

Convert all open coded mutex_lock/unlock calls to the i_mmap_[lock/unlock]_write() helpers.

Davidlohr Bueso committed 11 years ago

Commit 83cde9e1 parent 8b28f6212 files · +40 −40Browse files

Showing the changes to kernel (2 of 12 files). Show all

Unified · Split

2 files
  1. kernel/events/uprobes.c +2 −2
  2. kernel/fork.c +2 −2
kernel/events/uprobes.c+2−2
@@ -724,7 +724,7 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register) · 723 unmodified lines
724724 int more = 0;
725725
726726 again:
727− mutex_lock(&mapping->i_mmap_mutex);
727+ i_mmap_lock_write(mapping);
728728 vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) {
729729 if (!valid_vma(vma, is_register))
730730 continue;
@@ -755,7 +755,7 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register) · 24 unmodified lines
755755 info->mm = vma->vm_mm;
756756 info->vaddr = offset_to_vaddr(vma, offset);
757757 }
758− mutex_unlock(&mapping->i_mmap_mutex);
758+ i_mmap_unlock_write(mapping);
759759
760760 if (!more)
761761 goto out;
kernel/fork.c+2−2
@@ -433,7 +433,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) · 432 unmodified lines
433433 get_file(file);
434434 if (tmp->vm_flags & VM_DENYWRITE)
435435 atomic_dec(&inode->i_writecount);
436− mutex_lock(&mapping->i_mmap_mutex);
436+ i_mmap_lock_write(mapping);
437437 if (tmp->vm_flags & VM_SHARED)
438438 atomic_inc(&mapping->i_mmap_writable);
439439 flush_dcache_mmap_lock(mapping);
@@ -445,7 +445,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) · 5 unmodified lines
445445 vma_interval_tree_insert_after(tmp, mpnt,
446446 &mapping->i_mmap);
447447 flush_dcache_mmap_unlock(mapping);
448− mutex_unlock(&mapping->i_mmap_mutex);
448+ i_mmap_unlock_write(mapping);
449449 }
450450
451451 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t