Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356565
b: refs/heads/master
c: 9800339
h: refs/heads/master
i:
  356563: c3e752c
v: v3
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Feb 24, 2013
1 parent 6b9029b commit 785f0f6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 340ef3902cf20cec43cdcd1e72ae5cb518be7328
refs/heads/master: 9800339b5e0f0e24ab3dac349e0de80d2018832e
13 changes: 1 addition & 12 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,18 +809,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)
Expand Down
16 changes: 16 additions & 0 deletions trunk/mm/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -382,6 +383,21 @@ unsigned long vm_mmap(struct file *file, unsigned long addr,
}
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);
Expand Down

0 comments on commit 785f0f6

Please sign in to comment.