summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-02-26 11:03:15 +0000
committerRoland McGrath <roland@gnu.org>2001-02-26 11:03:15 +0000
commit5c5472909519f67d643e2237ba1d5d6c21f260c4 (patch)
tree092d980637055e2de75e69185dfc4ed88cd0d449
parent5bce3f0ed1cbafaa4a035be9c578c733e1afcbbd (diff)
2001-02-26 Roland McGrath <roland@frob.com>
* node.c (diskfs_free_node): Reset hnext's hprevp. (diskfs_node_norefs): Likewise. (diskfs_cached_lookup): Fix insane code for finding existing node ptr. (diskfs_get_filemap_pager_struct): Remove spurious assert. (diskfs_get_filemap): Always add a reference to the send right.
-rw-r--r--tmpfs/node.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tmpfs/node.c b/tmpfs/node.c
index aae59c74..92768ee8 100644
--- a/tmpfs/node.c
+++ b/tmpfs/node.c
@@ -433,6 +433,8 @@ diskfs_grow (struct node *np, off_t size, struct protid *cred)
mach_port_t
diskfs_get_filemap (struct node *np, vm_prot_t prot)
{
+ error_t err;
+
if (np->dn->type != DT_REG)
{
errno = EOPNOTSUPP; /* ? */
@@ -440,7 +442,10 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
}
if (default_pager == MACH_PORT_NULL)
- return EIO;
+ {
+ errno = EIO;
+ return MACH_PORT_NULL;
+ }
/* We don't bother to create the memory object until the first time we
need it (i.e. first mapping or i/o). This way we might have a clue
@@ -465,6 +470,12 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
}
/* XXX always writable */
+
+ /* Add a reference for each call, the caller will deallocate it. */
+ err = mach_port_mod_refs (mach_task_self (), np->dn->u.reg.memobj,
+ MACH_PORT_RIGHT_SEND, +1);
+ assert_perror (err);
+
return np->dn->u.reg.memobj;
}
@@ -475,7 +486,6 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
struct pager *
diskfs_get_filemap_pager_struct (struct node *np)
{
- assert (!"fault on default pager object?");
return 0;
}