mmap locking API: convert mmap_sem comments
[sfrench/cifs-2.6.git] / drivers / oprofile / buffer_sync.c
index ac27f3d3fbb42bf83747ec92d9bf4ba03d62e071..4d7695289edaac57bdea913a8c5942dfe58948f3 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;
 }
@@ -486,7 +486,7 @@ typedef enum {
 
 /* Sync one of the CPU's buffers into the global event buffer.
  * Here we need to go through each batch of samples punctuated
- * by context switch notes, taking the task's mmap_sem and doing
+ * by context switch notes, taking the task's mmap_lock and doing
  * lookup in task->mm->mmap to convert EIP into dcookie/offset
  * value.
  */