vm_pager.c (15583) | vm_pager.c (15809) |
---|---|
1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * The Mach Operating System project at Carnegie-Mellon University. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 47 unchanged lines hidden (view full) --- 56 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 57 * School of Computer Science 58 * Carnegie Mellon University 59 * Pittsburgh PA 15213-3890 60 * 61 * any improvements or extensions that they make and grant Carnegie the 62 * rights to redistribute these changes. 63 * | 1/* 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * The Mach Operating System project at Carnegie-Mellon University. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 47 unchanged lines hidden (view full) --- 56 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 57 * School of Computer Science 58 * Carnegie Mellon University 59 * Pittsburgh PA 15213-3890 60 * 61 * any improvements or extensions that they make and grant Carnegie the 62 * rights to redistribute these changes. 63 * |
64 * $Id: vm_pager.c,v 1.21 1995/12/14 09:55:11 phk Exp $ | 64 * $Id: vm_pager.c,v 1.22 1996/05/03 21:01:53 phk Exp $ |
65 */ 66 67/* 68 * Paging space routine stubs. Emulates a matchmaker-like interface 69 * for builtin pagers. 70 */ 71 72#include <sys/param.h> --- 171 unchanged lines hidden (view full) --- 244 245vm_object_t 246vm_pager_object_lookup(pg_list, handle) 247 register struct pagerlst *pg_list; 248 void *handle; 249{ 250 register vm_object_t object; 251 | 65 */ 66 67/* 68 * Paging space routine stubs. Emulates a matchmaker-like interface 69 * for builtin pagers. 70 */ 71 72#include <sys/param.h> --- 171 unchanged lines hidden (view full) --- 244 245vm_object_t 246vm_pager_object_lookup(pg_list, handle) 247 register struct pagerlst *pg_list; 248 void *handle; 249{ 250 register vm_object_t object; 251 |
252 for (object = pg_list->tqh_first; object != NULL; object = object->pager_object_list.tqe_next) | 252 for (object = TAILQ_FIRST(pg_list); object != NULL; object = TAILQ_NEXT(object,pager_object_list)) |
253 if (object->handle == handle) 254 return (object); 255 return (NULL); 256} 257 258/* 259 * This routine loses a reference to the object - 260 * thus a reference must be gained before calling. --- 22 unchanged lines hidden (view full) --- 283struct buf * 284getpbuf() 285{ 286 int s; 287 struct buf *bp; 288 289 s = splbio(); 290 /* get a bp from the swap buffer header pool */ | 253 if (object->handle == handle) 254 return (object); 255 return (NULL); 256} 257 258/* 259 * This routine loses a reference to the object - 260 * thus a reference must be gained before calling. --- 22 unchanged lines hidden (view full) --- 283struct buf * 284getpbuf() 285{ 286 int s; 287 struct buf *bp; 288 289 s = splbio(); 290 /* get a bp from the swap buffer header pool */ |
291 while ((bp = bswlist.tqh_first) == NULL) { | 291 while ((bp = TAILQ_FIRST(&bswlist)) == NULL) { |
292 bswneeded = 1; 293 tsleep(&bswneeded, PVM, "wswbuf", 0); 294 } 295 TAILQ_REMOVE(&bswlist, bp, b_freelist); 296 splx(s); 297 298 bzero(bp, sizeof *bp); 299 bp->b_rcred = NOCRED; --- 8 unchanged lines hidden (view full) --- 308 */ 309struct buf * 310trypbuf() 311{ 312 int s; 313 struct buf *bp; 314 315 s = splbio(); | 292 bswneeded = 1; 293 tsleep(&bswneeded, PVM, "wswbuf", 0); 294 } 295 TAILQ_REMOVE(&bswlist, bp, b_freelist); 296 splx(s); 297 298 bzero(bp, sizeof *bp); 299 bp->b_rcred = NOCRED; --- 8 unchanged lines hidden (view full) --- 308 */ 309struct buf * 310trypbuf() 311{ 312 int s; 313 struct buf *bp; 314 315 s = splbio(); |
316 if ((bp = bswlist.tqh_first) == NULL) { | 316 if ((bp = TAILQ_FIRST(&bswlist)) == NULL) { |
317 splx(s); 318 return NULL; 319 } 320 TAILQ_REMOVE(&bswlist, bp, b_freelist); 321 splx(s); 322 323 bzero(bp, sizeof *bp); 324 bp->b_rcred = NOCRED; --- 39 unchanged lines hidden --- | 317 splx(s); 318 return NULL; 319 } 320 TAILQ_REMOVE(&bswlist, bp, b_freelist); 321 splx(s); 322 323 bzero(bp, sizeof *bp); 324 bp->b_rcred = NOCRED; --- 39 unchanged lines hidden --- |