mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
[linux-2.6-microblaze.git] / kernel / bpf / stackmap.c
index 7b8381c..a13b7e2 100644 (file)
@@ -317,7 +317,7 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,
         * with build_id.
         */
        if (!user || !current || !current->mm || irq_work_busy ||
-           down_read_trylock(&current->mm->mmap_sem) == 0) {
+           mmap_read_trylock(current->mm) == 0) {
                /* cannot access current->mm, fall back to ips */
                for (i = 0; i < trace_nr; i++) {
                        id_offs[i].status = BPF_STACK_BUILD_ID_IP;
@@ -342,7 +342,7 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,
        }
 
        if (!work) {
-               up_read(&current->mm->mmap_sem);
+               mmap_read_unlock(current->mm);
        } else {
                work->sem = &current->mm->mmap_sem;
                irq_work_queue(&work->irq_work);