Skip to content

Commit

Permalink
page flags: add PAGEFLAGS_FALSE for flags that are always false
Browse files Browse the repository at this point in the history
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: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Apr 28, 2008
1 parent 602c4d1 commit ec7cade
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions include/linux/page-flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ static inline int TestClearPage##uname(struct page *page) \
#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)

Expand Down Expand Up @@ -171,28 +175,19 @@ PAGEFLAG(Readahead, reclaim) /* Reminder to do async read-ahead */
*/
#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)
Expand Down

0 comments on commit ec7cade

Please sign in to comment.