Commit 28303e27 authored by Ingo Molnar's avatar Ingo Molnar Committed by Thomas Gleixner

fs: Make jbd assertions smp only

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent c0dd527e
...@@ -1576,7 +1576,7 @@ static void __journal_temp_unlink_buffer(struct journal_head *jh) ...@@ -1576,7 +1576,7 @@ static void __journal_temp_unlink_buffer(struct journal_head *jh)
transaction_t *transaction; transaction_t *transaction;
struct buffer_head *bh = jh2bh(jh); struct buffer_head *bh = jh2bh(jh);
J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); J_ASSERT_JH_SMP(jh, jbd_is_locked_bh_state(bh));
transaction = jh->b_transaction; transaction = jh->b_transaction;
if (transaction) if (transaction)
assert_spin_locked(&transaction->t_journal->j_list_lock); assert_spin_locked(&transaction->t_journal->j_list_lock);
...@@ -2028,7 +2028,7 @@ void __journal_file_buffer(struct journal_head *jh, ...@@ -2028,7 +2028,7 @@ void __journal_file_buffer(struct journal_head *jh,
int was_dirty = 0; int was_dirty = 0;
struct buffer_head *bh = jh2bh(jh); struct buffer_head *bh = jh2bh(jh);
J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); J_ASSERT_JH_SMP(jh, jbd_is_locked_bh_state(bh));
assert_spin_locked(&transaction->t_journal->j_list_lock); assert_spin_locked(&transaction->t_journal->j_list_lock);
J_ASSERT_JH(jh, jh->b_jlist < BJ_Types); J_ASSERT_JH(jh, jh->b_jlist < BJ_Types);
...@@ -2122,7 +2122,7 @@ void __journal_refile_buffer(struct journal_head *jh) ...@@ -2122,7 +2122,7 @@ void __journal_refile_buffer(struct journal_head *jh)
int was_dirty; int was_dirty;
struct buffer_head *bh = jh2bh(jh); struct buffer_head *bh = jh2bh(jh);
J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); J_ASSERT_JH_SMP(jh, jbd_is_locked_bh_state(bh));
if (jh->b_transaction) if (jh->b_transaction)
assert_spin_locked(&jh->b_transaction->t_journal->j_list_lock); assert_spin_locked(&jh->b_transaction->t_journal->j_list_lock);
......
...@@ -260,6 +260,15 @@ void buffer_assertion_failure(struct buffer_head *bh); ...@@ -260,6 +260,15 @@ void buffer_assertion_failure(struct buffer_head *bh);
#define J_ASSERT_JH(jh, expr) J_ASSERT(expr) #define J_ASSERT_JH(jh, expr) J_ASSERT(expr)
#endif #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
#if defined(JBD_PARANOID_IOFAIL) #if defined(JBD_PARANOID_IOFAIL)
#define J_EXPECT(expr, why...) J_ASSERT(expr) #define J_EXPECT(expr, why...) J_ASSERT(expr)
#define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr) #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment