X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_iam.h;h=e8e868aa8aebe71b516f95dddaa57737efbff59e;hb=279e4dd34e18de0f8ecda61b65d6e0f56f7c9fc8;hp=78a1ce52b206cd9d6cb7ca209d0f8f37af7fb764;hpb=c2c28f2aa5d65d889bf5d1a707fec82e8f852c86;p=fs%2Flustre-release.git diff --git a/lustre/osd-ldiskfs/osd_iam.h b/lustre/osd-ldiskfs/osd_iam.h index 78a1ce5..e8e868a 100644 --- a/lustre/osd-ldiskfs/osd_iam.h +++ b/lustre/osd-ldiskfs/osd_iam.h @@ -27,7 +27,7 @@ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -92,7 +92,6 @@ enum { DX_FMT_NAME_LEN = 16, }; -#ifdef __KERNEL__ /* * Debugging. @@ -1021,7 +1020,7 @@ int iam_lvar_create(struct inode *obj, #define dxtrace(command) #endif -#define BH_DXLock 25 +#define BH_DXLock (BH_BITMAP_UPTODATE + 1) #define DX_DEBUG (0) #if DX_DEBUG static struct iam_lock_stats { @@ -1039,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(); @@ -1050,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 } @@ -1131,7 +1129,6 @@ static inline int ldiskfs_check_dir_entry(const char * function, */ /* __KERNEL__ */ -#endif /* * User level API. Copy exists in lustre/lustre/tests/iam_ut.c