diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-23 18:11:11 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-07-23 18:11:11 -0400 |
| commit | ed4a1084bc8dc47328392aa31e0bc04eb2dbffbb (patch) | |
| tree | adf2543a5c7149c6287d7f03ecca1bffcb6395b2 /include/linux | |
| parent | 15ba2236f3556fc01b9ca91394465152b5ea74b6 (diff) | |
| parent | 0253d634e0803a8376a0d88efee0bf523d8673f9 (diff) | |
Merge branch 'akpm' (patches from Andrew Morton)
Merge fixes from Andrew Morton:
"10 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm: hugetlb: fix copy_hugetlb_page_range()
simple_xattr: permit 0-size extended attributes
mm/fs: fix pessimization in hole-punching pagecache
shmem: fix splicing from a hole while it's punched
shmem: fix faulting into a hole, not taking i_mutex
mm: do not call do_fault_around for non-linear fault
sh: also try passing -m4-nofpu for SH2A builds
zram: avoid lockdep splat by revalidate_disk
mm/rmap.c: fix pgoff calculation to handle hugepage correctly
coredump: fix the setting of PF_DUMPCORE
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/pagemap.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0a97b583ee8d..e1474ae18c88 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -399,6 +399,18 @@ static inline struct page *read_mapping_page(struct address_space *mapping, | |||
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | /* | 401 | /* |
| 402 | * Get the offset in PAGE_SIZE. | ||
| 403 | * (TODO: hugepage should have ->index in PAGE_SIZE) | ||
| 404 | */ | ||
| 405 | static inline pgoff_t page_to_pgoff(struct page *page) | ||
| 406 | { | ||
| 407 | if (unlikely(PageHeadHuge(page))) | ||
| 408 | return page->index << compound_order(page); | ||
| 409 | else | ||
| 410 | return page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); | ||
| 411 | } | ||
| 412 | |||
| 413 | /* | ||
| 402 | * Return byte-offset into filesystem object for page. | 414 | * Return byte-offset into filesystem object for page. |
| 403 | */ | 415 | */ |
| 404 | static inline loff_t page_offset(struct page *page) | 416 | static inline loff_t page_offset(struct page *page) |
