- unsigned long address, len;
- for (; vma ; vma = vma->vm_next_share) {
- if (last >> PAGE_SHIFT < vma->vm_pgoff)
- continue;
- if (first >> PAGE_CACHE_SHIFT > (vma->vm_pgoff +
- ((vma->vm_end - vma->vm_start) >> PAGE_CACHE_SHIFT)))
- continue;
-
- /* XXX in case of unmap the cow pages of a running file,
- * don't unmap these private writeable mapping here!
- * though that will break private mappping a little.
- *
- * the clean way is to check the mapping of every page
- * and just unmap the non-cow pages, just like
- * unmap_mapping_range() with even_cow=0 in kernel 2.6.
- */
- if (!(vma->vm_flags & VM_SHARED) &&
- (vma->vm_flags & VM_WRITE))
- continue;
-
- address = max((unsigned long)vma->vm_start,
- file_to_user(vma, first));
- len = min((unsigned long)vma->vm_end,
- file_to_user(vma, last) + 1) - address;
-
- VMA_DEBUG(vma, "zapping vma [first="LPU64" last="LPU64" "
- "address=%ld len=%ld]\n", first, last, address, len);
- LASSERT(len > 0);
- ll_zap_page_range(vma, address, len);
- }
+ int rc = 0;
+ ENTRY;
+
+ /* always set nonblock as true to avoid page read ahead */
+ rc = filemap_populate(area, address, len, prot, pgoff, 1);
+ RETURN(rc);