diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-02 19:07:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-02 19:07:52 -0400 |
commit | 3e42dee676e8cf5adca817b1518b2e99d1c138ff (patch) | |
tree | 23580fe97d1e452667b507c2aadb99877d0b574c /include/linux | |
parent | 42daabf62bfa3c00974b43f030dadcf704c0db59 (diff) | |
parent | 88c8004fd3a5fdd2378069de86b90b21110d33a4 (diff) |
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking changes from Ingo Molnar:
"Four miscellanous standalone fixes for futexes, rtmutexes and
Kconfig.locks."
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
futex: Use freezable blocking call
futex: Take hugepages into account when generating futex_key
rtmutex: Document rt_mutex_adjust_prio_chain()
locking: Fix copy/paste errors of "ARCH_INLINE_*_UNLOCK_BH"
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/hugetlb.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6b4890fa57e7..feaf0c7fb7d8 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -358,6 +358,17 @@ static inline int hstate_index(struct hstate *h) | |||
358 | return h - hstates; | 358 | return h - hstates; |
359 | } | 359 | } |
360 | 360 | ||
361 | pgoff_t __basepage_index(struct page *page); | ||
362 | |||
363 | /* Return page->index in PAGE_SIZE units */ | ||
364 | static inline pgoff_t basepage_index(struct page *page) | ||
365 | { | ||
366 | if (!PageCompound(page)) | ||
367 | return page->index; | ||
368 | |||
369 | return __basepage_index(page); | ||
370 | } | ||
371 | |||
361 | #else /* CONFIG_HUGETLB_PAGE */ | 372 | #else /* CONFIG_HUGETLB_PAGE */ |
362 | struct hstate {}; | 373 | struct hstate {}; |
363 | #define alloc_huge_page_node(h, nid) NULL | 374 | #define alloc_huge_page_node(h, nid) NULL |
@@ -378,6 +389,11 @@ static inline unsigned int pages_per_huge_page(struct hstate *h) | |||
378 | } | 389 | } |
379 | #define hstate_index_to_shift(index) 0 | 390 | #define hstate_index_to_shift(index) 0 |
380 | #define hstate_index(h) 0 | 391 | #define hstate_index(h) 0 |
392 | |||
393 | static inline pgoff_t basepage_index(struct page *page) | ||
394 | { | ||
395 | return page->index; | ||
396 | } | ||
381 | #endif /* CONFIG_HUGETLB_PAGE */ | 397 | #endif /* CONFIG_HUGETLB_PAGE */ |
382 | 398 | ||
383 | #endif /* _LINUX_HUGETLB_H */ | 399 | #endif /* _LINUX_HUGETLB_H */ |