aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu/ext2fs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/gnu/ext2fs')
-rw-r--r--sys/gnu/ext2fs/ext2_linux_ialloc.c6
-rw-r--r--sys/gnu/ext2fs/fs.h12
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/gnu/ext2fs/ext2_linux_ialloc.c b/sys/gnu/ext2fs/ext2_linux_ialloc.c
index 00e1a5a5e0d2..4cfb6a721dfa 100644
--- a/sys/gnu/ext2fs/ext2_linux_ialloc.c
+++ b/sys/gnu/ext2fs/ext2_linux_ialloc.c
@@ -56,11 +56,7 @@ void mark_buffer_dirty(struct buf *bh)
int s;
s = splbio();
- if (!(bh->b_flags & B_DELWRI)) {
- numdirtybuffers++;
- bh->b_flags |= B_DELWRI;
- bh->b_flags &= ~(B_READ | B_ERROR);
- }
+ bh->b_flags |= B_DIRTY;
splx(s);
}
diff --git a/sys/gnu/ext2fs/fs.h b/sys/gnu/ext2fs/fs.h
index 3cb4fc0095d1..17b5beb7fa16 100644
--- a/sys/gnu/ext2fs/fs.h
+++ b/sys/gnu/ext2fs/fs.h
@@ -168,10 +168,16 @@ extern u_char *fragtbl[];
}
#define ULCK_BUF(bp) { \
+ long flags; \
int s; \
s = splbio(); \
- (bp)->b_flags &= ~B_LOCKED; \
- splx(s); \
+ flags = (bp)->b_flags; \
+ (bp)->b_flags &= ~(B_DIRTY | B_LOCKED); \
bremfree(bp); \
- brelse(bp); \
+ (bp)->b_flags |= B_BUSY; \
+ splx(s); \
+ if (flags & B_DIRTY) \
+ bdwrite(bp); \
+ else \
+ brelse(bp); \
}