linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/3 v2]mm: don't inline page_mapping()
@ 2013-01-22  2:29 Shaohua Li
  2013-01-22  2:34 ` Rik van Riel
  2013-01-23  5:46 ` Minchan Kim
  0 siblings, 2 replies; 6+ messages in thread
From: Shaohua Li @ 2013-01-22  2:29 UTC (permalink / raw)
  To: linux-mm; +Cc: akpm, hughd, riel, minchan


According to akpm, this saves 1/2k text and makes things simple of next patch.

Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Shaohua Li <shli@fusionio.com>
---
 include/linux/mm.h |   13 +------------
 mm/util.c          |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 12 deletions(-)

Index: linux/include/linux/mm.h
===================================================================
--- linux.orig/include/linux/mm.h	2013-01-21 15:43:46.978065595 +0800
+++ linux/include/linux/mm.h	2013-01-21 15:44:42.273370813 +0800
@@ -817,18 +817,7 @@ void page_address_init(void);
 #define PAGE_MAPPING_KSM	2
 #define PAGE_MAPPING_FLAGS	(PAGE_MAPPING_ANON | PAGE_MAPPING_KSM)
 
-extern struct address_space swapper_space;
-static inline struct address_space *page_mapping(struct page *page)
-{
-	struct address_space *mapping = page->mapping;
-
-	VM_BUG_ON(PageSlab(page));
-	if (unlikely(PageSwapCache(page)))
-		mapping = &swapper_space;
-	else if ((unsigned long)mapping & PAGE_MAPPING_ANON)
-		mapping = NULL;
-	return mapping;
-}
+extern struct address_space *page_mapping(struct page *page);
 
 /* Neutral page->mapping pointer to address_space or anon_vma or other */
 static inline void *page_rmapping(struct page *page)
Index: linux/mm/util.c
===================================================================
--- linux.orig/mm/util.c	2013-01-21 15:43:46.962065796 +0800
+++ linux/mm/util.c	2013-01-22 09:50:53.758830807 +0800
@@ -5,6 +5,7 @@
 #include <linux/err.h>
 #include <linux/sched.h>
 #include <linux/security.h>
+#include <linux/swap.h>
 #include <asm/uaccess.h>
 
 #include "internal.h"
@@ -378,6 +379,21 @@ unsigned long vm_mmap(struct file *file,
 }
 EXPORT_SYMBOL(vm_mmap);
 
+struct address_space *page_mapping(struct page *page)
+{
+	struct address_space *mapping = page->mapping;
+
+	VM_BUG_ON(PageSlab(page));
+#ifdef CONFIG_SWAP
+	if (unlikely(PageSwapCache(page)))
+		mapping = &swapper_space;
+	else
+#endif
+	if ((unsigned long)mapping & PAGE_MAPPING_ANON)
+		mapping = NULL;
+	return mapping;
+}
+
 /* Tracepoints definitions. */
 EXPORT_TRACEPOINT_SYMBOL(kmalloc);
 EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc);

--
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-24  3:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22  2:29 [patch 1/3 v2]mm: don't inline page_mapping() Shaohua Li
2013-01-22  2:34 ` Rik van Riel
2013-01-23  5:46 ` Minchan Kim
2013-01-24  1:15   ` Simon Jeons
2013-01-24  2:25     ` Minchan Kim
2013-01-24  3:03       ` Simon Jeons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).