phys_pager.c (2f7af3db57828addd56306981dd2c3ba694f35e3) phys_pager.c (e265f0541499481644440622fbc8cb980436a52c)
1/*
2 * Copyright (c) 2000 Peter Wemm
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 119 unchanged lines hidden (view full) ---

128
129 if (object->handle != NULL) {
130 mtx_lock(&phys_pager_mtx);
131 TAILQ_REMOVE(&phys_pager_object_list, object, pager_object_list);
132 mtx_unlock(&phys_pager_mtx);
133 }
134}
135
1/*
2 * Copyright (c) 2000 Peter Wemm
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 119 unchanged lines hidden (view full) ---

128
129 if (object->handle != NULL) {
130 mtx_lock(&phys_pager_mtx);
131 TAILQ_REMOVE(&phys_pager_object_list, object, pager_object_list);
132 mtx_unlock(&phys_pager_mtx);
133 }
134}
135
136/*
137 * Fill as many pages as vm_fault has allocated for us.
138 */
136static int
137phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage)
138{
139static int
140phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage)
141{
139 int i, s;
142 int i;
140
143
141 s = splvm();
144 VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
142 vm_page_lock_queues();
145 vm_page_lock_queues();
143 /*
144 * Fill as many pages as vm_fault has allocated for us.
145 */
146 for (i = 0; i < count; i++) {
147 if ((m[i]->flags & PG_ZERO) == 0) {
148 vm_page_unlock_queues();
149 pmap_zero_page(m[i]);
150 vm_page_lock_queues();
151 }
152 vm_page_flag_set(m[i], PG_ZERO);
153 /* Switch off pv_entries */
154 vm_page_unmanage(m[i]);
155 m[i]->valid = VM_PAGE_BITS_ALL;
156 m[i]->dirty = 0;
157 /* The requested page must remain busy, the others not. */
158 if (reqpage != i) {
159 vm_page_flag_clear(m[i], PG_BUSY);
160 m[i]->busy = 0;
161 }
162 }
163 vm_page_unlock_queues();
146 for (i = 0; i < count; i++) {
147 if ((m[i]->flags & PG_ZERO) == 0) {
148 vm_page_unlock_queues();
149 pmap_zero_page(m[i]);
150 vm_page_lock_queues();
151 }
152 vm_page_flag_set(m[i], PG_ZERO);
153 /* Switch off pv_entries */
154 vm_page_unmanage(m[i]);
155 m[i]->valid = VM_PAGE_BITS_ALL;
156 m[i]->dirty = 0;
157 /* The requested page must remain busy, the others not. */
158 if (reqpage != i) {
159 vm_page_flag_clear(m[i], PG_BUSY);
160 m[i]->busy = 0;
161 }
162 }
163 vm_page_unlock_queues();
164 splx(s);
165
166 return (VM_PAGER_OK);
167}
168
169static void
170phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync,
171 int *rtvals)
172{
173

--- 36 unchanged lines hidden ---
164 return (VM_PAGER_OK);
165}
166
167static void
168phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync,
169 int *rtvals)
170{
171

--- 36 unchanged lines hidden ---