mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
[linux-2.6-microblaze.git] / drivers / oprofile / buffer_sync.c
index ac27f3d..d3b017a 100644 (file)
@@ -91,11 +91,11 @@ munmap_notify(struct notifier_block *self, unsigned long val, void *data)
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *mpnt;
 
-       down_read(&mm->mmap_sem);
+       mmap_read_lock(mm);
 
        mpnt = find_vma(mm, addr);
        if (mpnt && mpnt->vm_file && (mpnt->vm_flags & VM_EXEC)) {
-               up_read(&mm->mmap_sem);
+               mmap_read_unlock(mm);
                /* To avoid latency problems, we only process the current CPU,
                 * hoping that most samples for the task are on this CPU
                 */
@@ -103,7 +103,7 @@ munmap_notify(struct notifier_block *self, unsigned long val, void *data)
                return 0;
        }
 
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
        return 0;
 }
 
@@ -256,7 +256,7 @@ lookup_dcookie(struct mm_struct *mm, unsigned long addr, off_t *offset)
        unsigned long cookie = NO_COOKIE;
        struct vm_area_struct *vma;
 
-       down_read(&mm->mmap_sem);
+       mmap_read_lock(mm);
        for (vma = find_vma(mm, addr); vma; vma = vma->vm_next) {
 
                if (addr < vma->vm_start || addr >= vma->vm_end)
@@ -276,7 +276,7 @@ lookup_dcookie(struct mm_struct *mm, unsigned long addr, off_t *offset)
 
        if (!vma)
                cookie = INVALID_COOKIE;
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
 
        return cookie;
 }