summaryrefslogtreecommitdiff
path: root/mach-defpager
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2011-11-20 09:41:59 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-11-20 09:41:59 +0100
commit0162d565bf9b48d8ee33406f2f1d65c05c37fe88 (patch)
treefeb36725b0897b5237b9829a000aabdc963f5ca4 /mach-defpager
parentb378f6a008890a2f5497d63c1173a66151ef0915 (diff)
Fix defpager into using the correct control port
The reply_port is only the correct control port when RPCs are from the kernel, not from e.g. tmpfs, such as default_pager_object_set_size calls. * mach-defpager/default_pager.c (seqnos_memory_object_terminate, S_default_pager_object_set_size): Make default pager use its own memory object control ports for external objects, remove reply_to parameter. * trans/proxy-defpager.c (S_default_pager_object_set_size): Remove reply_to parameter. * hurd/default_pager.defs (default_pager_object_set_size): Remove unused parameter.
Diffstat (limited to 'mach-defpager')
-rw-r--r--mach-defpager/default_pager.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index 5944e4eb..82619b4b 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -2500,6 +2500,8 @@ ddprintf ("seqnos_memory_object_terminate <%p>: pager_port_lock: <%p>[s:%d,r:%d,
pager_port_wait_for_refs(ds);
+ if (ds->external)
+ pager_request = ds->pager_request;
ds->pager_request = MACH_PORT_NULL;
request_refs = ds->request_refs;
ds->request_refs = 0;
@@ -2515,6 +2517,8 @@ ddprintf ("seqnos_memory_object_terminate <%p>: pager_port_unlock: <%p>[s:%d,r:%
* Now we deallocate our various port rights.
*/
+ kr = mach_port_get_refs(default_pager_self, pager_request,
+ MACH_PORT_RIGHT_SEND, &request_refs);
kr = mach_port_mod_refs(default_pager_self, pager_request,
MACH_PORT_RIGHT_SEND, -request_refs);
if (kr != KERN_SUCCESS)
@@ -3724,7 +3728,6 @@ S_default_pager_object_pages (mach_port_t pager,
kern_return_t
S_default_pager_object_set_size (mach_port_t pager,
- mach_port_t reply_to,
mach_port_seqno_t seqno,
vm_size_t limit)
{
@@ -3736,7 +3739,7 @@ S_default_pager_object_set_size (mach_port_t pager,
return KERN_INVALID_ARGUMENT;
pager_port_lock(ds, seqno);
- pager_port_check_request(ds, reply_to);
+ pager_port_check_request(ds, ds->pager_request);
pager_port_wait_for_readers(ds);
pager_port_wait_for_writers(ds);
@@ -3760,7 +3763,7 @@ S_default_pager_object_set_size (mach_port_t pager,
VM_PROT_ALL, ds->pager);
if (kr != KERN_SUCCESS)
panic ("memory_object_lock_request: %d", kr);
- ds->lock_request = reply_to;
+ ds->lock_request = ds->pager_request;
kr = MIG_NO_REPLY;
}
else