From: alex Date: Tue, 20 Jun 2006 17:35:58 +0000 (+0000) Subject: - few more defines for liblustre to get updated ldlm buildable at least X-Git-Tag: v1_7_100~1^90~8^2~90 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=4879ffb81a5738398cb149d68c90e60eeebf2b42;p=fs%2Flustre-release.git - few more defines for liblustre to get updated ldlm buildable at least --- diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 19fad73..893abc8 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -560,6 +560,10 @@ static inline void init_MUTEX (struct semaphore *sem) { sema_init(sem, 1); } +static inline void init_MUTEX_LOCKED (struct semaphore *sem) +{ + sema_init(sem, 0); +} #define init_mutex(s) init_MUTEX(s) @@ -704,6 +708,7 @@ typedef struct { volatile int counter; } atomic_t; #define atomic_read(a) ((a)->counter) #define atomic_set(a,b) do {(a)->counter = b; } while (0) #define atomic_dec_and_test(a) ((--((a)->counter)) == 0) +#define atomic_dec_and_lock(a,b) ((--((a)->counter)) == 0) #define atomic_inc(a) (((a)->counter)++) #define atomic_dec(a) do { (a)->counter--; } while (0) #define atomic_add(b,a) do {(a)->counter += b;} while (0) diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index eff1ecd..6bc4c3d 100644 --- a/lustre/include/lustre_dlm.h +++ b/lustre/include/lustre_dlm.h @@ -690,6 +690,16 @@ static inline void unlock_bitlock(struct ldlm_lock *lock) lock->l_pidb = 0; bit_spin_unlock(LDLM_FL_LOCK_PROTECT_BIT, (void *) &lock->l_flags); } +#else +static inline void lock_bitlock(struct ldlm_lock *lock) +{ + lock->l_flags |= 1 << LDLM_FL_LOCK_PROTECT_BIT; +} + +static inline void unlock_bitlock(struct ldlm_lock *lock) +{ + lock->l_flags &= ~(1 << LDLM_FL_LOCK_PROTECT_BIT); +} #endif struct ldlm_resource * lock_res_and_lock(struct ldlm_lock *lock); void unlock_res_and_lock(struct ldlm_lock *lock);