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

[Xen-changelog] [xen-unstable] Replace mlock() calls with lock_pages().



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxxx
# Date 1169818319 0
# Node ID 16f7f5ac80ed601f06b0b2b3b2ec8472dd5aa0e2
# Parent  e0291e3ed603f5437d1e88c7b746b6617346792c
Replace mlock() calls with lock_pages().
Signed-off-by: Russell Blaine <russell.blaine@xxxxxxx>
---
 tools/libxc/xc_misc.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff -r e0291e3ed603 -r 16f7f5ac80ed tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c     Fri Jan 26 13:27:01 2007 +0000
+++ b/tools/libxc/xc_misc.c     Fri Jan 26 13:31:59 2007 +0000
@@ -110,15 +110,15 @@ int xc_hvm_set_pci_intx_level(
     arg.intx   = intx;
     arg.level  = level;
 
-    if ( mlock(&arg, sizeof(arg)) != 0 )
+    if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 )
     {
         PERROR("Could not lock memory");
-        return -1;
+        return rc;
     }
 
     rc = do_xen_hypercall(xc_handle, &hypercall);
 
-    safe_munlock(&arg, sizeof(arg));
+    unlock_pages(&arg, sizeof(arg));
 
     return rc;
 }
@@ -140,15 +140,15 @@ int xc_hvm_set_isa_irq_level(
     arg.isa_irq = isa_irq;
     arg.level   = level;
 
-    if ( mlock(&arg, sizeof(arg)) != 0 )
+    if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 )
     {
         PERROR("Could not lock memory");
-        return -1;
+        return rc;
     }
 
     rc = do_xen_hypercall(xc_handle, &hypercall);
 
-    safe_munlock(&arg, sizeof(arg));
+    unlock_pages(&arg, sizeof(arg));
 
     return rc;
 }
@@ -168,15 +168,15 @@ int xc_hvm_set_pci_link_route(
     arg.link    = link;
     arg.isa_irq = isa_irq;
 
-    if ( mlock(&arg, sizeof(arg)) != 0 )
+    if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 )
     {
         PERROR("Could not lock memory");
-        return -1;
+        return rc;
     }
 
     rc = do_xen_hypercall(xc_handle, &hypercall);
 
-    safe_munlock(&arg, sizeof(arg));
+    unlock_pages(&arg, sizeof(arg));
 
     return rc;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.