From patchwork Fri Jul 15 11:07:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 977892 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6FBH5a2031502 for ; Fri, 15 Jul 2011 11:17:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750882Ab1GOLQv (ORCPT ); Fri, 15 Jul 2011 07:16:51 -0400 Received: from smtp.citrix.com ([66.165.176.89]:32675 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945Ab1GOLQu (ORCPT ); Fri, 15 Jul 2011 07:16:50 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 15 Jul 2011 11:17:05 +0000 (UTC) X-Greylist: delayed 572 seconds by postgrey-1.27 at vger.kernel.org; Fri, 15 Jul 2011 07:16:46 EDT X-IronPort-AV: E=Sophos;i="4.65,534,1304308800"; d="scan'208";a="15102446" Received: from ftlpmailmx02.citrite.net ([10.13.107.66]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/RC4-MD5; 15 Jul 2011 07:07:14 -0400 Received: from smtp01.ad.xensource.com (10.219.128.104) by smtprelay.citrix.com (10.13.107.66) with Microsoft SMTP Server id 8.3.137.0; Fri, 15 Jul 2011 07:07:14 -0400 Received: from cosworth.uk.xensource.com (cosworth.uk.xensource.com [10.80.16.52]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id p6FB7CB0018064; Fri, 15 Jul 2011 04:07:12 -0700 From: Ian Campbell To: netdev@vger.kernel.org CC: linux-nfs@vger.kernel.org, Ian Campbell Subject: [PATCH 01/10] mm: Make some struct page's const. Date: Fri, 15 Jul 2011 12:07:02 +0100 Message-ID: <1310728031-19569-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1310728006.20648.3.camel@zakaz.uk.xensource.com> References: <1310728006.20648.3.camel@zakaz.uk.xensource.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Signed-off-by: Ian Campbell --- include/linux/mm.h | 10 +++++----- mm/sparse.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 9670f71..550ec8f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -636,7 +636,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) #define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) -static inline enum zone_type page_zonenum(struct page *page) +static inline enum zone_type page_zonenum(const struct page *page) { return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; } @@ -664,15 +664,15 @@ static inline int zone_to_nid(struct zone *zone) } #ifdef NODE_NOT_IN_PAGE_FLAGS -extern int page_to_nid(struct page *page); +extern int page_to_nid(const struct page *page); #else -static inline int page_to_nid(struct page *page) +static inline int page_to_nid(const struct page *page) { return (page->flags >> NODES_PGSHIFT) & NODES_MASK; } #endif -static inline struct zone *page_zone(struct page *page) +static inline struct zone *page_zone(const struct page *page) { return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; } @@ -717,7 +717,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone, */ #include -static __always_inline void *lowmem_page_address(struct page *page) +static __always_inline void *lowmem_page_address(const struct page *page) { return __va(PFN_PHYS(page_to_pfn(page))); } diff --git a/mm/sparse.c b/mm/sparse.c index aa64b12..858e1df 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -40,7 +40,7 @@ static u8 section_to_node_table[NR_MEM_SECTIONS] __cacheline_aligned; static u16 section_to_node_table[NR_MEM_SECTIONS] __cacheline_aligned; #endif -int page_to_nid(struct page *page) +int page_to_nid(const struct page *page) { return section_to_node_table[page_to_section(page)]; }