summaryrefslogtreecommitdiffstats
path: root/mm/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/util.c')
-rw-r--r--mm/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/util.c b/mm/util.c
index c1250501364f..029fc2f3b395 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -515,6 +515,16 @@ struct address_space *page_mapping(struct page *page)
515} 515}
516EXPORT_SYMBOL(page_mapping); 516EXPORT_SYMBOL(page_mapping);
517 517
518/*
519 * For file cache pages, return the address_space, otherwise return NULL
520 */
521struct address_space *page_mapping_file(struct page *page)
522{
523 if (unlikely(PageSwapCache(page)))
524 return NULL;
525 return page_mapping(page);
526}
527
518/* Slow path of page_mapcount() for compound pages */ 528/* Slow path of page_mapcount() for compound pages */
519int __page_mapcount(struct page *page) 529int __page_mapcount(struct page *page)
520{ 530{