aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/tmem.c21
-rw-r--r--include/xen/tmem.h6
2 files changed, 13 insertions, 14 deletions
diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c
index d369965e8f8a..6a8f76dd5a22 100644
--- a/drivers/xen/tmem.c
+++ b/drivers/xen/tmem.c
@@ -9,7 +9,6 @@
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/pagemap.h> 11#include <linux/pagemap.h>
12#include <linux/module.h>
13#include <linux/cleancache.h> 12#include <linux/cleancache.h>
14 13
15/* temporary ifdef until include/linux/frontswap.h is upstream */ 14/* temporary ifdef until include/linux/frontswap.h is upstream */
@@ -128,15 +127,13 @@ static int xen_tmem_flush_object(u32 pool_id, struct tmem_oid oid)
128 return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0); 127 return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0);
129} 128}
130 129
131int tmem_enabled __read_mostly; 130bool __read_mostly tmem_enabled = false;
132EXPORT_SYMBOL(tmem_enabled);
133 131
134static int __init enable_tmem(char *s) 132static int __init enable_tmem(char *s)
135{ 133{
136 tmem_enabled = 1; 134 tmem_enabled = true;
137 return 1; 135 return 1;
138} 136}
139
140__setup("tmem", enable_tmem); 137__setup("tmem", enable_tmem);
141 138
142#ifdef CONFIG_CLEANCACHE 139#ifdef CONFIG_CLEANCACHE
@@ -229,17 +226,16 @@ static int tmem_cleancache_init_shared_fs(char *uuid, size_t pagesize)
229 return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize); 226 return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize);
230} 227}
231 228
232static int use_cleancache = 1; 229static bool __initdata use_cleancache = true;
233 230
234static int __init no_cleancache(char *s) 231static int __init no_cleancache(char *s)
235{ 232{
236 use_cleancache = 0; 233 use_cleancache = false;
237 return 1; 234 return 1;
238} 235}
239
240__setup("nocleancache", no_cleancache); 236__setup("nocleancache", no_cleancache);
241 237
242static struct cleancache_ops tmem_cleancache_ops = { 238static struct cleancache_ops __initdata tmem_cleancache_ops = {
243 .put_page = tmem_cleancache_put_page, 239 .put_page = tmem_cleancache_put_page,
244 .get_page = tmem_cleancache_get_page, 240 .get_page = tmem_cleancache_get_page,
245 .flush_page = tmem_cleancache_flush_page, 241 .flush_page = tmem_cleancache_flush_page,
@@ -356,17 +352,16 @@ static void tmem_frontswap_init(unsigned ignored)
356 xen_tmem_new_pool(private, TMEM_POOL_PERSIST, PAGE_SIZE); 352 xen_tmem_new_pool(private, TMEM_POOL_PERSIST, PAGE_SIZE);
357} 353}
358 354
359static int __initdata use_frontswap = 1; 355static bool __initdata use_frontswap = true;
360 356
361static int __init no_frontswap(char *s) 357static int __init no_frontswap(char *s)
362{ 358{
363 use_frontswap = 0; 359 use_frontswap = false;
364 return 1; 360 return 1;
365} 361}
366
367__setup("nofrontswap", no_frontswap); 362__setup("nofrontswap", no_frontswap);
368 363
369static struct frontswap_ops tmem_frontswap_ops = { 364static struct frontswap_ops __initdata tmem_frontswap_ops = {
370 .put_page = tmem_frontswap_put_page, 365 .put_page = tmem_frontswap_put_page,
371 .get_page = tmem_frontswap_get_page, 366 .get_page = tmem_frontswap_get_page,
372 .flush_page = tmem_frontswap_flush_page, 367 .flush_page = tmem_frontswap_flush_page,
diff --git a/include/xen/tmem.h b/include/xen/tmem.h
index 82e2c83a32f5..591550a22ac7 100644
--- a/include/xen/tmem.h
+++ b/include/xen/tmem.h
@@ -1,5 +1,9 @@
1#ifndef _XEN_TMEM_H 1#ifndef _XEN_TMEM_H
2#define _XEN_TMEM_H 2#define _XEN_TMEM_H
3
4#include <linux/types.h>
5
3/* defined in drivers/xen/tmem.c */ 6/* defined in drivers/xen/tmem.c */
4extern int tmem_enabled; 7extern bool tmem_enabled;
8
5#endif /* _XEN_TMEM_H */ 9#endif /* _XEN_TMEM_H */