summaryrefslogtreecommitdiff
path: root/libpager/lock-completed.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-03-03 20:48:20 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-02 17:44:00 +0200
commitb7cbdde8854ee4c51ec9cd49ce639bd02d646355 (patch)
tree7c1cf1b5011763d20584733d2bb7be1b586b667a /libpager/lock-completed.c
parent64b5d358fcaa039ca2e7634aceaa5ed4c3a10cc4 (diff)
libpager: fix receiver lookups
Previously, the receiver lookup was done manually in all the server functions. Use mig translator functions instead. * libpager/mig-decls.h: New file. * libpager/mig-mutate.h: Likewise. * libpager/Makefile (MIGSFLAGS): Include mig-mutate.h. * libpager/chg-compl.c: Fix receiver lookups. * libpager/data-request.c: Likewise. * libpager/data-return.c: Likewise. * libpager/data-unlock.c: Likewise. * libpager/lock-completed.c: Likewise. * libpager/object-init.c: Likewise. * libpager/object-terminate.c: Likewise. * libpager/stubs.c: Likewise. * libpager/seqnos.c (_pager_update_seqno): Move the actual functionality... (_pager_update_seqno_p): ... into a new function that can be called with a pointer to struct pager. * libpager/priv.h (_pager_update_seqno_p): New declaration.
Diffstat (limited to 'libpager/lock-completed.c')
-rw-r--r--libpager/lock-completed.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libpager/lock-completed.c b/libpager/lock-completed.c
index 9ab640fe..a3f3f168 100644
--- a/libpager/lock-completed.c
+++ b/libpager/lock-completed.c
@@ -23,18 +23,17 @@
when a memory_object_lock_request call has completed. Read this
in combination with lock-object.c. */
kern_return_t
-_pager_seqnos_memory_object_lock_completed (mach_port_t object,
+_pager_seqnos_memory_object_lock_completed (struct pager *p,
mach_port_seqno_t seqno,
mach_port_t control,
vm_offset_t offset,
vm_size_t length)
{
error_t err = 0;
- struct pager *p;
struct lock_request *lr;
- p = ports_lookup_port (0, object, _pager_class);
- if (!p)
+ if (!p
+ || p->port.class != _pager_class)
return EOPNOTSUPP;
pthread_mutex_lock (&p->interlock);
@@ -62,7 +61,6 @@ _pager_seqnos_memory_object_lock_completed (mach_port_t object,
out:
_pager_release_seqno (p, seqno);
pthread_mutex_unlock (&p->interlock);
- ports_port_deref (p);
return err;
}