summaryrefslogtreecommitdiff
path: root/ufs/hyper.c
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
commitb20e126405a6679ed645df02f6d12d0e932a7b93 (patch)
treec7ca8272a1eb35a6e55ee5b72333d1caa79f7156 /ufs/hyper.c
parent95ad36aca16849157dc8281f096e4c539b511a96 (diff)
entered into RCS
Diffstat (limited to 'ufs/hyper.c')
-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)
{