| .. | .. |
|---|
| 347 | 347 | |
|---|
| 348 | 348 | static inline void jbd_lock_bh_state(struct buffer_head *bh) |
|---|
| 349 | 349 | { |
|---|
| 350 | +#ifndef CONFIG_PREEMPT_RT_BASE |
|---|
| 350 | 351 | bit_spin_lock(BH_State, &bh->b_state); |
|---|
| 352 | +#else |
|---|
| 353 | + spin_lock(&bh->b_state_lock); |
|---|
| 354 | +#endif |
|---|
| 351 | 355 | } |
|---|
| 352 | 356 | |
|---|
| 353 | 357 | static inline int jbd_trylock_bh_state(struct buffer_head *bh) |
|---|
| 354 | 358 | { |
|---|
| 359 | +#ifndef CONFIG_PREEMPT_RT_BASE |
|---|
| 355 | 360 | return bit_spin_trylock(BH_State, &bh->b_state); |
|---|
| 361 | +#else |
|---|
| 362 | + return spin_trylock(&bh->b_state_lock); |
|---|
| 363 | +#endif |
|---|
| 356 | 364 | } |
|---|
| 357 | 365 | |
|---|
| 358 | 366 | static inline int jbd_is_locked_bh_state(struct buffer_head *bh) |
|---|
| 359 | 367 | { |
|---|
| 368 | +#ifndef CONFIG_PREEMPT_RT_BASE |
|---|
| 360 | 369 | return bit_spin_is_locked(BH_State, &bh->b_state); |
|---|
| 370 | +#else |
|---|
| 371 | + return spin_is_locked(&bh->b_state_lock); |
|---|
| 372 | +#endif |
|---|
| 361 | 373 | } |
|---|
| 362 | 374 | |
|---|
| 363 | 375 | static inline void jbd_unlock_bh_state(struct buffer_head *bh) |
|---|
| 364 | 376 | { |
|---|
| 377 | +#ifndef CONFIG_PREEMPT_RT_BASE |
|---|
| 365 | 378 | bit_spin_unlock(BH_State, &bh->b_state); |
|---|
| 379 | +#else |
|---|
| 380 | + spin_unlock(&bh->b_state_lock); |
|---|
| 381 | +#endif |
|---|
| 366 | 382 | } |
|---|
| 367 | 383 | |
|---|
| 368 | 384 | static inline void jbd_lock_bh_journal_head(struct buffer_head *bh) |
|---|
| 369 | 385 | { |
|---|
| 386 | +#ifndef CONFIG_PREEMPT_RT_BASE |
|---|
| 370 | 387 | bit_spin_lock(BH_JournalHead, &bh->b_state); |
|---|
| 388 | +#else |
|---|
| 389 | + spin_lock(&bh->b_journal_head_lock); |
|---|
| 390 | +#endif |
|---|
| 371 | 391 | } |
|---|
| 372 | 392 | |
|---|
| 373 | 393 | static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh) |
|---|
| 374 | 394 | { |
|---|
| 395 | +#ifndef CONFIG_PREEMPT_RT_BASE |
|---|
| 375 | 396 | bit_spin_unlock(BH_JournalHead, &bh->b_state); |
|---|
| 397 | +#else |
|---|
| 398 | + spin_unlock(&bh->b_journal_head_lock); |
|---|
| 399 | +#endif |
|---|
| 376 | 400 | } |
|---|
| 377 | 401 | |
|---|
| 378 | 402 | #define J_ASSERT(assert) BUG_ON(!(assert)) |
|---|