Prev: [PATCH v1 1/10] Move Macro W to insn.h
Next: [PATCH] Netfilter: Fix integer overflow in net/ipv6/netfilter/ip6_tables.c
From: Srikar Dronamraju on 20 Mar 2010 10:30 Enhance replace_page() to support pagecache Currently replace_page would work only for anonymous pages. This patch enhances replace_page() to work for pagecache pages This enhancement is useful for user_bkpt's replace_page based background page replacement for insertion and removal of breakpoints. Signed-off-by: Srikar Dronamraju <srikar(a)linux.vnet.ibm.com> Signed-off-by: Ananth N Mavinakayanahalli <ananth(a)in.ibm.com> --- mm/memory.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 8b3ca1b..cd5541c 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2616,7 +2616,10 @@ int replace_page(struct vm_area_struct *vma, struct page *page, } get_page(kpage); - page_add_anon_rmap(kpage, vma, addr); + if (PageAnon(kpage)) + page_add_anon_rmap(kpage, vma, addr); + else + page_add_file_rmap(kpage); flush_cache_page(vma, addr, pte_pfn(*ptep)); ptep_clear_flush(vma, addr, ptep); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |