--- a/include/linux/page_ref.h~mm-constify-page_count-and-page_ref_count +++ a/include/linux/page_ref.h @@ -62,12 +62,12 @@ static inline void __page_ref_unfreeze(s #endif -static inline int page_ref_count(struct page *page) +static inline int page_ref_count(const struct page *page) { return atomic_read(&page->_refcount); } -static inline int page_count(struct page *page) +static inline int page_count(const struct page *page) { return atomic_read(&compound_head(page)->_refcount); }