diff options
author | dyson <dyson@FreeBSD.org> | 1997-08-04 05:10:31 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1997-08-04 05:10:31 +0000 |
commit | ec0474c458fa4162bdea016821c68694840ce909 (patch) | |
tree | 460f71c900f27e7ad0d39327671ffc14c15b95cf /sys/gnu/fs/ext2fs/fs.h | |
parent | 17f776e5506226b7d23df2e9e363af9203813a2c (diff) | |
download | FreeBSD-src-ec0474c458fa4162bdea016821c68694840ce909.zip FreeBSD-src-ec0474c458fa4162bdea016821c68694840ce909.tar.gz |
Fix a problem with ext2fs so that filesystems mounted at reboot don't
keep ahold of buffers, and therefore leave filesystems dirty. I haven't
been able to test, but the code compiles. Those who run -current, please
test and report back!!! (Sorry :-)).
PR: kern/3571
Submitted by: Dirk Keunecke <dk@panda.rhein-main.de>
Diffstat (limited to 'sys/gnu/fs/ext2fs/fs.h')
-rw-r--r-- | sys/gnu/fs/ext2fs/fs.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/gnu/fs/ext2fs/fs.h b/sys/gnu/fs/ext2fs/fs.h index 03f137c..3cb4fc0 100644 --- a/sys/gnu/fs/ext2fs/fs.h +++ b/sys/gnu/fs/ext2fs/fs.h @@ -155,3 +155,23 @@ extern u_char *fragtbl[]; #define lock_super(devvp) vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, curproc) #define unlock_super(devvp) VOP_UNLOCK(devvp, 0, curproc) +/* + * To lock a buffer, set the B_LOCKED flag and then brelse() it. To unlock, + * reset the B_LOCKED flag and brelse() the buffer back on the LRU list + */ +#define LCK_BUF(bp) { \ + int s; \ + s = splbio(); \ + (bp)->b_flags |= B_LOCKED; \ + splx(s); \ + brelse(bp); \ +} + +#define ULCK_BUF(bp) { \ + int s; \ + s = splbio(); \ + (bp)->b_flags &= ~B_LOCKED; \ + splx(s); \ + bremfree(bp); \ + brelse(bp); \ +} |