diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-07-25 20:11:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 23:57:07 -0400 |
commit | 33dd4e0ec91138c3d80e790c08a3db47426c81f2 (patch) | |
tree | 5b244874a004cc8a34033846f4e504c9306bf025 /include/linux/mm.h | |
parent | ee8f248d266ec6966c0ce6b7dec24de43dcc1b58 (diff) |
mm: make some struct page's const
These uses are read-only and in a subsequent patch I have a const struct
page in my hand...
[akpm@linux-foundation.org: fix warnings in lowmem_page_address()]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Michel Lespinasse <walken@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 8a45ad22a170..6321e840e21d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -637,7 +637,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
637 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) | 637 | #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) |
638 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) | 638 | #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) |
639 | 639 | ||
640 | static inline enum zone_type page_zonenum(struct page *page) | 640 | static inline enum zone_type page_zonenum(const struct page *page) |
641 | { | 641 | { |
642 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; | 642 | return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; |
643 | } | 643 | } |
@@ -665,15 +665,15 @@ static inline int zone_to_nid(struct zone *zone) | |||
665 | } | 665 | } |
666 | 666 | ||
667 | #ifdef NODE_NOT_IN_PAGE_FLAGS | 667 | #ifdef NODE_NOT_IN_PAGE_FLAGS |
668 | extern int page_to_nid(struct page *page); | 668 | extern int page_to_nid(const struct page *page); |
669 | #else | 669 | #else |
670 | static inline int page_to_nid(struct page *page) | 670 | static inline int page_to_nid(const struct page *page) |
671 | { | 671 | { |
672 | return (page->flags >> NODES_PGSHIFT) & NODES_MASK; | 672 | return (page->flags >> NODES_PGSHIFT) & NODES_MASK; |
673 | } | 673 | } |
674 | #endif | 674 | #endif |
675 | 675 | ||
676 | static inline struct zone *page_zone(struct page *page) | 676 | static inline struct zone *page_zone(const struct page *page) |
677 | { | 677 | { |
678 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; | 678 | return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; |
679 | } | 679 | } |
@@ -718,9 +718,9 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
718 | */ | 718 | */ |
719 | #include <linux/vmstat.h> | 719 | #include <linux/vmstat.h> |
720 | 720 | ||
721 | static __always_inline void *lowmem_page_address(struct page *page) | 721 | static __always_inline void *lowmem_page_address(const struct page *page) |
722 | { | 722 | { |
723 | return __va(PFN_PHYS(page_to_pfn(page))); | 723 | return __va(PFN_PHYS(page_to_pfn((struct page *)page))); |
724 | } | 724 | } |
725 | 725 | ||
726 | #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) | 726 | #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) |