summaryrefslogtreecommitdiff
path: root/ufs/hyper.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-02-08 19:48:55 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-02-08 19:48:55 +0000
commit8d8ef33f4d73720f43075d5b12d9ceecf7105d22 (patch)
treefac512ef66767f7d63b0850aa972cde040721c52 /ufs/hyper.c
parentebe1180e3bbbfc8ea04712daf2f2f189882fa6d1 (diff)
Initial revision
Diffstat (limited to 'ufs/hyper.c')
-rw-r--r--ufs/hyper.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/ufs/hyper.c b/ufs/hyper.c
new file mode 100644
index 00000000..9f5cae8d
--- /dev/null
+++ b/ufs/hyper.c
@@ -0,0 +1,43 @@
+/* Fetching and storing the hypermetadata (superblock and cg summary info).
+ Copyright (C) 1994 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
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
+void
+get_hypermetadata (void)
+{
+ error_t err;
+
+ err = dev_read_sync (SBLOCK, (vm_address_t *)&sblock, SBSIZE);
+ assert (!err);
+
+ /* If this is an old filesystem, then we have some more
+ work to do; some crucial constants might not be set; we
+ are therefore forced to set them here. */
+ if (sblock->fs_npsect < sblock->fs_nsect)
+ sblock->fs_npsect = sblock->fs_nsect;
+ if (sblock->fs_interleave < 1)
+ sblock->fs_interleave = 1;
+ if (sblock->fs_postblformat == FS_42POSTBLFMT)
+ sblock->fs_nrpos = 8;
+
+ err = dev_read_sync (fsbtodb (sblock->fs_csaddr), (vm_address_t *) &csum,
+ sblock->fs_fsize * howmany (sblock->fs_cssize,
+ sblock->fs_fsize));
+ assert (!err);
+}
+
+