From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org
Subject: Page flags: Add PAGEFLAGS_FALSE for flags that are always false
Date: Wed, 26 Mar 2008 19:45:40 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0803261943260.2242@schroedinger.engr.sgi.com> (raw)
Applies on top of the PG_uncached flag patch.
From: Christoph Lameter <clameter@sgi.com>
Subject: Page flags: Add PAGEFLAGS_FALSE
Turns out that there a number of times that a flag is simply always returning 0.
Define a macro for that.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
include/linux/page-flags.h | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
Index: linux-2.6.25-rc5-mm1/include/linux/page-flags.h
===================================================================
--- linux-2.6.25-rc5-mm1.orig/include/linux/page-flags.h 2008-03-26 19:21:50.259169581 -0700
+++ linux-2.6.25-rc5-mm1/include/linux/page-flags.h 2008-03-26 19:37:17.456669515 -0700
@@ -145,6 +145,10 @@ static inline int TestClearPage##uname(s
#define __PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \
__SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname)
+#define PAGEFLAG_FALSE(uname) \
+static inline int Page##uname(struct page *page) \
+ { return 0; }
+
#define TESTSCFLAG(uname, lname) \
TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname)
@@ -182,28 +186,19 @@ PAGEFLAG(Readahead, reclaim) /* Reminde
*/
#define PageHighMem(__p) is_highmem(page_zone(__p))
#else
-static inline int PageHighMem(struct page *page)
-{
- return 0;
-}
+PAGEFLAG_FALSE(HighMem)
#endif
#ifdef CONFIG_SWAP
PAGEFLAG(SwapCache, swapcache)
#else
-static inline int PageSwapCache(struct page *page)
-{
- return 0;
-}
+PAGEFLAG_FALSE(SwapCache)
#endif
#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
PAGEFLAG(Uncached, uncached)
#else
-static inline int PageUncached(struct page *)
-{
- return 0;
-}
+PAGEFLAG_FALSE(Uncached)
#endif
static inline int PageUptodate(struct page *page)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
reply other threads:[~2008-03-27 2:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Pine.LNX.4.64.0803261943260.2242@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
/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