diff options
| author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-08 17:10:08 -0400 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-15 10:27:46 -0400 |
| commit | 9fd19653faceef210f30901f7cee0ceb13c6f39a (patch) | |
| tree | c86cf92d288f72c98f24c8ed976f47fd413e9390 | |
| parent | 23972c639980ba796a05ae9432df8267175b99ae (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>
| -rw-r--r-- | drivers/xen/tmem.c | 27 |
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 |
| 35 | static bool disable_cleancache __read_mostly; | 35 | static bool cleancache __read_mostly = true; |
| 36 | static bool disable_selfballooning __read_mostly; | 36 | static bool selfballooning __read_mostly = true; |
| 37 | #ifdef CONFIG_XEN_TMEM_MODULE | 37 | #ifdef CONFIG_XEN_TMEM_MODULE |
| 38 | module_param(disable_cleancache, bool, S_IRUGO); | 38 | module_param(cleancache, bool, S_IRUGO); |
| 39 | module_param(disable_selfballooning, bool, S_IRUGO); | 39 | module_param(selfballooning, bool, S_IRUGO); |
| 40 | #else | 40 | #else |
| 41 | static int __init no_cleancache(char *s) | 41 | static 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 |
| 51 | static bool disable_frontswap __read_mostly; | 51 | static bool frontswap __read_mostly = true; |
| 52 | #ifdef CONFIG_XEN_TMEM_MODULE | 52 | #ifdef CONFIG_XEN_TMEM_MODULE |
| 53 | module_param(disable_frontswap, bool, S_IRUGO); | 53 | module_param(frontswap, bool, S_IRUGO); |
| 54 | #else | 54 | #else |
| 55 | static int __init no_frontswap(char *s) | 55 | static 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 |
| 65 | static bool disable_frontswap_selfshrinking __read_mostly; | 65 | static bool frontswap_selfshrinking __read_mostly = true; |
| 66 | #ifdef CONFIG_XEN_TMEM_MODULE | 66 | #ifdef CONFIG_XEN_TMEM_MODULE |
| 67 | module_param(disable_frontswap_selfshrinking, bool, S_IRUGO); | 67 | module_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 | } |
