diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-08 15:50:59 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-15 10:27:43 -0400 |
commit | 0cb401d44e1152658c99c8566de915c2d71eab9e (patch) | |
tree | 28b41ebaa49efc519dd08f5e3842080bed07ca71 /drivers/xen | |
parent | a5e9cd952e2ee215286ea3ec5e6b3aa669e04e0e (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')
-rw-r--r-- | drivers/xen/tmem.c | 85 |
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 | ||
24 | bool __read_mostly tmem_enabled = false; | ||
25 | |||
26 | static 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 | ||
35 | static bool disable_cleancache __read_mostly; | ||
36 | static bool disable_selfballooning __read_mostly; | ||
37 | #ifdef CONFIG_XEN_TMEM_MODULE | ||
38 | module_param(disable_cleancache, bool, S_IRUGO); | ||
39 | module_param(disable_selfballooning, bool, S_IRUGO); | ||
40 | #else | ||
41 | static 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 | ||
51 | static bool disable_frontswap __read_mostly; | ||
52 | static bool disable_frontswap_selfshrinking __read_mostly; | ||
53 | #ifdef CONFIG_XEN_TMEM_MODULE | ||
54 | module_param(disable_frontswap, bool, S_IRUGO); | ||
55 | module_param(disable_frontswap_selfshrinking, bool, S_IRUGO); | ||
56 | #else | ||
57 | static 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 | ||
129 | bool __read_mostly tmem_enabled = false; | ||
130 | |||
131 | static 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 |
140 | static int xen_tmem_destroy_pool(u32 pool_id) | 175 | static 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 | ||
229 | static bool disable_cleancache __read_mostly; | ||
230 | static bool disable_selfballooning __read_mostly; | ||
231 | #ifdef CONFIG_XEN_TMEM_MODULE | ||
232 | module_param(disable_cleancache, bool, S_IRUGO); | ||
233 | module_param(disable_selfballooning, bool, S_IRUGO); | ||
234 | #else | ||
235 | static int __init no_cleancache(char *s) | ||
236 | { | ||
237 | disable_cleancache = true; | ||
238 | return 1; | ||
239 | } | ||
240 | __setup("nocleancache", no_cleancache); | ||
241 | #endif | ||
242 | |||
243 | static struct cleancache_ops tmem_cleancache_ops = { | 264 | static 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 | ||
360 | static bool disable_frontswap __read_mostly; | ||
361 | static bool disable_frontswap_selfshrinking __read_mostly; | ||
362 | #ifdef CONFIG_XEN_TMEM_MODULE | ||
363 | module_param(disable_frontswap, bool, S_IRUGO); | ||
364 | module_param(disable_frontswap_selfshrinking, bool, S_IRUGO); | ||
365 | #else | ||
366 | static int __init no_frontswap(char *s) | ||
367 | { | ||
368 | disable_frontswap = true; | ||
369 | return 1; | ||
370 | } | ||
371 | __setup("nofrontswap", no_frontswap); | ||
372 | #endif | ||
373 | |||
374 | static struct frontswap_ops tmem_frontswap_ops = { | 381 | static 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 | ||
385 | static int xen_tmem_init(void) | 390 | static int xen_tmem_init(void) |