diff options
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -515,6 +515,16 @@ struct address_space *page_mapping(struct page *page) | |||
515 | } | 515 | } |
516 | EXPORT_SYMBOL(page_mapping); | 516 | EXPORT_SYMBOL(page_mapping); |
517 | 517 | ||
518 | /* | ||
519 | * For file cache pages, return the address_space, otherwise return NULL | ||
520 | */ | ||
521 | struct 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 */ |
519 | int __page_mapcount(struct page *page) | 529 | int __page_mapcount(struct page *page) |
520 | { | 530 | { |