From 427d2c964d5a609647350a1c3eed6cadf1d53e53 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 22 Jan 2015 12:09:47 -0500 Subject: mm: add find_get_page_flags() for 3.18 ext4 backport Signed-off-by: Theodore Ts'o --- mm/filemap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mm/filemap.c') diff --git a/mm/filemap.c b/mm/filemap.c index 977b53167..b50d511c1 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -716,7 +716,8 @@ int __lock_page_or_retry(struct page *page, struct mm_struct *mm, * Is there a pagecache struct page at the given (mapping, offset) tuple? * If yes, increment its refcount and return it; if no, return NULL. */ -struct page *find_get_page(struct address_space *mapping, pgoff_t offset) +struct page *find_get_page_flags(struct address_space *mapping, pgoff_t offset, + int fgp_flags) { void **pagep; struct page *page; @@ -753,6 +754,8 @@ repeat: } } out: + if (page && (fgp_flags & FGP_ACCESSED)) + mark_page_accessed(page); rcu_read_unlock(); return page; -- cgit v1.2.3