summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-23 09:29:11 +0200
committerThomas Gleixner <tglx@linutronix.de>2009-08-23 09:29:11 +0200
commit216e80982324cc1290350013ada9a7ea0aca501e (patch)
treee8df87d79b54634120d16be610b7e7c6c4b4fff2 /include
parent6f8efee4bc3be099cea2e71eb101e2ebdf26ff28 (diff)
downloadlwn-216e80982324cc1290350013ada9a7ea0aca501e.tar.gz
lwn-216e80982324cc1290350013ada9a7ea0aca501e.zip
fs: jbd2: Replace bit spinlocks
Bit spinlocks are not really RT friendly and in general I don't like them as they escape the lockdep debugging. Make it use the bh locks as we already did for jdb. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/jbd2.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index d97eb652d6ca..406d3b5160be 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -319,6 +319,15 @@ void buffer_assertion_failure(struct buffer_head *bh);
#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why)
#endif
+/*
+ * For assertions that are only valid on SMP (e.g. spin_is_locked()):
+ */
+#ifdef CONFIG_SMP
+# define J_ASSERT_JH_SMP(jh, expr) J_ASSERT_JH(jh, expr)
+#else
+# define J_ASSERT_JH_SMP(jh, assert) do { } while (0)
+#endif
+
enum jbd_state_bits {
BH_JBD /* Has an attached ext3 journal_head */
= BH_PrivateStart,
@@ -355,32 +364,32 @@ static inline struct journal_head *bh2jh(struct buffer_head *bh)
static inline void jbd_lock_bh_state(struct buffer_head *bh)
{
- bit_spin_lock(BH_State, &bh->b_state);
+ spin_lock(&bh->b_state_lock);
}
static inline int jbd_trylock_bh_state(struct buffer_head *bh)
{
- return bit_spin_trylock(BH_State, &bh->b_state);
+ return spin_trylock(&bh->b_state_lock);
}
static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
{
- return bit_spin_is_locked(BH_State, &bh->b_state);
+ return spin_is_locked(&bh->b_state_lock);
}
static inline void jbd_unlock_bh_state(struct buffer_head *bh)
{
- bit_spin_unlock(BH_State, &bh->b_state);
+ spin_unlock(&bh->b_state_lock);
}
static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
{
- bit_spin_lock(BH_JournalHead, &bh->b_state);
+ spin_lock(&bh->b_uptodate_lock);
}
static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
{
- bit_spin_unlock(BH_JournalHead, &bh->b_state);
+ spin_unlock(&bh->b_uptodate_lock);
}
/* Flags in jbd_inode->i_flags */