diff options
Diffstat (limited to 'drivers/xen/tmem.c')
-rw-r--r-- | drivers/xen/tmem.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c index 18e8bd8fa947..0f0493c63371 100644 --- a/drivers/xen/tmem.c +++ b/drivers/xen/tmem.c | |||
@@ -41,6 +41,8 @@ module_param(selfballooning, bool, S_IRUGO); | |||
41 | #ifdef CONFIG_FRONTSWAP | 41 | #ifdef CONFIG_FRONTSWAP |
42 | static bool frontswap __read_mostly = true; | 42 | static bool frontswap __read_mostly = true; |
43 | module_param(frontswap, bool, S_IRUGO); | 43 | module_param(frontswap, bool, S_IRUGO); |
44 | #else /* CONFIG_FRONTSWAP */ | ||
45 | #define frontswap (0) | ||
44 | #endif /* CONFIG_FRONTSWAP */ | 46 | #endif /* CONFIG_FRONTSWAP */ |
45 | 47 | ||
46 | #ifdef CONFIG_XEN_SELFBALLOONING | 48 | #ifdef CONFIG_XEN_SELFBALLOONING |
@@ -377,10 +379,10 @@ static int xen_tmem_init(void) | |||
377 | #ifdef CONFIG_FRONTSWAP | 379 | #ifdef CONFIG_FRONTSWAP |
378 | if (tmem_enabled && frontswap) { | 380 | if (tmem_enabled && frontswap) { |
379 | char *s = ""; | 381 | char *s = ""; |
380 | struct frontswap_ops *old_ops = | 382 | struct frontswap_ops *old_ops; |
381 | frontswap_register_ops(&tmem_frontswap_ops); | ||
382 | 383 | ||
383 | tmem_frontswap_poolid = -1; | 384 | tmem_frontswap_poolid = -1; |
385 | old_ops = frontswap_register_ops(&tmem_frontswap_ops); | ||
384 | if (IS_ERR(old_ops) || old_ops) { | 386 | if (IS_ERR(old_ops) || old_ops) { |
385 | if (IS_ERR(old_ops)) | 387 | if (IS_ERR(old_ops)) |
386 | return PTR_ERR(old_ops); | 388 | return PTR_ERR(old_ops); |