aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/tmem.c
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-05-08 15:50:59 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-05-15 10:27:43 -0400
commit0cb401d44e1152658c99c8566de915c2d71eab9e (patch)
tree28b41ebaa49efc519dd08f5e3842080bed07ca71 /drivers/xen/tmem.c
parenta5e9cd952e2ee215286ea3ec5e6b3aa669e04e0e (diff)
xen/tmem: Move all of the boot and module parameters to the top of the file.
Just code movement to see the different boot or module parameters. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/tmem.c')
-rw-r--r--drivers/xen/tmem.c85
1 files changed, 45 insertions, 40 deletions
diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c
index 5686d6d1a4b5..edf7e18a1c05 100644
--- a/drivers/xen/tmem.c
+++ b/drivers/xen/tmem.c
@@ -20,6 +20,51 @@
20#include <asm/xen/hypervisor.h> 20#include <asm/xen/hypervisor.h>
21#include <xen/tmem.h> 21#include <xen/tmem.h>
22 22
23#ifndef CONFIG_XEN_TMEM_MODULE
24bool __read_mostly tmem_enabled = false;
25
26static int __init enable_tmem(char *s)
27{
28 tmem_enabled = true;
29 return 1;
30}
31__setup("tmem", enable_tmem);
32#endif
33
34#ifdef CONFIG_CLEANCACHE
35static bool disable_cleancache __read_mostly;
36static bool disable_selfballooning __read_mostly;
37#ifdef CONFIG_XEN_TMEM_MODULE
38module_param(disable_cleancache, bool, S_IRUGO);
39module_param(disable_selfballooning, bool, S_IRUGO);
40#else
41static int __init no_cleancache(char *s)
42{
43 disable_cleancache = true;
44 return 1;
45}
46__setup("nocleancache", no_cleancache);
47#endif
48#endif /* CONFIG_CLEANCACHE */
49
50#ifdef CONFIG_FRONTSWAP
51static bool disable_frontswap __read_mostly;
52static bool disable_frontswap_selfshrinking __read_mostly;
53#ifdef CONFIG_XEN_TMEM_MODULE
54module_param(disable_frontswap, bool, S_IRUGO);
55module_param(disable_frontswap_selfshrinking, bool, S_IRUGO);
56#else
57static int __init no_frontswap(char *s)
58{
59 disable_frontswap = true;
60 return 1;
61}
62__setup("nofrontswap", no_frontswap);
63#endif
64#else /* CONFIG_FRONTSWAP */
65#define disable_frontswap_selfshrinking 1
66#endif /* CONFIG_FRONTSWAP */
67
23#define TMEM_CONTROL 0 68#define TMEM_CONTROL 0
24#define TMEM_NEW_POOL 1 69#define TMEM_NEW_POOL 1
25#define TMEM_DESTROY_POOL 2 70#define TMEM_DESTROY_POOL 2
@@ -125,16 +170,6 @@ static int xen_tmem_flush_object(u32 pool_id, struct tmem_oid oid)
125 return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0); 170 return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0);
126} 171}
127 172
128#ifndef CONFIG_XEN_TMEM_MODULE
129bool __read_mostly tmem_enabled = false;
130
131static int __init enable_tmem(char *s)
132{
133 tmem_enabled = true;
134 return 1;
135}
136__setup("tmem", enable_tmem);
137#endif
138 173
139#ifdef CONFIG_CLEANCACHE 174#ifdef CONFIG_CLEANCACHE
140static int xen_tmem_destroy_pool(u32 pool_id) 175static int xen_tmem_destroy_pool(u32 pool_id)
@@ -226,20 +261,6 @@ static int tmem_cleancache_init_shared_fs(char *uuid, size_t pagesize)
226 return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize); 261 return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize);
227} 262}
228 263
229static bool disable_cleancache __read_mostly;
230static bool disable_selfballooning __read_mostly;
231#ifdef CONFIG_XEN_TMEM_MODULE
232module_param(disable_cleancache, bool, S_IRUGO);
233module_param(disable_selfballooning, bool, S_IRUGO);
234#else
235static int __init no_cleancache(char *s)
236{
237 disable_cleancache = true;
238 return 1;
239}
240__setup("nocleancache", no_cleancache);
241#endif
242
243static struct cleancache_ops tmem_cleancache_ops = { 264static struct cleancache_ops tmem_cleancache_ops = {
244 .put_page = tmem_cleancache_put_page, 265 .put_page = tmem_cleancache_put_page,
245 .get_page = tmem_cleancache_get_page, 266 .get_page = tmem_cleancache_get_page,
@@ -357,20 +378,6 @@ static void tmem_frontswap_init(unsigned ignored)
357 xen_tmem_new_pool(private, TMEM_POOL_PERSIST, PAGE_SIZE); 378 xen_tmem_new_pool(private, TMEM_POOL_PERSIST, PAGE_SIZE);
358} 379}
359 380
360static bool disable_frontswap __read_mostly;
361static bool disable_frontswap_selfshrinking __read_mostly;
362#ifdef CONFIG_XEN_TMEM_MODULE
363module_param(disable_frontswap, bool, S_IRUGO);
364module_param(disable_frontswap_selfshrinking, bool, S_IRUGO);
365#else
366static int __init no_frontswap(char *s)
367{
368 disable_frontswap = true;
369 return 1;
370}
371__setup("nofrontswap", no_frontswap);
372#endif
373
374static struct frontswap_ops tmem_frontswap_ops = { 381static struct frontswap_ops tmem_frontswap_ops = {
375 .store = tmem_frontswap_store, 382 .store = tmem_frontswap_store,
376 .load = tmem_frontswap_load, 383 .load = tmem_frontswap_load,
@@ -378,8 +385,6 @@ static struct frontswap_ops tmem_frontswap_ops = {
378 .invalidate_area = tmem_frontswap_flush_area, 385 .invalidate_area = tmem_frontswap_flush_area,
379 .init = tmem_frontswap_init 386 .init = tmem_frontswap_init
380}; 387};
381#else /* CONFIG_FRONTSWAP */
382#define disable_frontswap_selfshrinking 1
383#endif 388#endif
384 389
385static int xen_tmem_init(void) 390static int xen_tmem_init(void)