summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-11-02 21:08:19 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-11-02 21:08:19 +0000
commitb02f368f043f7494c328ee3a44a910d81a608758 (patch)
tree92a165605460283b12218282401b089d43f433c0
parentfd8ed79a8beb486c429607b2ff008bb991ff88bc (diff)
entered into RCS
-rw-r--r--ufs/hyper.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/ufs/hyper.c b/ufs/hyper.c
index 5e9eb12f..1317e8b6 100644
--- a/ufs/hyper.c
+++ b/ufs/hyper.c
@@ -105,13 +105,24 @@ get_hypermetadata (void)
diskfs_end_catch_exception ();
}
-/* We don't need this callback; all our data is backed by pagers. */
+/* Write the csum data. This isn't backed by a pager because it is
+ taken from ordinary data blocks and might not be an even number
+ of pages; in that case writing it through the pager would nuke whatever
+ pages came after it on the disk and were backed by file pagers. */
void
diskfs_set_hypermetadata (int wait, int clean)
{
+ spin_lock (&alloclock);
+ if (csum_dirty)
+ (wait ? dev_write_sync : dev_write) (fsbtodb (sblock, sblock->fs_csaddr),
+ (vm_address_t) csum,
+ fragroundup (sblock,
+ sblock->fs_cssize));
+ csum_dirty = 0;
+ spin_unlock (&alloclock);
}
-/* Copy the sblock and csum into the disk */
+/* Copy the sblock into the disk */
void
copy_sblock ()
{
@@ -120,14 +131,6 @@ copy_sblock ()
assert (!diskfs_catch_exception ());
spin_lock (&alloclock);
- if (csum_dirty)
- {
- bcopy (csum, disk_image + fsaddr (sblock, sblock->fs_csaddr),
- fragroundup (sblock, sblock->fs_cssize));
- record_poke (disk_image + fsaddr (sblock, sblock->fs_csaddr),
- fragroundup (sblock, sblock->fs_cssize));
- csum_dirty = 0;
- }
if (clean && !diskfs_readonly)
{