summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-02-08 19:53:41 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-02-08 19:53:41 +0000
commit448d2d6d31bdabd56e29503ccf3eefddabb735c4 (patch)
tree697d5858d25bd307e8a7250987a293162353659b
parent8d8ef33f4d73720f43075d5b12d9ceecf7105d22 (diff)
Formerly hyper.c.~2~
-rw-r--r--ufs/hyper.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/ufs/hyper.c b/ufs/hyper.c
index 9f5cae8d..2793985e 100644
--- a/ufs/hyper.c
+++ b/ufs/hyper.c
@@ -40,4 +40,31 @@ get_hypermetadata (void)
assert (!err);
}
-
+/* Write the superblock and cg summary info to disk. If WAIT is set,
+ we must wait for everything to hit the disk; if CLEAN is set, then
+ mark the clean bit. */
+void
+diskfs_set_hypermetadata (int wait, int clean)
+{
+ error_t (*writefn) (daddr_t, vm_address_t, vm_size_t);
+ writefn = (wait ? dev_write_sync : dev_write);
+
+ (*writefn)(fsbtodb (sblock->fs_csaddr), (vm_address_t) csum,
+ sblock->fs_fsize * howmany (sblock->fs_cssize,
+ sblock->fs_fssize));
+
+ if (clean)
+ sblock->fs_clean = 1;
+ if (sblock->fs_postblformat == FS_42POSTBLFMT)
+ {
+ char sblockcopy[SBSIZE];
+ bcopy (sblock, sblockcopy, SBSIZE);
+ ((struct fs *)sblockcopy)->fs_nrpos = -1;
+ (*writefn) (SBLOCK, (vm_address_t) sblockcopy, SBSIZE);
+ }
+ else
+ (*writefn) (SBLOCK, (vm_address_t) sblock, SBSIZE);
+ sblock->fs_clean = 0;
+}
+
+