summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdiskfs/ChangeLog9
-rw-r--r--libdiskfs/boot-start.c12
-rw-r--r--libdiskfs/file-get-trans.c11
-rw-r--r--libdiskfs/file-getfh.c6
-rw-r--r--libdiskfs/io-read.c2
5 files changed, 24 insertions, 16 deletions
diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog
index 75bc9efd..306cb63a 100644
--- a/libdiskfs/ChangeLog
+++ b/libdiskfs/ChangeLog
@@ -2,6 +2,15 @@
* priv.h: Add #include <sys/mman.h> for munmap decl.
+1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * boot-start.c (diskfs_S_exec_startup_get_info): Use mmap instead
+ of vm_allocate.
+ (diskfs_S_fsys_init): Likewise.
+ * file-get-trans.c (diskfs_S_file_get_translator): Likewise.
+ * file-getfh.c (diskfs_S_file_getfh): Likewise.
+ * io-read.c (diskfs_S_io_read): Likewise.
+
Mon Jul 5 20:03:18 1999 Thomas Bushnell, BSG <tb@mit.edu>
* node-nputl.c (diskfs_nput_light): Fix typo in function
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index 83ac5a91..baac9d00 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -348,14 +348,14 @@ diskfs_S_exec_startup_get_info (mach_port_t port,
*flags = EXEC_STACK_ARGS;
if (*portarraylen < INIT_PORT_MAX)
- vm_allocate (mach_task_self (), (vm_address_t *) portarrayP,
- (INIT_PORT_MAX * sizeof (mach_port_t)), 1);
+ *portarrayP = mmap (0, INIT_PORT_MAX * sizeof (mach_port_t),
+ PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
portarray = *portarrayP;
*portarraylen = INIT_PORT_MAX;
if (*dtablelen < 3)
- vm_allocate (mach_task_self (), (vm_address_t *) dtableP,
- (3 * sizeof (mach_port_t)), 1);
+ *dtableP = mmap (0, 3 * sizeof (mach_port_t), PROT_READ|PROT_WRITE,
+ MAP_ANON, 0, 0)
dtable = *dtableP;
*dtablelen = 3;
dtable[0] = dtable[1] = dtable[2] = get_console (); /* XXX */
@@ -594,8 +594,8 @@ diskfs_S_fsys_init (mach_port_t port,
and call _hurd_init. */
mach_port_t *portarray;
unsigned int i;
- vm_allocate (mach_task_self (), (vm_address_t *) &portarray,
- INIT_PORT_MAX * sizeof *portarray, 1);
+ portarray = mmap (0, INIT_PORT_MAX * sizeof *portarray,
+ PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
if (MACH_PORT_NULL != (mach_port_t) 0)
for (i = 0; i < INIT_PORT_MAX; ++i)
portarray[i] = MACH_PORT_NULL;
diff --git a/libdiskfs/file-get-trans.c b/libdiskfs/file-get-trans.c
index 77be4e1a..118222be 100644
--- a/libdiskfs/file-get-trans.c
+++ b/libdiskfs/file-get-trans.c
@@ -44,7 +44,7 @@ diskfs_S_file_get_translator (struct protid *cred,
int amt;
assert (diskfs_shortcut_symlink);
if (len > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *)trans, len, 1);
+ *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (_HURD_SYMLINK, *trans, sizeof _HURD_SYMLINK);
if (diskfs_read_symlink_hook)
@@ -84,7 +84,7 @@ diskfs_S_file_get_translator (struct protid *cred,
buflen++; /* terminating nul */
if (buflen > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *) trans, buflen, 1);
+ *trans = mmap (0, buflen, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (buf, *trans, buflen);
free (buf);
*translen = buflen;
@@ -96,7 +96,7 @@ diskfs_S_file_get_translator (struct protid *cred,
len = sizeof _HURD_FIFO;
if (len > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *) trans, len, 1);
+ *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (_HURD_FIFO, *trans, sizeof _HURD_FIFO);
*translen = len;
error = 0;
@@ -107,7 +107,7 @@ diskfs_S_file_get_translator (struct protid *cred,
len = sizeof _HURD_IFSOCK;
if (len > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *) trans, len, 1);
+ *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (_HURD_IFSOCK, *trans, sizeof _HURD_IFSOCK);
*translen = len;
error = 0;
@@ -124,8 +124,7 @@ diskfs_S_file_get_translator (struct protid *cred,
if (!error)
{
if (len > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *) trans,
- len, 1);
+ *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (string, *trans, len);
*translen = len;
free (string);
diff --git a/libdiskfs/file-getfh.c b/libdiskfs/file-getfh.c
index 1b23b80c..c755e911 100644
--- a/libdiskfs/file-getfh.c
+++ b/libdiskfs/file-getfh.c
@@ -1,6 +1,6 @@
/* Return a file handle (for nfs server support)
- Copyright (C) 1997 Free Software Foundation
+ Copyright (C) 1997, 1999 Free Software Foundation
This file is part of the GNU Hurd.
@@ -42,8 +42,8 @@ diskfs_S_file_getfh (struct protid *cred, char **fh, unsigned *fh_len)
mutex_lock (&node->lock);
if (*fh_len < sizeof (struct diskfs_fhandle))
- vm_allocate (mach_task_self (), (vm_address_t *) fh,
- sizeof (struct diskfs_fhandle), 1);
+ *fh = mmap (0, sizeof (struct diskfs_fhandle), PROT_READ|PROT_WRITE,
+ MAP_ANON, 0, 0);
*fh_len = sizeof (struct diskfs_fhandle);
f = (struct diskfs_fhandle *)*fh;
diff --git a/libdiskfs/io-read.c b/libdiskfs/io-read.c
index b25359d7..8f0b4a03 100644
--- a/libdiskfs/io-read.c
+++ b/libdiskfs/io-read.c
@@ -60,7 +60,7 @@ diskfs_S_io_read (struct protid *cred,
if (maxread > *datalen)
{
ourbuf = 1;
- vm_allocate (mach_task_self (), (u_int *) &buf, maxread, 1);
+ buf = mmap (0, maxread, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
*data = buf;
}
else