summaryrefslogtreecommitdiff
path: root/ext2fs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-06-25 21:29:07 +0000
committerMiles Bader <miles@gnu.org>1996-06-25 21:29:07 +0000
commita59257d79726138c9584c5a684eff9fb5fdd3953 (patch)
tree1d7e5c39f9de27bf1aed2a897c3d7cbf5a0989c8 /ext2fs
parentc7d3781456ba9da865406ad02900012eb8b71e54 (diff)
(diskfs_readonly_changed): No longer clear the clean bit.
(diskfs_set_hypermetadata): Work correctly.
Diffstat (limited to 'ext2fs')
-rw-r--r--ext2fs/hyper.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c
index 28443420..f46d0fcb 100644
--- a/ext2fs/hyper.c
+++ b/ext2fs/hyper.c
@@ -148,19 +148,26 @@ void
diskfs_set_hypermetadata (int wait, int clean)
{
if (clean && ext2fs_clean && !(sblock->s_state & EXT2_VALID_FS))
- /* The filesystem is clean, so we need to set the clean flag. We
- just write the superblock directly, without using the paged copy. */
+ /* The filesystem is clean, so we need to set the clean flag. */
{
- vm_address_t page_buf = get_page_buf ();
- sblock_dirty = 0; /* doesn't matter if this gets stomped */
- bcopy (sblock, (void *)page_buf, SBLOCK_SIZE);
- ((struct ext2_super_block *)page_buf)->s_state |= EXT2_VALID_FS;
- diskfs_device_write_sync (SBLOCK_OFFS >> diskfs_log2_device_block_size,
- page_buf, block_size);
- free_page_buf (page_buf);
+ sblock->s_state |= EXT2_VALID_FS;
+ sblock_dirty = 1;
}
- else if (sblock_dirty)
- sync_super_block ();
+ else if (!clean && (sblock->s_state & EXT2_VALID_FS))
+ /* The filesystem just became dirty, so clear the clean flag. */
+ {
+ sblock->s_state &= ~EXT2_VALID_FS;
+ sblock_dirty = 1;
+ wait = 1;
+ }
+
+ if (sblock_dirty)
+ {
+ sblock_dirty = 0;
+ record_global_poke (sblock);
+ }
+
+ sync_global (wait);
}
void
@@ -173,15 +180,6 @@ diskfs_readonly_changed (int readonly)
diskfs_device_size << diskfs_log2_device_block_size,
0, VM_PROT_READ | (readonly ? 0 : VM_PROT_WRITE));
- if (! readonly)
- {
- if (sblock->s_state & EXT2_VALID_FS)
- {
- /* Going writable; clear the clean bit. */
- sblock->s_state &= ~EXT2_VALID_FS;
- sync_super_block ();
- }
- else
- ext2_warning ("UNCLEANED FILESYSTEM NOW WRITABLE");
- }
+ if (!readonly && !(sblock->s_state & EXT2_VALID_FS))
+ ext2_warning ("UNCLEANED FILESYSTEM NOW WRITABLE");
}