hc
2023-11-22 f743a7adbd6e230d66a6206fa115b59fec2d88eb
kernel/include/linux/jbd2.h
....@@ -347,32 +347,56 @@
347347
348348 static inline void jbd_lock_bh_state(struct buffer_head *bh)
349349 {
350
+#ifndef CONFIG_PREEMPT_RT_BASE
350351 bit_spin_lock(BH_State, &bh->b_state);
352
+#else
353
+ spin_lock(&bh->b_state_lock);
354
+#endif
351355 }
352356
353357 static inline int jbd_trylock_bh_state(struct buffer_head *bh)
354358 {
359
+#ifndef CONFIG_PREEMPT_RT_BASE
355360 return bit_spin_trylock(BH_State, &bh->b_state);
361
+#else
362
+ return spin_trylock(&bh->b_state_lock);
363
+#endif
356364 }
357365
358366 static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
359367 {
368
+#ifndef CONFIG_PREEMPT_RT_BASE
360369 return bit_spin_is_locked(BH_State, &bh->b_state);
370
+#else
371
+ return spin_is_locked(&bh->b_state_lock);
372
+#endif
361373 }
362374
363375 static inline void jbd_unlock_bh_state(struct buffer_head *bh)
364376 {
377
+#ifndef CONFIG_PREEMPT_RT_BASE
365378 bit_spin_unlock(BH_State, &bh->b_state);
379
+#else
380
+ spin_unlock(&bh->b_state_lock);
381
+#endif
366382 }
367383
368384 static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
369385 {
386
+#ifndef CONFIG_PREEMPT_RT_BASE
370387 bit_spin_lock(BH_JournalHead, &bh->b_state);
388
+#else
389
+ spin_lock(&bh->b_journal_head_lock);
390
+#endif
371391 }
372392
373393 static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
374394 {
395
+#ifndef CONFIG_PREEMPT_RT_BASE
375396 bit_spin_unlock(BH_JournalHead, &bh->b_state);
397
+#else
398
+ spin_unlock(&bh->b_journal_head_lock);
399
+#endif
376400 }
377401
378402 #define J_ASSERT(assert) BUG_ON(!(assert))