summaryrefslogtreecommitdiff
path: root/ufs
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-07-11 05:32:44 +0000
committerThomas Bushnell <thomas@gnu.org>1999-07-11 05:32:44 +0000
commit19b72e1976be3b741e393c0dce1da57f4bd912ee (patch)
tree73493f247aa698af9b6fe5f0a7396a79128415ae /ufs
parente2d7e4852ab842d893675e56e6f48871b73371dc (diff)
1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
* dir.c (diskfs_get_directs): Use mmap instead of vm_allocate. * hyper.c (get_hypermetadata): Likewise. * pager.c (pager_read_page): Likewise.
Diffstat (limited to 'ufs')
-rw-r--r--ufs/ChangeLog11
-rw-r--r--ufs/dir.c2
-rw-r--r--ufs/hyper.c7
-rw-r--r--ufs/pager.c5
4 files changed, 17 insertions, 8 deletions
diff --git a/ufs/ChangeLog b/ufs/ChangeLog
index 209d39df..869840b8 100644
--- a/ufs/ChangeLog
+++ b/ufs/ChangeLog
@@ -2,6 +2,17 @@
* ufs.h: Add #include <sys/mman.h> for munmap decl.
+1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * dir.c (diskfs_get_directs): Use mmap instead of vm_allocate.
+ * hyper.c (get_hypermetadata): Likewise.
+ * pager.c (pager_read_page): Likewise.
+
+1999-07-06 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * hyper.c (diskfs_readonly_changed): Use mprotect instead of
+ vm_protect.
+
Mon Jul 5 20:04:58 1999 Thomas Bushnell, BSG <tb@mit.edu>
* dir.c (diskfs_lookup_hard): Repair typo. Reported by Yamashita
diff --git a/ufs/dir.c b/ufs/dir.c
index c0352d03..304c8a44 100644
--- a/ufs/dir.c
+++ b/ufs/dir.c
@@ -863,7 +863,7 @@ diskfs_get_directs (struct node *dp,
allocsize = round_page (bufsiz);
if (allocsize > *datacnt)
- vm_allocate (mach_task_self (), (vm_address_t *) data, allocsize, 1);
+ *data = mmap (0, allocsize, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
/* Scan through the entries to find ENTRY. If we encounter
a -1 in the process then stop to fill it. When we run
diff --git a/ufs/hyper.c b/ufs/hyper.c
index deb4a5df..c907d274 100644
--- a/ufs/hyper.c
+++ b/ufs/hyper.c
@@ -257,8 +257,7 @@ get_hypermetadata (void)
exit (1);
}
- vm_allocate (mach_task_self (),
- (vm_address_t *)&zeroblock, sblock->fs_bsize, 1);
+ zeroblock = mmap (0, sblock->fs_bsize, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
/* If the filesystem has new features in it, don't pay attention to
the user's request not to use them. */
@@ -397,9 +396,7 @@ diskfs_readonly_changed (int readonly)
{
(*(readonly ? store_set_flags : store_clear_flags)) (store, STORE_READONLY);
- vm_protect (mach_task_self (),
- (vm_address_t)disk_image, store->size,
- 0, VM_PROT_READ | (readonly ? 0 : VM_PROT_WRITE));
+ mprotect (disk_image, store->size, PROT_READ | (readonly ? 0 : PROT_WRITE));
if (readonly)
{
diff --git a/ufs/pager.c b/ufs/pager.c
index 61695db6..e703bfd2 100644
--- a/ufs/pager.c
+++ b/ufs/pager.c
@@ -1,5 +1,5 @@
/* Pager for ufs
- Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation
+ Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -180,7 +180,8 @@ pager_read_page (struct user_pager_info *pager,
printf ("Write-locked pagein Object %#x\tOffset %#x\n", pager, page);
fflush (stdout);
#endif
- vm_allocate (mach_task_self (), buf, __vm_page_size, 1);
+ *buf = (vm_address_t) mmap (0, vm_page_size, PROT_READ|PROT_WRITE,
+ MAP_ANON, 0, 0);
*writelock = 1;
}