default_pager.c (282660) | default_pager.c (292373) |
---|---|
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 --- 24 unchanged lines hidden (view full) --- 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 40#include <sys/cdefs.h> | 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 --- 24 unchanged lines hidden (view full) --- 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 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/sys/vm/default_pager.c 282660 2015-05-08 19:43:37Z jhb $"); | 41__FBSDID("$FreeBSD: head/sys/vm/default_pager.c 292373 2015-12-16 21:30:45Z glebius $"); |
42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/lock.h> 46#include <sys/proc.h> 47#include <sys/resourcevar.h> 48#include <sys/rwlock.h> 49 50#include <vm/vm.h> 51#include <vm/vm_object.h> 52#include <vm/vm_page.h> 53#include <vm/vm_pager.h> 54#include <vm/swap_pager.h> 55 56static vm_object_t default_pager_alloc(void *, vm_ooffset_t, vm_prot_t, 57 vm_ooffset_t, struct ucred *); 58static void default_pager_dealloc(vm_object_t); | 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/lock.h> 46#include <sys/proc.h> 47#include <sys/resourcevar.h> 48#include <sys/rwlock.h> 49 50#include <vm/vm.h> 51#include <vm/vm_object.h> 52#include <vm/vm_page.h> 53#include <vm/vm_pager.h> 54#include <vm/swap_pager.h> 55 56static vm_object_t default_pager_alloc(void *, vm_ooffset_t, vm_prot_t, 57 vm_ooffset_t, struct ucred *); 58static void default_pager_dealloc(vm_object_t); |
59static int default_pager_getpages(vm_object_t, vm_page_t *, int, int); | 59static int default_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); |
60static void default_pager_putpages(vm_object_t, vm_page_t *, int, 61 boolean_t, int *); 62static boolean_t default_pager_haspage(vm_object_t, vm_pindex_t, int *, 63 int *); 64/* 65 * pagerops for OBJT_DEFAULT - "default pager". 66 */ 67struct pagerops defaultpagerops = { --- 49 unchanged lines hidden (view full) --- 117} 118 119/* 120 * Load pages from backing store. Since OBJT_DEFAULT is converted to 121 * OBJT_SWAP at the time a swap-backed vm_page_t is freed, we will never 122 * see a vm_page with assigned swap here. 123 */ 124static int | 60static void default_pager_putpages(vm_object_t, vm_page_t *, int, 61 boolean_t, int *); 62static boolean_t default_pager_haspage(vm_object_t, vm_pindex_t, int *, 63 int *); 64/* 65 * pagerops for OBJT_DEFAULT - "default pager". 66 */ 67struct pagerops defaultpagerops = { --- 49 unchanged lines hidden (view full) --- 117} 118 119/* 120 * Load pages from backing store. Since OBJT_DEFAULT is converted to 121 * OBJT_SWAP at the time a swap-backed vm_page_t is freed, we will never 122 * see a vm_page with assigned swap here. 123 */ 124static int |
125default_pager_getpages(object, m, count, reqpage) 126 vm_object_t object; 127 vm_page_t *m; 128 int count; 129 int reqpage; | 125default_pager_getpages(vm_object_t object, vm_page_t *m, int count, 126 int *rbehind, int *rahead) |
130{ | 127{ |
131 return VM_PAGER_FAIL; | 128 129 return (VM_PAGER_FAIL); |
132} 133 134/* 135 * Store pages to backing store. We should assign swap and initiate 136 * I/O. We do not actually convert the object to OBJT_SWAP here. The 137 * object will be converted when the written-out vm_page_t is moved from the 138 * cache to the free list. 139 */ --- 30 unchanged lines hidden --- | 130} 131 132/* 133 * Store pages to backing store. We should assign swap and initiate 134 * I/O. We do not actually convert the object to OBJT_SWAP here. The 135 * object will be converted when the written-out vm_page_t is moved from the 136 * cache to the free list. 137 */ --- 30 unchanged lines hidden --- |