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

[Xen-changelog] [xen-4.2-testing] tmem: cleanup


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-4.2-testing <patchbot@xxxxxxx>
  • Date: Wed, 26 Sep 2012 14:44:13 +0000
  • Delivery-date: Wed, 26 Sep 2012 14:44:19 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1348568308 -7200
# Node ID 1853e31bb956699ef0502248a22c21b3aa27efa7
# Parent  7904c87be3f301ae617f17686e267570706be18a
tmem: cleanup

- one more case of checking for a specific rather than any error
- drop no longer needed first parameter from cli_put_page()
- drop a redundant cast

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
xen-unstable changeset: 25860:e4cb84111610
xen-unstable date: Tue Sep 11 12:19:29 UTC 2012
---


diff -r 7904c87be3f3 -r 1853e31bb956 xen/common/tmem.c
--- a/xen/common/tmem.c Tue Sep 25 12:17:52 2012 +0200
+++ b/xen/common/tmem.c Tue Sep 25 12:18:28 2012 +0200
@@ -1468,7 +1468,7 @@ static NOINLINE int do_tmem_put_compress
         pgp_free_data(pgp, pgp->us.obj->pool);
     START_CYC_COUNTER(compress);
     ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
-    if ( (ret == -EFAULT) || (ret == 0) )
+    if ( ret <= 0 )
         goto out;
     else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
         ret = 0;
diff -r 7904c87be3f3 -r 1853e31bb956 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c     Tue Sep 25 12:17:52 2012 +0200
+++ b/xen/common/tmem_xen.c     Tue Sep 25 12:18:28 2012 +0200
@@ -97,7 +97,7 @@ static inline void *cli_get_page(tmem_cl
     return NULL;
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t 
*cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     ASSERT(0);
@@ -126,20 +126,20 @@ static inline void *cli_get_page(tmem_cl
     }
 
     *pcli_mfn = page_to_mfn(page);
-    *pcli_pfp = (pfp_t *)page;
+    *pcli_pfp = page;
     return map_domain_page(*pcli_mfn);
 }
 
-static inline void cli_put_page(tmem_cli_mfn_t cmfn, void *cli_va, pfp_t 
*cli_pfp,
+static inline void cli_put_page(void *cli_va, pfp_t *cli_pfp,
                                 unsigned long cli_mfn, bool_t mark_dirty)
 {
     if ( mark_dirty )
     {
-        put_page_and_type((struct page_info *)cli_pfp);
+        put_page_and_type(cli_pfp);
         paging_mark_dirty(current->domain,cli_mfn);
     }
     else
-        put_page((struct page_info *)cli_pfp);
+        put_page(cli_pfp);
     unmap_domain_page(cli_va);
 }
 #endif
@@ -188,7 +188,7 @@ EXPORT int tmh_copy_from_client(pfp_t *p
     else if ( len )
         rc = -EINVAL;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     unmap_domain_page(tmem_va);
     return rc;
 }
@@ -221,7 +221,7 @@ EXPORT int tmh_compress_from_client(tmem
     ASSERT(ret == LZO_E_OK);
     *out_va = dmem;
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 0);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 0);
     return 1;
 }
 
@@ -259,7 +259,7 @@ EXPORT int tmh_copy_to_client(tmem_cli_m
         rc = -EINVAL;
     unmap_domain_page(tmem_va);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return rc;
 }
@@ -286,7 +286,7 @@ EXPORT int tmh_decompress_to_client(tmem
     ASSERT(ret == LZO_E_OK);
     ASSERT(out_len == PAGE_SIZE);
     if ( cli_va )
-        cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+        cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     else if ( copy_to_guest(clibuf, scratch, PAGE_SIZE) )
         return -EFAULT;
     mb();
@@ -310,7 +310,7 @@ EXPORT int tmh_copy_tze_to_client(tmem_c
         memcpy((char *)cli_va,(char *)tmem_va,len);
     if ( len < PAGE_SIZE )
         memset((char *)cli_va+len,0,PAGE_SIZE-len);
-    cli_put_page(cmfn, cli_va, cli_pfp, cli_mfn, 1);
+    cli_put_page(cli_va, cli_pfp, cli_mfn, 1);
     mb();
     return 1;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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