return page;
}
+#ifdef FRONTSWAP_HAS_UNUSE
static void zcache_unacct_page(void)
{
zcache_pageframes_freed =
atomic_inc_return(&zcache_pageframes_freed_atomic);
}
+#endif
static void zcache_free_page(struct page *page)
{
long curr_pageframes;
- static long max_pageframes, min_pageframes, total_freed;
+ static long max_pageframes, min_pageframes;
if (page == NULL)
BUG();
return page;
}
+#ifdef FRONTSWAP_HAS_UNUSE
static void unswiz(struct tmem_oid oid, u32 index,
unsigned *type, pgoff_t *offset);
-#ifdef FRONTSWAP_HAS_UNUSE
+
/*
* Choose an LRU persistent pageframe and attempt to "unuse" it by
* calling frontswap_unuse on both zpages.
int nr_evict = 0;
int nr_unuse = 0;
struct page *page;
+#ifdef FRONTSWAP_HAS_UNUSE
int unuse_ret;
+#endif
if (nr <= 0)
goto skip_evict;
return oid;
}
+#ifdef FRONTSWAP_HAS_UNUSE
static void unswiz(struct tmem_oid oid, u32 index,
unsigned *type, pgoff_t *offset)
{
*offset = (pgoff_t)((index << SWIZ_BITS) |
(oid.oid[0] & SWIZ_MASK));
}
+#endif
static int zcache_frontswap_put_page(unsigned type, pgoff_t offset,
struct page *page)
struct tmem_oid oid = oswiz(type, ind);
int ret = -1;
unsigned long flags;
- int unuse_ret;
BUG_ON(!PageLocked(page));
if (!disable_frontswap_ignore_nonactive && !PageWasActive(page)) {