Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux
[linux-2.6.git] / include / linux / jbd_common.h
blob3dc53432355f5edce8a2793a0f639e8f58480c3e
1 #ifndef _LINUX_JBD_STATE_H
2 #define _LINUX_JBD_STATE_H
4 #include <linux/bit_spinlock.h>
6 static inline struct buffer_head *jh2bh(struct journal_head *jh)
8 return jh->b_bh;
11 static inline struct journal_head *bh2jh(struct buffer_head *bh)
13 return bh->b_private;
16 static inline void jbd_lock_bh_state(struct buffer_head *bh)
18 bit_spin_lock(BH_State, &bh->b_state);
21 static inline int jbd_trylock_bh_state(struct buffer_head *bh)
23 return bit_spin_trylock(BH_State, &bh->b_state);
26 static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
28 return bit_spin_is_locked(BH_State, &bh->b_state);
31 static inline void jbd_unlock_bh_state(struct buffer_head *bh)
33 bit_spin_unlock(BH_State, &bh->b_state);
36 static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
38 bit_spin_lock(BH_JournalHead, &bh->b_state);
41 static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
43 bit_spin_unlock(BH_JournalHead, &bh->b_state);
46 #endif