umem.c (255972) | umem.c (263620) |
---|---|
1/* 2 * Copyright (c) 2005 Topspin Communications. All rights reserved. 3 * Copyright (c) 2005 Cisco Systems. All rights reserved. 4 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 5 * 6 * This software is available to you under a choice of one of two 7 * licenses. You may choose to be licensed under the terms of the GNU 8 * General Public License (GPL) Version 2, available from the file --- 333 unchanged lines hidden (view full) --- 342 if (ptoa(npages + 343 pmap_wired_count(vm_map_pmap(&proc->p_vmspace->vm_map))) > 344 lim_cur(proc, RLIMIT_MEMLOCK)) { 345 PROC_UNLOCK(proc); 346 kfree(umem); 347 return ERR_PTR(-ENOMEM); 348 } 349 PROC_UNLOCK(proc); | 1/* 2 * Copyright (c) 2005 Topspin Communications. All rights reserved. 3 * Copyright (c) 2005 Cisco Systems. All rights reserved. 4 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 5 * 6 * This software is available to you under a choice of one of two 7 * licenses. You may choose to be licensed under the terms of the GNU 8 * General Public License (GPL) Version 2, available from the file --- 333 unchanged lines hidden (view full) --- 342 if (ptoa(npages + 343 pmap_wired_count(vm_map_pmap(&proc->p_vmspace->vm_map))) > 344 lim_cur(proc, RLIMIT_MEMLOCK)) { 345 PROC_UNLOCK(proc); 346 kfree(umem); 347 return ERR_PTR(-ENOMEM); 348 } 349 PROC_UNLOCK(proc); |
350 if (npages + cnt.v_wire_count > vm_page_max_wired) { | 350 if (npages + vm_cnt.v_wire_count > vm_page_max_wired) { |
351 kfree(umem); 352 return ERR_PTR(-EAGAIN); 353 } 354 error = vm_map_wire(&proc->p_vmspace->vm_map, start, end, 355 VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES | 356 (umem->writable ? VM_MAP_WIRE_WRITE : 0)); 357 if (error != KERN_SUCCESS) { 358 kfree(umem); --- 217 unchanged lines hidden --- | 351 kfree(umem); 352 return ERR_PTR(-EAGAIN); 353 } 354 error = vm_map_wire(&proc->p_vmspace->vm_map, start, end, 355 VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES | 356 (umem->writable ? VM_MAP_WIRE_WRITE : 0)); 357 if (error != KERN_SUCCESS) { 358 kfree(umem); --- 217 unchanged lines hidden --- |