summaryrefslogtreecommitdiff
path: root/ext2fs/balloc.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-05-09 15:33:07 +0000
committerMiles Bader <miles@gnu.org>1995-05-09 15:33:07 +0000
commit1a50942b73015e6ac4e268ba46f28e42a9f6e08f (patch)
treecf2bec0b76e90839fb95372e9fd56d73ded009d8 /ext2fs/balloc.c
parent587d16ae6b68f150798a1061f40d4dc360a4e9db (diff)
Formerly balloc.c.~20~
Diffstat (limited to 'ext2fs/balloc.c')
-rw-r--r--ext2fs/balloc.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/ext2fs/balloc.c b/ext2fs/balloc.c
index c430c7b2..0673cb93 100644
--- a/ext2fs/balloc.c
+++ b/ext2fs/balloc.c
@@ -289,6 +289,16 @@ got_block:
goto repeat;
}
+ /* Since due to bletcherousness block-modified bits are never turned off
+ when writing disk-pager pages, make sure they are here, in case this
+ block is being allocated to a file (see pager.c). */
+ if (modified_global_blocks)
+ {
+ spin_lock (&modified_global_blocks_lock);
+ clear_bit (tmp, modified_global_blocks);
+ spin_unlock (&modified_global_blocks_lock);
+ }
+
ext2_debug ("found bit %d", j);
/*
@@ -305,11 +315,18 @@ got_block:
if (set_bit (j + k, bh))
break;
(*prealloc_count)++;
+
+ /* (See comment before the clear_bit above) */
+ if (modified_global_blocks)
+ {
+ spin_lock (&modified_global_blocks_lock);
+ clear_bit (tmp + k, modified_global_blocks);
+ spin_unlock (&modified_global_blocks_lock);
+ }
}
gdp->bg_free_blocks_count -= *prealloc_count;
sblock->s_free_blocks_count -= *prealloc_count;
- ext2_debug ("Preallocated a further %lu bits",
- *prealloc_count);
+ ext2_debug ("Preallocated a further %lu bits", *prealloc_count);
}
#endif