X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mm%2Ffremap.c;h=84a13b30fd6f8a9ca2a416bc1320729ffd7ab2bb;hb=refs%2Fheads%2Fvserver;hp=f7b6e22163ca316891e77660f239f452f8cfc95b;hpb=e0ff8aa1acd079b70e796571917ae0449b7c465b;p=linux-2.6.git diff --git a/mm/fremap.c b/mm/fremap.c index f7b6e2216..84a13b30f 100644 --- a/mm/fremap.c +++ b/mm/fremap.c @@ -40,7 +40,7 @@ static int zap_pte(struct mm_struct *mm, struct vm_area_struct *vma, } else { if (!pte_file(pte)) free_swap_and_cache(pte_to_swp_entry(pte)); - pte_clear(mm, addr, ptep); + pte_clear_not_present_full(mm, addr, ptep, 0); } return !!page; } @@ -68,17 +68,15 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma, * caller about it. */ err = -EINVAL; - if (vma->vm_file) { - inode = vma->vm_file->f_mapping->host; - size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; - if (!page->mapping || page->index >= size) - goto unlock; - err = -ENOMEM; - if (page_mapcount(page) > INT_MAX/2) - goto unlock; - if (!vx_rsspages_avail(mm, 1)) - goto unlock; - } + inode = vma->vm_file->f_mapping->host; + size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; + if (!page->mapping || page->index >= size) + goto unlock; + err = -ENOMEM; + if (page_mapcount(page) > INT_MAX/2) + goto unlock; + if (!vx_rss_avail(mm, 1)) + goto unlock; if (pte_none(*pte) || !zap_pte(mm, vma, addr, pte)) inc_mm_counter(mm, file_rss); @@ -106,7 +104,6 @@ int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, { int err = -ENOMEM; pte_t *pte; - pte_t pte_val; spinlock_t *ptl; pte = get_locked_pte(mm, addr, &ptl); @@ -119,7 +116,6 @@ int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, } set_pte_at(mm, addr, pte, pgoff_to_pte(pgoff)); - pte_val = *pte; /* * We don't need to run update_mmu_cache() here because the "file pte" * being installed by install_file_pte() is not a real pte - it's a