blob: b1f708976ffd58ac3e780d30974c76fc60dcd3be [file] [log] [blame]
Thomas Gleixner44606672011-10-27 04:38:18 -04001#ifndef _LINUX_JBD_STATE_H
2#define _LINUX_JBD_STATE_H
3
Thomas Gleixner44606672011-10-27 04:38:18 -04004static inline struct buffer_head *jh2bh(struct journal_head *jh)
5{
6 return jh->b_bh;
7}
8
9static inline struct journal_head *bh2jh(struct buffer_head *bh)
10{
11 return bh->b_private;
12}
13
14static inline void jbd_lock_bh_state(struct buffer_head *bh)
15{
16 bit_spin_lock(BH_State, &bh->b_state);
17}
18
19static inline int jbd_trylock_bh_state(struct buffer_head *bh)
20{
21 return bit_spin_trylock(BH_State, &bh->b_state);
22}
23
24static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
25{
26 return bit_spin_is_locked(BH_State, &bh->b_state);
27}
28
29static inline void jbd_unlock_bh_state(struct buffer_head *bh)
30{
31 bit_spin_unlock(BH_State, &bh->b_state);
32}
33
34static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
35{
36 bit_spin_lock(BH_JournalHead, &bh->b_state);
37}
38
39static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
40{
41 bit_spin_unlock(BH_JournalHead, &bh->b_state);
42}
43
44#endif