[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v1 04/12] tmem: Wrap tmem tze code with CONFIG_TMEM_TZE



. which is actually dependent on CONFIG_TMEM_DEDUP

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
v1: First submission.
---
 xen/common/tmem.c          | 12 ++++++++++--
 xen/common/tmem_xen.c      |  4 ++++
 xen/include/xen/tmem_xen.h |  4 ++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 8327218..b673120 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -96,7 +96,9 @@ struct tmem_page_content_descriptor {
     union {
         struct page_info *pfp;  /* Page frame pointer. */
         char *cdata; /* If compression_enabled. */
+#ifdef CONFIG_TMEM_TZE
         char *tze; /* If !compression_enabled, trailing zeroes eliminated. */
+#endif
     };
 #ifdef CONFIG_TMEM_DEDUP
     struct list_head pgp_list;
@@ -2424,8 +2426,14 @@ static int __init init_tmem(void)
 #else
                0,
 #endif
-               tmem_tze_enabled());
-#ifdef CONFIG_TMEM_DEDUP
+#ifdef CONFIG_TMEM_TZE
+               tmem_tze_enabled()
+#else
+               0
+#endif
+            );
+
+#if defined(CONFIG_TMEM_DEDUP) && defined(CONFIG_TMEM_TZE)
         if ( 
tmem_dedup_enabled()&&tmem_compression_enabled()&&tmem_tze_enabled() )
         {
             tmem_tze_disable();
diff --git a/xen/common/tmem_xen.c b/xen/common/tmem_xen.c
index 9a2bfed..d42deef 100644
--- a/xen/common/tmem_xen.c
+++ b/xen/common/tmem_xen.c
@@ -25,8 +25,10 @@ bool_t __read_mostly opt_tmem_dedup = 0;
 boolean_param("tmem_dedup", opt_tmem_dedup);
 #endif
 
+#ifdef CONFIG_TMEM_TZE
 bool_t __read_mostly opt_tmem_tze = 0;
 boolean_param("tmem_tze", opt_tmem_tze);
+#endif
 
 bool_t __read_mostly opt_tmem_shared_auth = 0;
 boolean_param("tmem_shared_auth", opt_tmem_shared_auth);
@@ -218,6 +220,7 @@ int tmem_decompress_to_client(xen_pfn_t cmfn, void *tmem_va,
     return 1;
 }
 
+#ifdef CONFIG_TMEM_TZE
 int tmem_copy_tze_to_client(xen_pfn_t cmfn, void *tmem_va,
                                     pagesize_t len)
 {
@@ -239,6 +242,7 @@ int tmem_copy_tze_to_client(xen_pfn_t cmfn, void *tmem_va,
     smp_mb();
     return 1;
 }
+#endif
 
 /******************  XEN-SPECIFIC HOST INITIALIZATION ********************/
 static int dstmem_order, workmem_order;
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 52f87b1..3be8001 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -49,6 +49,7 @@ static inline bool_t tmem_dedup_enabled(void)
 }
 #endif
 
+#ifdef CONFIG_TMEM_TZE
 extern bool_t opt_tmem_tze;
 static inline bool_t tmem_tze_enabled(void)
 {
@@ -59,6 +60,7 @@ static inline void tmem_tze_disable(void)
 {
     opt_tmem_tze = 0;
 }
+#endif
 
 extern bool_t opt_tmem_shared_auth;
 static inline bool_t tmem_shared_auth(void)
@@ -340,7 +342,9 @@ int tmem_compress_from_client(xen_pfn_t, void **, size_t *,
 
 int tmem_copy_from_client(struct page_info *, xen_pfn_t, tmem_cli_va_param_t);
 int tmem_copy_to_client(xen_pfn_t, struct page_info *, tmem_cli_va_param_t);
+#ifdef CONFIG_TMEM_TZE
 extern int tmem_copy_tze_to_client(xen_pfn_t cmfn, void *tmem_va, pagesize_t 
len);
+#endif
 
 #define tmem_client_err(fmt, args...)  printk(XENLOG_G_ERR fmt, ##args)
 #define tmem_client_warn(fmt, args...) printk(XENLOG_G_WARNING fmt, ##args)
-- 
2.4.11


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.