-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-/* [first, last] are the byte offsets affected.
- * vm_{start, end} are user addresses of the first byte of the mapping and
- * the next byte beyond it
- * vm_pgoff is the page index of the first byte in the mapping */
-static void teardown_vmas(struct vm_area_struct *vma, __u64 first,
- __u64 last)
-{
- unsigned long address, len;
- for (; vma ; vma = vma->vm_next_share) {
- if (last >> CFS_PAGE_SHIFT < vma->vm_pgoff)
- continue;
- if (first >> CFS_PAGE_SHIFT >= (vma->vm_pgoff +
- ((vma->vm_end - vma->vm_start) >> CFS_PAGE_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);
- }
-}
-#endif
-