default_pager.c (79224) | default_pager.c (92029) |
---|---|
1/* 2 * Copyright (c) 1995, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * The default pager is responsible for supplying backing store to unbacked 32 * storage. The backing store is usually swap so we just fall through to 33 * the swap routines. However, since swap metadata has not been assigned, 34 * the swap routines assign and manage the swap backing store through the 35 * vm_page->swapblk field. The object is only converted when the page is 36 * physically freed after having been cleaned and even then vm_page->swapblk 37 * is maintained whenever a resident page also has swap backing store. 38 * | 1/* 2 * Copyright (c) 1995, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * The default pager is responsible for supplying backing store to unbacked 32 * storage. The backing store is usually swap so we just fall through to 33 * the swap routines. However, since swap metadata has not been assigned, 34 * the swap routines assign and manage the swap backing store through the 35 * vm_page->swapblk field. The object is only converted when the page is 36 * physically freed after having been cleaned and even then vm_page->swapblk 37 * is maintained whenever a resident page also has swap backing store. 38 * |
39 * $FreeBSD: head/sys/vm/default_pager.c 79224 2001-07-04 16:20:28Z dillon $ | 39 * $FreeBSD: head/sys/vm/default_pager.c 92029 2002-03-10 21:52:48Z eivind $ |
40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/lock.h> 45#include <sys/proc.h> 46#include <sys/mutex.h> 47 --- 40 unchanged lines hidden (view full) --- 88 89/* 90 * deallocate resources associated with default objects. The default objects 91 * have no special resources allocated to them, but the vm_page's being used 92 * in this object might. Still, we do not have to do anything - we will free 93 * the swapblk in the underlying vm_page's when we free the vm_page or 94 * garbage collect the vm_page cache list. 95 */ | 40 */ 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/lock.h> 45#include <sys/proc.h> 46#include <sys/mutex.h> 47 --- 40 unchanged lines hidden (view full) --- 88 89/* 90 * deallocate resources associated with default objects. The default objects 91 * have no special resources allocated to them, but the vm_page's being used 92 * in this object might. Still, we do not have to do anything - we will free 93 * the swapblk in the underlying vm_page's when we free the vm_page or 94 * garbage collect the vm_page cache list. 95 */ |
96 | |
97static void 98default_pager_dealloc(object) 99 vm_object_t object; 100{ 101 /* 102 * OBJT_DEFAULT objects have no special resources allocated to them. 103 */ 104} 105 106/* 107 * Load pages from backing store. Since OBJT_DEFAULT is converted to 108 * OBJT_SWAP at the time a swap-backed vm_page_t is freed, we will never 109 * see a vm_page with assigned swap here. 110 */ | 96static void 97default_pager_dealloc(object) 98 vm_object_t object; 99{ 100 /* 101 * OBJT_DEFAULT objects have no special resources allocated to them. 102 */ 103} 104 105/* 106 * Load pages from backing store. Since OBJT_DEFAULT is converted to 107 * OBJT_SWAP at the time a swap-backed vm_page_t is freed, we will never 108 * see a vm_page with assigned swap here. 109 */ |
111 | |
112static int 113default_pager_getpages(object, m, count, reqpage) 114 vm_object_t object; 115 vm_page_t *m; 116 int count; 117 int reqpage; 118{ 119 return VM_PAGER_FAIL; 120} 121 122/* 123 * Store pages to backing store. We should assign swap and initiate 124 * I/O. We do not actually convert the object to OBJT_SWAP here. The 125 * object will be converted when the written-out vm_page_t is moved from the 126 * cache to the free list. 127 */ | 110static int 111default_pager_getpages(object, m, count, reqpage) 112 vm_object_t object; 113 vm_page_t *m; 114 int count; 115 int reqpage; 116{ 117 return VM_PAGER_FAIL; 118} 119 120/* 121 * Store pages to backing store. We should assign swap and initiate 122 * I/O. We do not actually convert the object to OBJT_SWAP here. The 123 * object will be converted when the written-out vm_page_t is moved from the 124 * cache to the free list. 125 */ |
128 | |
129static void 130default_pager_putpages(object, m, c, sync, rtvals) 131 vm_object_t object; 132 vm_page_t *m; 133 int c; 134 boolean_t sync; 135 int *rtvals; 136{ --- 7 unchanged lines hidden (view full) --- 144 * the page to its backing store, or if no backing store has been assigned, 145 * it is not yet synchronized. 146 * 147 * It is possible to have fully-synchronized swap assigned without the 148 * object having been converted. We just call swap_pager_haspage() to 149 * deal with it since it must already deal with it plus deal with swap 150 * meta-data structures. 151 */ | 126static void 127default_pager_putpages(object, m, c, sync, rtvals) 128 vm_object_t object; 129 vm_page_t *m; 130 int c; 131 boolean_t sync; 132 int *rtvals; 133{ --- 7 unchanged lines hidden (view full) --- 141 * the page to its backing store, or if no backing store has been assigned, 142 * it is not yet synchronized. 143 * 144 * It is possible to have fully-synchronized swap assigned without the 145 * object having been converted. We just call swap_pager_haspage() to 146 * deal with it since it must already deal with it plus deal with swap 147 * meta-data structures. 148 */ |
152 | |
153static boolean_t 154default_pager_haspage(object, pindex, before, after) 155 vm_object_t object; 156 vm_pindex_t pindex; 157 int *before; 158 int *after; 159{ 160 return FALSE; 161} 162 | 149static boolean_t 150default_pager_haspage(object, pindex, before, after) 151 vm_object_t object; 152 vm_pindex_t pindex; 153 int *before; 154 int *after; 155{ 156 return FALSE; 157} 158 |