swap_pager.c (e911eafcbae5366e66f9560ca18bf60c5f8157a4) | swap_pager.c (aa8de40ae504c80301d07b7a4cfa74359792cc72) |
---|---|
1/* 2 * Copyright (c) 1994 John S. Dyson 3 * Copyright (c) 1990 University of Utah. 4 * Copyright (c) 1991, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * the Systems Programming Group of the University of Utah Computer --- 25 unchanged lines hidden (view full) --- 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ 40 * 41 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 | 1/* 2 * Copyright (c) 1994 John S. Dyson 3 * Copyright (c) 1990 University of Utah. 4 * Copyright (c) 1991, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * the Systems Programming Group of the University of Utah Computer --- 25 unchanged lines hidden (view full) --- 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ 40 * 41 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 |
42 * $Id: swap_pager.c,v 1.63 1996/03/06 04:31:46 dyson Exp $ | 42 * $Id: swap_pager.c,v 1.64 1996/05/02 14:21:14 phk Exp $ |
43 */ 44 45/* 46 * Quick hack to page to dedicated partition(s). 47 * TODO: 48 * Add multiprocessor locks 49 * Deal with async writes in a better fashion 50 */ --- 248 unchanged lines hidden (view full) --- 299 /* 300 * XXX - there is a race condition here. Two processes 301 * can request the same named object simultaneuously, 302 * and if one blocks for memory, the result is a disaster. 303 * Probably quite rare, but is yet another reason to just 304 * rip support of "named anonymous regions" out altogether. 305 */ 306 object = vm_object_allocate(OBJT_SWAP, | 43 */ 44 45/* 46 * Quick hack to page to dedicated partition(s). 47 * TODO: 48 * Add multiprocessor locks 49 * Deal with async writes in a better fashion 50 */ --- 248 unchanged lines hidden (view full) --- 299 /* 300 * XXX - there is a race condition here. Two processes 301 * can request the same named object simultaneuously, 302 * and if one blocks for memory, the result is a disaster. 303 * Probably quite rare, but is yet another reason to just 304 * rip support of "named anonymous regions" out altogether. 305 */ 306 object = vm_object_allocate(OBJT_SWAP, |
307 OFF_TO_IDX(offset + PAGE_SIZE - 1) + size); | 307 OFF_TO_IDX(offset + PAGE_MASK) + size); |
308 object->handle = handle; 309 (void) swap_pager_swp_alloc(object, M_WAITOK); 310 } 311 } else { 312 object = vm_object_allocate(OBJT_SWAP, | 308 object->handle = handle; 309 (void) swap_pager_swp_alloc(object, M_WAITOK); 310 } 311 } else { 312 object = vm_object_allocate(OBJT_SWAP, |
313 OFF_TO_IDX(offset + PAGE_SIZE - 1) + size); | 313 OFF_TO_IDX(offset + PAGE_MASK) + size); |
314 (void) swap_pager_swp_alloc(object, M_WAITOK); 315 } 316 317 return (object); 318} 319 320/* 321 * returns disk block associated with pager and offset --- 1311 unchanged lines hidden --- | 314 (void) swap_pager_swp_alloc(object, M_WAITOK); 315 } 316 317 return (object); 318} 319 320/* 321 * returns disk block associated with pager and offset --- 1311 unchanged lines hidden --- |