summaryrefslogtreecommitdiff
path: root/tmpfs
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2011-11-20 09:32:22 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-11-20 09:32:22 +0100
commitb378f6a008890a2f5497d63c1173a66151ef0915 (patch)
tree6945a82cef859a4f55b29cdf4a8563a33910b136 /tmpfs
parent969fbb646ffd89a482302e303eaded79781c3331 (diff)
Work with memory object only after vm_map has been performed
* tmpfs/node.c (diskfs_get_filemap): Work with memory object only after vm_map has been performed.
Diffstat (limited to 'tmpfs')
-rw-r--r--tmpfs/node.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tmpfs/node.c b/tmpfs/node.c
index 17fe8ce7..b2503a05 100644
--- a/tmpfs/node.c
+++ b/tmpfs/node.c
@@ -498,17 +498,18 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
return MACH_PORT_NULL;
}
assert (np->dn->u.reg.memobj != MACH_PORT_NULL);
- /* A new-fangled default pager lets us prevent user accesses
- past the specified size of the file. */
- err = default_pager_object_set_size (np->dn->u.reg.memobj,
- np->allocsize);
- assert_perror (err);
/* XXX we need to keep a reference to the object, or GNU Mach
will terminate it when we release the map. */
vm_map (mach_task_self (), &np->dn->u.reg.memref, 4096, 0, 1,
np->dn->u.reg.memobj, 0, 0, VM_PROT_NONE, VM_PROT_NONE,
VM_INHERIT_NONE);
+
+ /* A new-fangled default pager lets us prevent user accesses
+ past the specified size of the file. */
+ err = default_pager_object_set_size (np->dn->u.reg.memobj,
+ np->allocsize);
+ assert_perror (err);
}
/* XXX always writable */