nfs_clbio.c (eb00b276ab2a5a549620ec3fe92c22fd0ddf948e) nfs_clbio.c (03679e233408833452145f89f49c5929842140d0)
1/*-
2 * Copyright (c) 1989, 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 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

191
192 size = count - uio.uio_resid;
193 VM_OBJECT_LOCK(object);
194 for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
195 vm_page_t m;
196 nextoff = toff + PAGE_SIZE;
197 m = pages[i];
198
1/*-
2 * Copyright (c) 1989, 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 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

191
192 size = count - uio.uio_resid;
193 VM_OBJECT_LOCK(object);
194 for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
195 vm_page_t m;
196 nextoff = toff + PAGE_SIZE;
197 m = pages[i];
198
199 vm_page_lock(m);
200 vm_page_lock_queues();
201
202 if (nextoff <= size) {
203 /*
204 * Read operation filled an entire page
205 */
206 m->valid = VM_PAGE_BITS_ALL;
207 KASSERT(m->dirty == 0,
208 ("nfs_getpages: page %p is dirty", m));
209 } else if (size > toff) {

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

231 * deactivating pages is best.
232 */
233
234 /*
235 * Just in case someone was asking for this page we
236 * now tell them that it is ok to use.
237 */
238 if (!error) {
199 if (nextoff <= size) {
200 /*
201 * Read operation filled an entire page
202 */
203 m->valid = VM_PAGE_BITS_ALL;
204 KASSERT(m->dirty == 0,
205 ("nfs_getpages: page %p is dirty", m));
206 } else if (size > toff) {

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

228 * deactivating pages is best.
229 */
230
231 /*
232 * Just in case someone was asking for this page we
233 * now tell them that it is ok to use.
234 */
235 if (!error) {
239 if (m->oflags & VPO_WANTED)
236 if (m->oflags & VPO_WANTED) {
237 vm_page_lock(m);
240 vm_page_activate(m);
238 vm_page_activate(m);
241 else
239 vm_page_unlock(m);
240 } else {
241 vm_page_lock(m);
242 vm_page_deactivate(m);
242 vm_page_deactivate(m);
243 vm_page_unlock(m);
244 }
243 vm_page_wakeup(m);
244 } else {
245 vm_page_wakeup(m);
246 } else {
247 vm_page_lock(m);
245 vm_page_free(m);
248 vm_page_free(m);
249 vm_page_unlock(m);
246 }
247 }
250 }
251 }
248
249 vm_page_unlock_queues();
250 vm_page_unlock(m);
251 }
252 VM_OBJECT_UNLOCK(object);
253 return (0);
254}
255
256/*
257 * Vnode op for VM putpages.
258 */

--- 1584 unchanged lines hidden ---
252 }
253 VM_OBJECT_UNLOCK(object);
254 return (0);
255}
256
257/*
258 * Vnode op for VM putpages.
259 */

--- 1584 unchanged lines hidden ---