diff options
-rw-r--r-- | ext2fs/hyper.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index 5460f0e9..02db378e 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -1,7 +1,6 @@ /* Fetching and storing the hypermetadata (superblock and bg summary info) - Copyright (C) 1994,95,96,99, 1999 Free Software Foundation, Inc. - + Copyright (C) 1994,95,96,99,2001 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.org> This program is free software; you can redistribute it and/or @@ -24,13 +23,13 @@ #include <hurd/store.h> #include "ext2fs.h" -vm_address_t zeroblock = 0; -char *modified_global_blocks = 0; +vm_address_t zeroblock; +char *modified_global_blocks; static void allocate_mod_map (void) { - static vm_size_t mod_map_size = 0; + static vm_size_t mod_map_size; if (modified_global_blocks && mod_map_size) /* Get rid of the old one. */ @@ -63,9 +62,6 @@ get_hypermetadata (void) if (err) ext2_panic ("can't read superblock: %s", strerror (err)); - if (zeroblock) - munmap ((caddr_t) zeroblock, block_size); - sblock = (struct ext2_super_block *) boffs_ptr (SBLOCK_OFFS); if (sblock->s_magic != EXT2_SUPER_MAGIC @@ -163,8 +159,8 @@ get_hypermetadata (void) group_desc_image = (struct ext2_group_desc *) bptr (bptr_block (sblock) + 1); /* A handy source of page-aligned zeros. */ - zeroblock = (vm_address_t) mmap (0, block_size, PROT_READ|PROT_WRITE, - MAP_ANON, 0, 0); + if (zeroblock == 0) + zeroblock = (vm_address_t) mmap (0, block_size, PROT_READ, MAP_ANON, 0, 0); } error_t |