nfs_clbio.c (668ee1016865dcde796cc57b1c1e7c35b85f41d1) | nfs_clbio.c (0012f373e43db2341c20329163ed2d5ad3b0f341) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Rick Macklem at The University of Guelph. --- 160 unchanged lines hidden (view full) --- 169 /* 170 * If the requested page is partially valid, just return it and 171 * allow the pager to zero-out the blanks. Partially valid pages 172 * can only occur at the file EOF. 173 * 174 * XXXGL: is that true for NFS, where short read can occur??? 175 */ 176 VM_OBJECT_WLOCK(object); | 1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Rick Macklem at The University of Guelph. --- 160 unchanged lines hidden (view full) --- 169 /* 170 * If the requested page is partially valid, just return it and 171 * allow the pager to zero-out the blanks. Partially valid pages 172 * can only occur at the file EOF. 173 * 174 * XXXGL: is that true for NFS, where short read can occur??? 175 */ 176 VM_OBJECT_WLOCK(object); |
177 if (pages[npages - 1]->valid != 0 && --npages == 0) | 177 if (!vm_page_none_valid(pages[npages - 1]) && --npages == 0) |
178 goto out; 179 VM_OBJECT_WUNLOCK(object); 180 181 /* 182 * We use only the kva address for the buffer, but this is extremely 183 * convenient and fast. 184 */ 185 bp = uma_zalloc(ncl_pbuf_zone, M_WAITOK); --- 36 unchanged lines hidden (view full) --- 222 vm_page_t m; 223 nextoff = toff + PAGE_SIZE; 224 m = pages[i]; 225 226 if (nextoff <= size) { 227 /* 228 * Read operation filled an entire page 229 */ | 178 goto out; 179 VM_OBJECT_WUNLOCK(object); 180 181 /* 182 * We use only the kva address for the buffer, but this is extremely 183 * convenient and fast. 184 */ 185 bp = uma_zalloc(ncl_pbuf_zone, M_WAITOK); --- 36 unchanged lines hidden (view full) --- 222 vm_page_t m; 223 nextoff = toff + PAGE_SIZE; 224 m = pages[i]; 225 226 if (nextoff <= size) { 227 /* 228 * Read operation filled an entire page 229 */ |
230 m->valid = VM_PAGE_BITS_ALL; | 230 vm_page_valid(m); |
231 KASSERT(m->dirty == 0, 232 ("nfs_getpages: page %p is dirty", m)); 233 } else if (size > toff) { 234 /* 235 * Read operation filled a partial page. 236 */ | 231 KASSERT(m->dirty == 0, 232 ("nfs_getpages: page %p is dirty", m)); 233 } else if (size > toff) { 234 /* 235 * Read operation filled a partial page. 236 */ |
237 m->valid = 0; | 237 vm_page_invalid(m); |
238 vm_page_set_valid_range(m, 0, size - toff); 239 KASSERT(m->dirty == 0, 240 ("nfs_getpages: page %p is dirty", m)); 241 } else { 242 /* 243 * Read operation was short. If no error 244 * occurred we may have hit a zero-fill 245 * section. We leave valid set to 0, and page --- 1629 unchanged lines hidden --- | 238 vm_page_set_valid_range(m, 0, size - toff); 239 KASSERT(m->dirty == 0, 240 ("nfs_getpages: page %p is dirty", m)); 241 } else { 242 /* 243 * Read operation was short. If no error 244 * occurred we may have hit a zero-fill 245 * section. We leave valid set to 0, and page --- 1629 unchanged lines hidden --- |