if (error)
return (error == -ENOMEM)? NOPAGE_OOM: NOPAGE_SIGBUS;
+ mark_page_accessed(page);
flush_page_to_ram(page);
return page;
}
if (err)
return err;
if (page) {
+ mark_page_accessed(page);
+ flush_page_to_ram(page);
err = install_page(mm, vma, addr, page, prot);
if (err) {
page_cache_release(page);
break;
}
+ if (!PageReferenced(page))
+ SetPageReferenced(page);
set_page_dirty(page);
page_cache_release(page);
}
nr -= offset;
- /* If users can be writing to this page using arbitrary
- * virtual addresses, take care about potential aliasing
- * before reading the page on the kernel side.
- */
- if (!list_empty(&mapping->i_mmap_shared) &&
- page != ZERO_PAGE(0))
- flush_dcache_page(page);
+ if (page != ZERO_PAGE(0)) {
+ /*
+ * If users can be writing to this page using arbitrary
+ * virtual addresses, take care about potential aliasing
+ * before reading the page on the kernel side.
+ */
+ if (!list_empty(&mapping->i_mmap_shared))
+ flush_dcache_page(page);
+ /*
+ * Mark the page accessed if we read the beginning.
+ */
+ if (!offset)
+ mark_page_accessed(page);
+ }
/*
* Ok, we have the page, and it's up-to-date, so
return res;
res = vfs_readlink(dentry, buffer, buflen, kmap(page));
kunmap(page);
+ mark_page_accessed(page);
page_cache_release(page);
return res;
}
return res;
res = vfs_follow_link(nd, kmap(page));
kunmap(page);
+ mark_page_accessed(page);
page_cache_release(page);
return res;
}