staging: ramster: fix build warnings

Fix build warnings resulting from in-progress work that was
not entirely ifdef'd out.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dan Magenheimer 2012-09-06 10:01:14 -07:00 коммит произвёл Greg Kroah-Hartman
Родитель 2065945540
Коммит 7892e560d4
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -449,16 +449,18 @@ static struct page *zcache_alloc_page(void)
return page; return page;
} }
#ifdef FRONTSWAP_HAS_UNUSE
static void zcache_unacct_page(void) static void zcache_unacct_page(void)
{ {
zcache_pageframes_freed = zcache_pageframes_freed =
atomic_inc_return(&zcache_pageframes_freed_atomic); atomic_inc_return(&zcache_pageframes_freed_atomic);
} }
#endif
static void zcache_free_page(struct page *page) static void zcache_free_page(struct page *page)
{ {
long curr_pageframes; long curr_pageframes;
static long max_pageframes, min_pageframes, total_freed; static long max_pageframes, min_pageframes;
if (page == NULL) if (page == NULL)
BUG(); BUG();
@ -965,9 +967,10 @@ out:
return page; return page;
} }
#ifdef FRONTSWAP_HAS_UNUSE
static void unswiz(struct tmem_oid oid, u32 index, static void unswiz(struct tmem_oid oid, u32 index,
unsigned *type, pgoff_t *offset); unsigned *type, pgoff_t *offset);
#ifdef FRONTSWAP_HAS_UNUSE
/* /*
* Choose an LRU persistent pageframe and attempt to "unuse" it by * Choose an LRU persistent pageframe and attempt to "unuse" it by
* calling frontswap_unuse on both zpages. * calling frontswap_unuse on both zpages.
@ -1060,7 +1063,9 @@ static int shrink_zcache_memory(struct shrinker *shrink,
int nr_evict = 0; int nr_evict = 0;
int nr_unuse = 0; int nr_unuse = 0;
struct page *page; struct page *page;
#ifdef FRONTSWAP_HAS_UNUSE
int unuse_ret; int unuse_ret;
#endif
if (nr <= 0) if (nr <= 0)
goto skip_evict; goto skip_evict;
@ -1519,6 +1524,7 @@ static inline struct tmem_oid oswiz(unsigned type, u32 ind)
return oid; return oid;
} }
#ifdef FRONTSWAP_HAS_UNUSE
static void unswiz(struct tmem_oid oid, u32 index, static void unswiz(struct tmem_oid oid, u32 index,
unsigned *type, pgoff_t *offset) unsigned *type, pgoff_t *offset)
{ {
@ -1526,6 +1532,7 @@ static void unswiz(struct tmem_oid oid, u32 index,
*offset = (pgoff_t)((index << SWIZ_BITS) | *offset = (pgoff_t)((index << SWIZ_BITS) |
(oid.oid[0] & SWIZ_MASK)); (oid.oid[0] & SWIZ_MASK));
} }
#endif
static int zcache_frontswap_put_page(unsigned type, pgoff_t offset, static int zcache_frontswap_put_page(unsigned type, pgoff_t offset,
struct page *page) struct page *page)
@ -1535,7 +1542,6 @@ static int zcache_frontswap_put_page(unsigned type, pgoff_t offset,
struct tmem_oid oid = oswiz(type, ind); struct tmem_oid oid = oswiz(type, ind);
int ret = -1; int ret = -1;
unsigned long flags; unsigned long flags;
int unuse_ret;
BUG_ON(!PageLocked(page)); BUG_ON(!PageLocked(page));
if (!disable_frontswap_ignore_nonactive && !PageWasActive(page)) { if (!disable_frontswap_ignore_nonactive && !PageWasActive(page)) {