From 9a23f2b8f6782f4d7612b1d2e1437463b8d8752e Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 22 Apr 1995 02:11:36 +0000 Subject: Formerly pager.c.~19~ --- ext2fs/pager.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ext2fs') diff --git a/ext2fs/pager.c b/ext2fs/pager.c index c7e4204d..dea06fa7 100644 --- a/ext2fs/pager.c +++ b/ext2fs/pager.c @@ -2,6 +2,8 @@ Copyright (C) 1994, 1995 Free Software Foundation, Inc. + Converted for ext2fs by Miles Bader + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at @@ -317,13 +319,20 @@ disk_pager_write_page (vm_offset_t page, vm_address_t buf) while (length > 0 && !err) { + int modified; daddr_t block = boffs_block (offs); - if (clear_bit (block, modified_global_blocks)) + + spin_lock (&modified_global_blocks_lock); + modified = clear_bit (block, modified_global_blocks); + spin_unlock (&modified_global_blocks_lock); + + if (modified) /* This block's been modified, so write it out. */ err = pending_blocks_add (&pb, block); else /* Otherwise just skip it. */ err = pending_blocks_skip (&pb); + offs += block_size; } -- cgit v1.2.3