From 511d0368972e61018b20e1debbefea04264fcd08 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sun, 11 Jul 1999 05:30:09 +0000 Subject: 1999-07-09 Thomas Bushnell, BSG * file-get-storage-info.c (netfs_S_file_get_storage_info): Use mmap instead of vm_allocate. * file-get-translator.c (netfs_S_file_get_translator): Likewise. * io-read.c (netfs_S_io_read): Likewise. --- libnetfs/ChangeLog | 7 +++++++ libnetfs/file-get-storage-info.c | 9 ++++----- libnetfs/file-get-translator.c | 10 +++++----- libnetfs/io-read.c | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/libnetfs/ChangeLog b/libnetfs/ChangeLog index dc9f3e8a..3e024d15 100644 --- a/libnetfs/ChangeLog +++ b/libnetfs/ChangeLog @@ -3,6 +3,13 @@ * io-read.c: Add #include for munmap decl. * release-protid.c: Likewise. +1999-07-09 Thomas Bushnell, BSG + + * file-get-storage-info.c (netfs_S_file_get_storage_info): Use + mmap instead of vm_allocate. + * file-get-translator.c (netfs_S_file_get_translator): Likewise. + * io-read.c (netfs_S_io_read): Likewise. + 1999-07-03 Thomas Bushnell, BSG * io-read.c (netfs_S_io_read): Use munmap instead of diff --git a/libnetfs/file-get-storage-info.c b/libnetfs/file-get-storage-info.c index 05232e85..c8fec33c 100644 --- a/libnetfs/file-get-storage-info.c +++ b/libnetfs/file-get-storage-info.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -41,10 +41,9 @@ netfs_S_file_get_storage_info (struct protid *user, if (*num_ints == 0) /* Argh */ { - error_t err = - vm_allocate (mach_task_self (), (vm_address_t *)ints, sizeof (int), 1); - if (err) - return err; + *ints = mmap (0, sizeof (int), PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + if (*ints == (int *) -1) + return errno; } *num_ints = 1; diff --git a/libnetfs/file-get-translator.c b/libnetfs/file-get-translator.c index d3c6342c..d95940c1 100644 --- a/libnetfs/file-get-translator.c +++ b/libnetfs/file-get-translator.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1999 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -50,7 +50,7 @@ netfs_S_file_get_translator (struct protid *user, unsigned int len = sizeof _HURD_SYMLINK + np->nn_stat.st_size + 1; 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); err = netfs_attempt_readlink (user->user, np, @@ -75,7 +75,7 @@ netfs_S_file_get_translator (struct protid *user, 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; @@ -87,7 +87,7 @@ netfs_S_file_get_translator (struct protid *user, 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; err = 0; @@ -98,7 +98,7 @@ netfs_S_file_get_translator (struct protid *user, 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; err = 0; diff --git a/libnetfs/io-read.c b/libnetfs/io-read.c index 4c97c297..a4b1b2e2 100644 --- a/libnetfs/io-read.c +++ b/libnetfs/io-read.c @@ -50,7 +50,7 @@ netfs_S_io_read (struct protid *user, if (amount > *datalen) { alloced = 1; - vm_allocate (mach_task_self (), (vm_address_t *) data, amount, 1); + *data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); } *datalen = amount; -- cgit v1.2.3