diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-07-03 23:49:00 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-07-03 23:49:00 +0000 |
commit | 701e4350e3096a2a5b4a3a57d5feee9349e9f305 (patch) | |
tree | 4fe87d502718b913c7a42cb5f02ae33541e1063e | |
parent | 9db1a6bef5a0f7d3a0ed80a1367649bbaae02e2a (diff) |
1999-07-03 Thomas Bushnell, BSG <tb@mit.edu>
* dir.c (diskfs_lookup_hard): Use munmap instead of vm_deallocate.
(diskfs_direnter_hard): Likewise.
(diskfs_dirremove_hard): Likewise.
(diskfs_dirrewrite_hard): Likewise.
(diskfs_dirempty): Likewise.
(diskfs_drop_dirstat): Likewise.
(diskfs_get_directs): Likewise.
* hyper.c (allocate_mod_map): Likewise.
(get_hypermetadata): Likewise.
* pager.c (free_page_buf): Likewise.
* truncate.c (poke_pages): Likewise.
-rw-r--r-- | ext2fs/ChangeLog | 14 | ||||
-rw-r--r-- | ext2fs/dir.c | 25 | ||||
-rw-r--r-- | ext2fs/hyper.c | 5 | ||||
-rw-r--r-- | ext2fs/pager.c | 2 | ||||
-rw-r--r-- | ext2fs/truncate.c | 4 |
5 files changed, 31 insertions, 19 deletions
diff --git a/ext2fs/ChangeLog b/ext2fs/ChangeLog index 4d98dc70..8784376b 100644 --- a/ext2fs/ChangeLog +++ b/ext2fs/ChangeLog @@ -1,3 +1,17 @@ +1999-07-03 Thomas Bushnell, BSG <tb@mit.edu> + + * dir.c (diskfs_lookup_hard): Use munmap instead of vm_deallocate. + (diskfs_direnter_hard): Likewise. + (diskfs_dirremove_hard): Likewise. + (diskfs_dirrewrite_hard): Likewise. + (diskfs_dirempty): Likewise. + (diskfs_drop_dirstat): Likewise. + (diskfs_get_directs): Likewise. + * hyper.c (allocate_mod_map): Likewise. + (get_hypermetadata): Likewise. + * pager.c (free_page_buf): Likewise. + * truncate.c (poke_pages): Likewise. + 1999-06-29 Thomas Bushnell, BSG <tb@mit.edu> * hyper.c (diskfs_readonly_changed): Adjust whether the store diff --git a/ext2fs/dir.c b/ext2fs/dir.c index b6b8f587..1bfe0dd7 100644 --- a/ext2fs/dir.c +++ b/ext2fs/dir.c @@ -1,6 +1,6 @@ /* Directory management routines - Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. Converted for ext2fs by Miles Bader <miles@gnu.ai.mit.edu> @@ -145,7 +145,7 @@ diskfs_lookup_hard (struct node *dp, const char *name, enum lookup_type type, } if (buf) { - vm_deallocate (mach_task_self (), buf, buflen); + munmap ((caddr_t) buf, buflen); buf = 0; } if (ds && (type == CREATE || type == RENAME)) @@ -189,7 +189,7 @@ diskfs_lookup_hard (struct node *dp, const char *name, enum lookup_type type, } if (err != ENOENT) { - vm_deallocate (mach_task_self (), buf, buflen); + munmap ((caddr_t) buf, buflen); return err; } @@ -303,7 +303,7 @@ diskfs_lookup_hard (struct node *dp, const char *name, enum lookup_type type, || !ds || ds->type == LOOKUP) { - vm_deallocate (mach_task_self (), buf, buflen); + munmap ((caddr_t) buf, buflen); if (ds) ds->type = LOOKUP; /* set to be ignored by drop_dirstat */ } @@ -583,7 +583,7 @@ diskfs_direnter_hard (struct node *dp, const char *name, struct node *np, err = diskfs_grow (dp, oldsize + DIRBLKSIZ, cred); if (err) { - vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent); + munmap ((caddr_t) ds->mapbuf, ds->mapextent); return err; } } @@ -605,7 +605,7 @@ diskfs_direnter_hard (struct node *dp, const char *name, struct node *np, dp->dn_set_mtime = 1; - vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent); + munmap ((caddr_t) ds->mapbuf, ds->mapextent); if (ds->stat != EXTEND) { @@ -672,7 +672,7 @@ diskfs_dirremove_hard (struct node *dp, struct dirstat *ds) dp->dn_set_mtime = 1; - vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent); + munmap ((caddr_t) ds->mapbuf, ds->mapextent); /* If we are keeping count of this block, then keep the count up to date. */ @@ -702,7 +702,7 @@ diskfs_dirrewrite_hard (struct node *dp, struct node *np, struct dirstat *ds) ds->entry->inode = np->cache_id; dp->dn_set_mtime = 1; - vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent); + munmap ((caddr_t) ds->mapbuf, ds->mapextent); diskfs_file_update (dp, 1); @@ -751,7 +751,7 @@ diskfs_dirempty (struct node *dp, struct protid *cred) if (diskfs_synchronous) diskfs_node_update (dp, 1); - vm_deallocate (mach_task_self (), buf, dp->dn_stat.st_size); + munmap ((caddr_t) buf, dp->dn_stat.st_size); return !hit; } @@ -763,7 +763,7 @@ diskfs_drop_dirstat (struct node *dp, struct dirstat *ds) if (ds->type != LOOKUP) { assert (ds->mapbuf); - vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent); + munmap ((caddr_t) ds->mapbuf, ds->mapextent); ds->type = LOOKUP; } return 0; @@ -1006,9 +1006,8 @@ diskfs_get_directs (struct node *dp, if (allocsize > *datacnt) { if (round_page (datap - *data) < allocsize) - vm_deallocate (mach_task_self (), - (vm_address_t) (*data + round_page (datap - *data)), - allocsize - round_page (datap - *data)); + munmap ((caddr_t) (*data + round_page (datap - *data)), + allocsize - round_page (datap - *data)); } /* Set variables for return */ diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index 6a5e1fd0..0132d2e6 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -34,8 +34,7 @@ allocate_mod_map (void) if (modified_global_blocks && mod_map_size) /* Get rid of the old one. */ - vm_deallocate (mach_task_self (), - (vm_address_t)modified_global_blocks, mod_map_size); + munmap (modified_global_blocks, mod_map_size); if (!diskfs_readonly && block_size < vm_page_size) /* If the block size is too small, we have to take extra care when @@ -65,7 +64,7 @@ get_hypermetadata (void) ext2_panic ("can't read superblock: %s", strerror (err)); if (zeroblock) - vm_deallocate (mach_task_self (), zeroblock, block_size); + munmap ((caddr_t) zeroblock, block_size); sblock = (struct ext2_super_block *)boffs_ptr (SBLOCK_OFFS); diff --git a/ext2fs/pager.c b/ext2fs/pager.c index 3f557aeb..6cdb7786 100644 --- a/ext2fs/pager.c +++ b/ext2fs/pager.c @@ -117,7 +117,7 @@ free_page_buf (void *buf) else { spin_unlock (&free_page_bufs_lock); - vm_deallocate (mach_task_self (), (vm_address_t) buf, vm_page_size); + munmap (buf, vm_page_size); } } diff --git a/ext2fs/truncate.c b/ext2fs/truncate.c index 5dc59638..5c8e0829 100644 --- a/ext2fs/truncate.c +++ b/ext2fs/truncate.c @@ -1,6 +1,6 @@ /* File truncation - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.edu> @@ -205,7 +205,7 @@ poke_pages (memory_object_t obj, vm_offset_t start, vm_offset_t end) vm_address_t poke; for (poke = addr; poke < addr + len; poke += vm_page_size) *(volatile int *)poke = *(volatile int *)poke; - vm_deallocate (mach_task_self (), addr, len); + munmap ((caddr_t) addr, len); } start += len; |