X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=mm%2Frmap.c;h=304f51985c78504cb67056922bfd2bb7c34a6e21;hb=8bb7844286fb8c9fce6f65d8288aeb09d03a5e0d;hp=22ed3f71a67421831f12b0deffa915eacf5d1db7;hpb=c207908fcc451e31d7fbba31541bd04f93787eb4;p=powerpc.git diff --git a/mm/rmap.c b/mm/rmap.c index 22ed3f71a6..304f51985c 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -162,8 +162,7 @@ void anon_vma_unlink(struct vm_area_struct *vma) static void anon_vma_ctor(void *data, struct kmem_cache *cachep, unsigned long flags) { - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == - SLAB_CTOR_CONSTRUCTOR) { + if (flags & SLAB_CTOR_CONSTRUCTOR) { struct anon_vma *anon_vma = data; spin_lock_init(&anon_vma->lock); @@ -498,12 +497,15 @@ int page_mkclean(struct page *page) struct address_space *mapping = page_mapping(page); if (mapping) ret = page_mkclean_file(mapping, page); + if (page_test_dirty(page)) { + page_clear_dirty(page); + ret = 1; + } } - if (page_test_and_clear_dirty(page)) - ret = 1; return ret; } +EXPORT_SYMBOL_GPL(page_mkclean); /** * page_set_anon_rmap - setup new anonymous rmap @@ -605,8 +607,10 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma) * Leaving it set also helps swapoff to reinstate ptes * faster for those pages still in swapcache. */ - if (page_test_and_clear_dirty(page)) + if (page_test_dirty(page)) { + page_clear_dirty(page); set_page_dirty(page); + } __dec_zone_page_state(page, PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED); }