summaryrefslogtreecommitdiff
path: root/fs/jbd/commit.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@zip.com.au>2002-04-29 23:53:51 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-04-29 23:53:51 -0700
commit39e8cdf731118a140eca48e69cc31ff53abe2d64 (patch)
tree7e5a91f4d8c205f63fb7f0cba6edbc87ab3fefe1 /fs/jbd/commit.c
parent411973b4db28fa3b2a97f44aa4897efe173a0b06 (diff)
[PATCH] cleanup of bh->flags
Moves all buffer_head-related stuff out of linux/fs.h and into linux/buffer_head.h. buffer_head.h is currently included at the very end of fs.h. So it is possible to include buffer_head directly from all .c files and remove this nested include. Also rationalises all the set_buffer_foo() and mark_buffer_bar() functions. We have: set_buffer_foo(bh) clear_buffer_foo(bh) buffer_foo(bh) and, in some cases, where needed: test_set_buffer_foo(bh) test_clear_buffer_foo(bh) And that's it. BUFFER_FNS() and TAS_BUFFER_FNS() macros generate all the above real inline functions. Normally not a big fan of cpp abuse, but in this case it fits. These function-generating macros are available to filesystems to expand their own b_state functions. JBD uses this in one case.
Diffstat (limited to 'fs/jbd/commit.c')
-rw-r--r--fs/jbd/commit.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index 5e41accf4663..1e8307671dc9 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -29,7 +29,10 @@ extern spinlock_t journal_datalist_lock;
static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
{
BUFFER_TRACE(bh, "");
- mark_buffer_uptodate(bh, uptodate);
+ if (uptodate)
+ set_buffer_uptodate(bh);
+ else
+ clear_buffer_uptodate(bh);
unlock_buffer(bh);
}
@@ -447,9 +450,9 @@ start_journal_io:
unlock_journal(journal);
for (i=0; i<bufs; i++) {
struct buffer_head *bh = wbuf[i];
- set_bit(BH_Lock, &bh->b_state);
- clear_bit(BH_Dirty, &bh->b_state);
- mark_buffer_uptodate(bh, 1);
+ set_buffer_locked(bh);
+ clear_buffer_dirty(bh);
+ set_buffer_uptodate(bh);
bh->b_end_io = journal_end_buffer_io_sync;
submit_bh(WRITE, bh);
}
@@ -588,7 +591,7 @@ start_journal_io:
JBUFFER_TRACE(descriptor, "write commit block");
{
struct buffer_head *bh = jh2bh(descriptor);
- mark_buffer_uptodate(bh, 1);
+ set_buffer_uptodate(bh);
ll_rw_block(WRITE, 1, &bh);
wait_on_buffer(bh);
__brelse(bh); /* One for getblk() */