diff options
Diffstat (limited to 'tmpfs/node.c')
-rw-r--r-- | tmpfs/node.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tmpfs/node.c b/tmpfs/node.c index fd6bd722..17fe8ce7 100644 --- a/tmpfs/node.c +++ b/tmpfs/node.c @@ -61,8 +61,10 @@ diskfs_free_node (struct node *np, mode_t mode) switch (np->dn->type) { case DT_REG: - if (np->dn->u.reg.memobj != MACH_PORT_NULL) + if (np->dn->u.reg.memobj != MACH_PORT_NULL) { + vm_deallocate (mach_task_self (), np->dn->u.reg.memref, 4096); mach_port_deallocate (mach_task_self (), np->dn->u.reg.memobj); + } break; case DT_DIR: assert (np->dn->u.dir.entries == 0); @@ -96,9 +98,9 @@ diskfs_node_norefs (struct node *np) np->dn->uid = np->dn_stat.st_uid; np->dn->author = np->dn_stat.st_author; np->dn->gid = np->dn_stat.st_gid; - np->dn->atime = np->dn_stat.st_atime; - np->dn->mtime = np->dn_stat.st_mtime; - np->dn->ctime = np->dn_stat.st_ctime; + np->dn->atime = np->dn_stat.st_atim; + np->dn->mtime = np->dn_stat.st_mtim; + np->dn->ctime = np->dn_stat.st_ctim; np->dn->flags = np->dn_stat.st_flags; switch (np->dn->type) @@ -200,9 +202,9 @@ diskfs_cached_lookup (ino_t inum, struct node **npp) st->st_uid = dn->uid; st->st_author = dn->author; st->st_gid = dn->gid; - st->st_atime = dn->atime; - st->st_mtime = dn->mtime; - st->st_ctime = dn->ctime; + st->st_atim = dn->atime; + st->st_mtim = dn->mtime; + st->st_ctim = dn->ctime; st->st_flags = dn->flags; st->st_rdev = 0; @@ -500,6 +502,13 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot) 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); } /* XXX always writable */ |