Lines 325-342
sendfile_swapin(vm_object_t obj, struct sf_io *sfi
Link Here
|
325 |
count = min(a + 1, npages - i); |
325 |
count = min(a + 1, npages - i); |
326 |
|
326 |
|
327 |
/* |
327 |
/* |
328 |
* We should not pagein into a valid page, thus we first trim |
328 |
* We should not pagein into a valid page because |
329 |
* any valid pages off the end of request, and substitute |
329 |
* there might be still unfinished write tracked by |
330 |
* to bogus_page those, that are in the middle. |
330 |
* e.g. a buffer, thus we substitute any valid pages |
|
|
331 |
* with the bogus one. |
331 |
*/ |
332 |
*/ |
332 |
for (j = i + count - 1; j > i; j--) { |
|
|
333 |
if (vm_page_is_valid(pa[j], vmoff(j, off) & PAGE_MASK, |
334 |
xfsize(j, npages, off, len))) { |
335 |
count--; |
336 |
rhpages = 0; |
337 |
} else |
338 |
break; |
339 |
} |
340 |
for (j = i + 1; j < i + count - 1; j++) |
333 |
for (j = i + 1; j < i + count - 1; j++) |
341 |
if (vm_page_is_valid(pa[j], vmoff(j, off) & PAGE_MASK, |
334 |
if (vm_page_is_valid(pa[j], vmoff(j, off) & PAGE_MASK, |
342 |
xfsize(j, npages, off, len))) { |
335 |
xfsize(j, npages, off, len))) { |