aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/tmem.c
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-05-08 17:10:08 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-05-15 10:27:46 -0400
commit9fd19653faceef210f30901f7cee0ceb13c6f39a (patch)
treec86cf92d288f72c98f24c8ed976f47fd413e9390 /drivers/xen/tmem.c
parent23972c639980ba796a05ae9432df8267175b99ae (diff)
xen/tmem: s/disable_// and change the logic.
The variety of disable_[cleancache|frontswap|selfshrinking] are making this a bit complex. Just remove the "disable_" part and change the logic around for the "nofrontswap" and "nocleancache" parameters. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/tmem.c')
-rw-r--r--drivers/xen/tmem.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c
index 30bf97475e13..411c7e3df46c 100644
--- a/drivers/xen/tmem.c
+++ b/drivers/xen/tmem.c
@@ -32,15 +32,15 @@ __setup("tmem", enable_tmem);
32#endif 32#endif
33 33
34#ifdef CONFIG_CLEANCACHE 34#ifdef CONFIG_CLEANCACHE
35static bool disable_cleancache __read_mostly; 35static bool cleancache __read_mostly = true;
36static bool disable_selfballooning __read_mostly; 36static bool selfballooning __read_mostly = true;
37#ifdef CONFIG_XEN_TMEM_MODULE 37#ifdef CONFIG_XEN_TMEM_MODULE
38module_param(disable_cleancache, bool, S_IRUGO); 38module_param(cleancache, bool, S_IRUGO);
39module_param(disable_selfballooning, bool, S_IRUGO); 39module_param(selfballooning, bool, S_IRUGO);
40#else 40#else
41static int __init no_cleancache(char *s) 41static int __init no_cleancache(char *s)
42{ 42{
43 disable_cleancache = true; 43 cleancache = false;
44 return 1; 44 return 1;
45} 45}
46__setup("nocleancache", no_cleancache); 46__setup("nocleancache", no_cleancache);
@@ -48,13 +48,13 @@ __setup("nocleancache", no_cleancache);
48#endif /* CONFIG_CLEANCACHE */ 48#endif /* CONFIG_CLEANCACHE */
49 49
50#ifdef CONFIG_FRONTSWAP 50#ifdef CONFIG_FRONTSWAP
51static bool disable_frontswap __read_mostly; 51static bool frontswap __read_mostly = true;
52#ifdef CONFIG_XEN_TMEM_MODULE 52#ifdef CONFIG_XEN_TMEM_MODULE
53module_param(disable_frontswap, bool, S_IRUGO); 53module_param(frontswap, bool, S_IRUGO);
54#else 54#else
55static int __init no_frontswap(char *s) 55static int __init no_frontswap(char *s)
56{ 56{
57 disable_frontswap = true; 57 frontswap = false;
58 return 1; 58 return 1;
59} 59}
60__setup("nofrontswap", no_frontswap); 60__setup("nofrontswap", no_frontswap);
@@ -62,9 +62,9 @@ __setup("nofrontswap", no_frontswap);
62#endif /* CONFIG_FRONTSWAP */ 62#endif /* CONFIG_FRONTSWAP */
63 63
64#ifdef CONFIG_XEN_SELFBALLOONING 64#ifdef CONFIG_XEN_SELFBALLOONING
65static bool disable_frontswap_selfshrinking __read_mostly; 65static bool frontswap_selfshrinking __read_mostly = true;
66#ifdef CONFIG_XEN_TMEM_MODULE 66#ifdef CONFIG_XEN_TMEM_MODULE
67module_param(disable_frontswap_selfshrinking, bool, S_IRUGO); 67module_param(frontswap_selfshrinking, bool, S_IRUGO);
68#endif 68#endif
69#endif /* CONFIG_XEN_SELFBALLOONING */ 69#endif /* CONFIG_XEN_SELFBALLOONING */
70 70
@@ -395,7 +395,7 @@ static int xen_tmem_init(void)
395 if (!xen_domain()) 395 if (!xen_domain())
396 return 0; 396 return 0;
397#ifdef CONFIG_FRONTSWAP 397#ifdef CONFIG_FRONTSWAP
398 if (tmem_enabled && !disable_frontswap) { 398 if (tmem_enabled && frontswap) {
399 char *s = ""; 399 char *s = "";
400 struct frontswap_ops *old_ops = 400 struct frontswap_ops *old_ops =
401 frontswap_register_ops(&tmem_frontswap_ops); 401 frontswap_register_ops(&tmem_frontswap_ops);
@@ -412,7 +412,7 @@ static int xen_tmem_init(void)
412#endif 412#endif
413#ifdef CONFIG_CLEANCACHE 413#ifdef CONFIG_CLEANCACHE
414 BUG_ON(sizeof(struct cleancache_filekey) != sizeof(struct tmem_oid)); 414 BUG_ON(sizeof(struct cleancache_filekey) != sizeof(struct tmem_oid));
415 if (tmem_enabled && !disable_cleancache) { 415 if (tmem_enabled && cleancache) {
416 char *s = ""; 416 char *s = "";
417 struct cleancache_ops *old_ops = 417 struct cleancache_ops *old_ops =
418 cleancache_register_ops(&tmem_cleancache_ops); 418 cleancache_register_ops(&tmem_cleancache_ops);
@@ -423,8 +423,7 @@ static int xen_tmem_init(void)
423 } 423 }
424#endif 424#endif
425#ifdef CONFIG_XEN_SELFBALLOONING 425#ifdef CONFIG_XEN_SELFBALLOONING
426 xen_selfballoon_init(!disable_selfballooning, 426 xen_selfballoon_init(selfballooning, frontswap_selfshrinking);
427 !disable_frontswap_selfshrinking);
428#endif 427#endif
429 return 0; 428 return 0;
430} 429}