diff for duplicates of <20100713102110.2835.14816.sendpatchset@danny.redhat> diff --git a/a/1.txt b/N1/1.txt index 1867b72..819efbf 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -120,9 +120,3 @@ index a7baef1..d8a05e4 100644 */ -- 1.7.1.1 - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N1/content_digest index 0628336..b2409e1 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -137,12 +137,6 @@ " * reference on the swaphandle, it doesn't matter if it becomes unused.\n" " */\n" "-- \n" - "1.7.1.1\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" + 1.7.1.1 -48d10432ca8228acc18ff812032b010a3d379b44e8f1fad4770c6aff1481c052 +4ec13247db70b414a96ed73b223aa4ef003c9b6c44be3250643405f040b00a80
diff --git a/a/1.txt b/N2/1.txt index 1867b72..8b13789 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -1,128 +1 @@ ->From 50e813068c51de733bbbdd04eb4af9c43919cd57 Mon Sep 17 00:00:00 2001 -From: Xiaotian Feng <dfeng@redhat.com> -Date: Tue, 13 Jul 2010 13:09:50 +0800 -Subject: [PATCH 23/30] mm: methods for teaching filesystems about PG_swapcache pages -In order to teach filesystems to handle swap cache pages, three new page -functions are introduced: - - pgoff_t page_file_index(struct page *); - loff_t page_file_offset(struct page *); - struct address_space *page_file_mapping(struct page *); - -page_file_index() - gives the offset of this page in the file in -PAGE_CACHE_SIZE blocks. Like page->index is for mapped pages, this function -also gives the correct index for PG_swapcache pages. - -page_file_offset() - uses page_file_index(), so that it will give the expected -result, even for PG_swapcache pages. - -page_file_mapping() - gives the mapping backing the actual page; that is for -swap cache pages it will give swap_file->f_mapping. - -Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> -Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> -Signed-off-by: Xiaotian Feng <dfeng@redhat.com> ---- - include/linux/mm.h | 25 +++++++++++++++++++++++++ - include/linux/pagemap.h | 5 +++++ - mm/swapfile.c | 19 +++++++++++++++++++ - 3 files changed, 49 insertions(+), 0 deletions(-) - -diff --git a/include/linux/mm.h b/include/linux/mm.h -index 32033ba..0cf97fc 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -663,6 +663,17 @@ static inline void *page_rmapping(struct page *page) - return (void *)((unsigned long)page->mapping & ~PAGE_MAPPING_FLAGS); - } - -+extern struct address_space *__page_file_mapping(struct page *); -+ -+static inline -+struct address_space *page_file_mapping(struct page *page) -+{ -+ if (unlikely(PageSwapCache(page))) -+ return __page_file_mapping(page); -+ -+ return page->mapping; -+} -+ - static inline int PageAnon(struct page *page) - { - return ((unsigned long)page->mapping & PAGE_MAPPING_ANON) != 0; -@@ -679,6 +690,20 @@ static inline pgoff_t page_index(struct page *page) - return page->index; - } - -+extern pgoff_t __page_file_index(struct page *page); -+ -+/* -+ * Return the file index of the page. Regular pagecache pages use ->index -+ * whereas swapcache pages use swp_offset(->private) -+ */ -+static inline pgoff_t page_file_index(struct page *page) -+{ -+ if (unlikely(PageSwapCache(page))) -+ return __page_file_index(page); -+ -+ return page->index; -+} -+ - /* - * The atomic page->_mapcount, like _count, starts from -1: - * so that transitions both from it and to it can be tracked, -diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h -index e12cdc6..64eda5b 100644 ---- a/include/linux/pagemap.h -+++ b/include/linux/pagemap.h -@@ -285,6 +285,11 @@ static inline loff_t page_offset(struct page *page) - extern pgoff_t linear_hugepage_index(struct vm_area_struct *vma, - unsigned long address); - -+static inline loff_t page_file_offset(struct page *page) -+{ -+ return ((loff_t)page_file_index(page)) << PAGE_CACHE_SHIFT; -+} -+ - static inline pgoff_t linear_page_index(struct vm_area_struct *vma, - unsigned long address) - { -diff --git a/mm/swapfile.c b/mm/swapfile.c -index a7baef1..d8a05e4 100644 ---- a/mm/swapfile.c -+++ b/mm/swapfile.c -@@ -2261,6 +2261,25 @@ struct swap_info_struct *page_swap_info(struct page *page) - } - - /* -+ * out-of-line __page_file_ methods to avoid include hell. -+ */ -+ -+struct address_space *__page_file_mapping(struct page *page) -+{ -+ VM_BUG_ON(!PageSwapCache(page)); -+ return page_swap_info(page)->swap_file->f_mapping; -+} -+EXPORT_SYMBOL_GPL(__page_file_mapping); -+ -+pgoff_t __page_file_index(struct page *page) -+{ -+ swp_entry_t swap = { .val = page_private(page) }; -+ VM_BUG_ON(!PageSwapCache(page)); -+ return swp_offset(swap); -+} -+EXPORT_SYMBOL_GPL(__page_file_index); -+ -+/* - * swap_lock prevents swap_map being freed. Don't grab an extra - * reference on the swaphandle, it doesn't matter if it becomes unused. - */ --- -1.7.1.1 - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N2/content_digest index 0628336..9f2db42 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -16,133 +16,5 @@ " davem@davemloft.net\0" "\00:1\0" "b\0" - ">From 50e813068c51de733bbbdd04eb4af9c43919cd57 Mon Sep 17 00:00:00 2001\n" - "From: Xiaotian Feng <dfeng@redhat.com>\n" - "Date: Tue, 13 Jul 2010 13:09:50 +0800\n" - "Subject: [PATCH 23/30] mm: methods for teaching filesystems about PG_swapcache pages\n" - "\n" - "In order to teach filesystems to handle swap cache pages, three new page\n" - "functions are introduced:\n" - "\n" - " pgoff_t page_file_index(struct page *);\n" - " loff_t page_file_offset(struct page *);\n" - " struct address_space *page_file_mapping(struct page *);\n" - "\n" - "page_file_index() - gives the offset of this page in the file in\n" - "PAGE_CACHE_SIZE blocks. Like page->index is for mapped pages, this function\n" - "also gives the correct index for PG_swapcache pages.\n" - "\n" - "page_file_offset() - uses page_file_index(), so that it will give the expected\n" - "result, even for PG_swapcache pages.\n" - "\n" - "page_file_mapping() - gives the mapping backing the actual page; that is for\n" - "swap cache pages it will give swap_file->f_mapping.\n" - "\n" - "Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>\n" - "Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>\n" - "Signed-off-by: Xiaotian Feng <dfeng@redhat.com>\n" - "---\n" - " include/linux/mm.h | 25 +++++++++++++++++++++++++\n" - " include/linux/pagemap.h | 5 +++++\n" - " mm/swapfile.c | 19 +++++++++++++++++++\n" - " 3 files changed, 49 insertions(+), 0 deletions(-)\n" - "\n" - "diff --git a/include/linux/mm.h b/include/linux/mm.h\n" - "index 32033ba..0cf97fc 100644\n" - "--- a/include/linux/mm.h\n" - "+++ b/include/linux/mm.h\n" - "@@ -663,6 +663,17 @@ static inline void *page_rmapping(struct page *page)\n" - " \treturn (void *)((unsigned long)page->mapping & ~PAGE_MAPPING_FLAGS);\n" - " }\n" - " \n" - "+extern struct address_space *__page_file_mapping(struct page *);\n" - "+\n" - "+static inline\n" - "+struct address_space *page_file_mapping(struct page *page)\n" - "+{\n" - "+\tif (unlikely(PageSwapCache(page)))\n" - "+\t\treturn __page_file_mapping(page);\n" - "+\n" - "+\treturn page->mapping;\n" - "+}\n" - "+\n" - " static inline int PageAnon(struct page *page)\n" - " {\n" - " \treturn ((unsigned long)page->mapping & PAGE_MAPPING_ANON) != 0;\n" - "@@ -679,6 +690,20 @@ static inline pgoff_t page_index(struct page *page)\n" - " \treturn page->index;\n" - " }\n" - " \n" - "+extern pgoff_t __page_file_index(struct page *page);\n" - "+\n" - "+/*\n" - "+ * Return the file index of the page. Regular pagecache pages use ->index\n" - "+ * whereas swapcache pages use swp_offset(->private)\n" - "+ */\n" - "+static inline pgoff_t page_file_index(struct page *page)\n" - "+{\n" - "+\tif (unlikely(PageSwapCache(page)))\n" - "+\t\treturn __page_file_index(page);\n" - "+\n" - "+\treturn page->index;\n" - "+}\n" - "+\n" - " /*\n" - " * The atomic page->_mapcount, like _count, starts from -1:\n" - " * so that transitions both from it and to it can be tracked,\n" - "diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h\n" - "index e12cdc6..64eda5b 100644\n" - "--- a/include/linux/pagemap.h\n" - "+++ b/include/linux/pagemap.h\n" - "@@ -285,6 +285,11 @@ static inline loff_t page_offset(struct page *page)\n" - " extern pgoff_t linear_hugepage_index(struct vm_area_struct *vma,\n" - " \t\t\t\t unsigned long address);\n" - " \n" - "+static inline loff_t page_file_offset(struct page *page)\n" - "+{\n" - "+\treturn ((loff_t)page_file_index(page)) << PAGE_CACHE_SHIFT;\n" - "+}\n" - "+\n" - " static inline pgoff_t linear_page_index(struct vm_area_struct *vma,\n" - " \t\t\t\t\tunsigned long address)\n" - " {\n" - "diff --git a/mm/swapfile.c b/mm/swapfile.c\n" - "index a7baef1..d8a05e4 100644\n" - "--- a/mm/swapfile.c\n" - "+++ b/mm/swapfile.c\n" - "@@ -2261,6 +2261,25 @@ struct swap_info_struct *page_swap_info(struct page *page)\n" - " }\n" - " \n" - " /*\n" - "+ * out-of-line __page_file_ methods to avoid include hell.\n" - "+ */\n" - "+\n" - "+struct address_space *__page_file_mapping(struct page *page)\n" - "+{\n" - "+\tVM_BUG_ON(!PageSwapCache(page));\n" - "+\treturn page_swap_info(page)->swap_file->f_mapping;\n" - "+}\n" - "+EXPORT_SYMBOL_GPL(__page_file_mapping);\n" - "+\n" - "+pgoff_t __page_file_index(struct page *page)\n" - "+{\n" - "+\tswp_entry_t swap = { .val = page_private(page) };\n" - "+\tVM_BUG_ON(!PageSwapCache(page));\n" - "+\treturn swp_offset(swap);\n" - "+}\n" - "+EXPORT_SYMBOL_GPL(__page_file_index);\n" - "+\n" - "+/*\n" - " * swap_lock prevents swap_map being freed. Don't grab an extra\n" - " * reference on the swaphandle, it doesn't matter if it becomes unused.\n" - " */\n" - "-- \n" - "1.7.1.1\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" -48d10432ca8228acc18ff812032b010a3d379b44e8f1fad4770c6aff1481c052 +75ebcdb3f35a68f99e3f383bab790b481f42907b9cff0702f5f41ccd655f3845
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.