From b20e126405a6679ed645df02f6d12d0e932a7b93 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Wed, 2 Nov 1994 21:08:19 +0000 Subject: entered into RCS --- ufs/hyper.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'ufs/hyper.c') 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) { -- cgit v1.2.3