Whamcloud - gitweb
- few more defines for liblustre to get updated ldlm buildable at least
authoralex <alex>
Tue, 20 Jun 2006 17:35:58 +0000 (17:35 +0000)
committeralex <alex>
Tue, 20 Jun 2006 17:35:58 +0000 (17:35 +0000)
lustre/include/liblustre.h
lustre/include/lustre_dlm.h

index 19fad73..893abc8 100644 (file)
@@ -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)
index eff1ecd..6bc4c3d 100644 (file)
@@ -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);