linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: netdev@vger.kernel.org, linux-nfs@vger.kernel.org
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rik van Riel <riel@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Mel Gorman <mel@csn.ul.ie>, Michel Lespinasse <walken@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH 01/13] mm: Make some struct page's const.
Date: Fri, 22 Jul 2011 14:17:21 +0100	[thread overview]
Message-ID: <1311340653-19336-1-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1311340095.12772.57.camel@zakaz.uk.xensource.com>

These uses are read-only and in a subsequent patch I have a const struct page
in my hand...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
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>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
---
 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 <linux/vmstat.h>
 
-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)];
 }
-- 
1.7.2.5


  reply	other threads:[~2011-07-22 13:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22 13:08 [PATCH/RFC v2 0/13] enable SKB paged fragment lifetime visibility Ian Campbell
2011-07-22 13:17 ` Ian Campbell [this message]
2011-07-22 13:17 ` [PATCH 02/13] mm: use const struct page for r/o page-flag accessor methods Ian Campbell
2011-07-22 13:17 ` [PATCH 03/13] net: add APIs for manipulating skb page fragments Ian Campbell
2011-07-22 13:17 ` [PATCH 04/13] net: convert core to skb paged frag APIs Ian Campbell
2011-07-22 13:17 ` [PATCH 05/13] net: ipv4: convert to SKB " Ian Campbell
2011-07-22 13:17 ` [PATCH 06/13] net: ipv6: " Ian Campbell
2011-07-22 13:17 ` [PATCH 07/13] net: xfrm: " Ian Campbell
2011-07-22 13:17 ` [PATCH 08/13] net: convert drivers to paged frag API Ian Campbell
2011-07-22 14:12   ` David Miller
2011-07-22 14:16     ` Ian Campbell
2011-07-22 13:17 ` [PATCH 09/13] net: add support for per-paged-fragment destructors Ian Campbell
2011-07-22 13:17 ` [PATCH 10/13] net: add paged frag destructor to skb_fill_page_desc() Ian Campbell
2011-07-22 19:58   ` Michał Mirosław
2011-07-22 21:07     ` Ian Campbell
2011-07-22 21:44       ` Michał Mirosław
2011-07-22 13:17 ` [PATCH 11/13] net: only allow paged fragments with the same destructor to be coalesced Ian Campbell
2011-07-22 13:17 ` [PATCH 12/13] net: add paged frag destructor support to kernel_sendpage Ian Campbell
2011-07-22 13:17 ` [PATCH 13/13] sunrpc: use SKB fragment destructors to delay completion until page is released by network stack Ian Campbell
2011-07-22 18:39   ` Trond Myklebust
2011-07-22 14:13 ` [PATCH/RFC v2 0/13] enable SKB paged fragment lifetime visibility David Miller
2011-07-22 14:18   ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311340653-19336-1-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=netdev@vger.kernel.org \
    --cc=riel@redhat.com \
    --cc=walken@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).