From 39e8cdf731118a140eca48e69cc31ff53abe2d64 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 29 Apr 2002 23:53:51 -0700 Subject: [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. --- include/linux/jbd.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'include/linux/jbd.h') diff --git a/include/linux/jbd.h b/include/linux/jbd.h index f54ab638bcc1..2752f3a7375d 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -233,11 +233,8 @@ enum jbd_state_bits { BH_JBDDirty, /* 1 if buffer is dirty but journaled */ }; -/* Return true if the buffer is one which JBD is managing */ -static inline int buffer_jbd(struct buffer_head *bh) -{ - return __buffer_state(bh, JBD); -} +BUFFER_FNS(JBD, jbd) +BUFFER_FNS(JBDDirty, jbddirty) static inline struct buffer_head *jh2bh(struct journal_head *jh) { @@ -838,7 +835,7 @@ static inline int buffer_jlist_eq(struct buffer_head *bh, int list) /* Return true if this bufer is dirty wrt the journal */ static inline int buffer_jdirty(struct buffer_head *bh) { - return buffer_jbd(bh) && __buffer_state(bh, JBDDirty); + return buffer_jbd(bh) && buffer_jbddirty(bh); } /* Return true if it's a data buffer which journalling is managing */ -- cgit v1.2.3