Whamcloud - gitweb
LU-7311 osd: smp_mb__before_clear_bit deprecated since kernel 3.16 91/16891/11
authorfrank zago <fzago@cray.com>
Mon, 1 Aug 2016 16:05:55 +0000 (12:05 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 11 Aug 2016 05:50:02 +0000 (05:50 +0000)
smp_mb__before_clear_bit() was deprecated in kernel 3.16 and removed
in kernel 3.18, and was replaced by smp_mb__before_atomic(). To fix,
use clear_bit_unlock which does the old smp_mb__before_clear_bit +
clear_bit.

Signed-off-by: frank zago <fzago@cray.com>
Change-Id: I970807ee4c1d91ddda4011ffb22bbe8af0a7764b
Reviewed-on: http://review.whamcloud.com/16891
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_iam.h

index 40c528b..e8e868a 100644 (file)
@@ -1038,7 +1038,7 @@ static inline void iam_lock_bh(struct buffer_head volatile *bh)
 {
         DX_DEVAL(iam_lock_stats.dls_bh_lock++);
 #ifdef CONFIG_SMP
-       while (test_and_set_bit(BH_DXLock, &bh->b_state)) {
+       while (test_and_set_bit_lock(BH_DXLock, &bh->b_state)) {
                DX_DEVAL(iam_lock_stats.dls_bh_busy++);
                while (test_bit(BH_DXLock, &bh->b_state))
                         cpu_relax();
@@ -1049,8 +1049,7 @@ static inline void iam_lock_bh(struct buffer_head volatile *bh)
 static inline void iam_unlock_bh(struct buffer_head *bh)
 {
 #ifdef CONFIG_SMP
-        smp_mb__before_clear_bit();
-        clear_bit(BH_DXLock, &bh->b_state);
+       clear_bit_unlock(BH_DXLock, &bh->b_state);
 #endif
 }