提交 ec7cade8 编写于 作者: C Christoph Lameter 提交者: Linus Torvalds

page flags: add PAGEFLAGS_FALSE for flags that are always false

Turns out that there are a number of times that a flag is simply always
returning 0.  Define a macro for that.
Signed-off-by: NChristoph Lameter <clameter@sgi.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 602c4d11
...@@ -134,6 +134,10 @@ static inline int TestClearPage##uname(struct page *page) \ ...@@ -134,6 +134,10 @@ static inline int TestClearPage##uname(struct page *page) \
#define __PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ #define __PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \
__SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(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) \ #define TESTSCFLAG(uname, lname) \
TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname) TESTSETFLAG(uname, lname) TESTCLEARFLAG(uname, lname)
...@@ -171,28 +175,19 @@ PAGEFLAG(Readahead, reclaim) /* Reminder to do async read-ahead */ ...@@ -171,28 +175,19 @@ PAGEFLAG(Readahead, reclaim) /* Reminder to do async read-ahead */
*/ */
#define PageHighMem(__p) is_highmem(page_zone(__p)) #define PageHighMem(__p) is_highmem(page_zone(__p))
#else #else
static inline int PageHighMem(struct page *page) PAGEFLAG_FALSE(HighMem)
{
return 0;
}
#endif #endif
#ifdef CONFIG_SWAP #ifdef CONFIG_SWAP
PAGEFLAG(SwapCache, swapcache) PAGEFLAG(SwapCache, swapcache)
#else #else
static inline int PageSwapCache(struct page *page) PAGEFLAG_FALSE(SwapCache)
{
return 0;
}
#endif #endif
#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
PAGEFLAG(Uncached, uncached) PAGEFLAG(Uncached, uncached)
#else #else
static inline int PageUncached(struct page *) PAGEFLAG_FALSE(Uncached)
{
return 0;
}
#endif #endif
static inline int PageUptodate(struct page *page) static inline int PageUptodate(struct page *page)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册