{
sema_init(sem, 1);
}
+static inline void init_MUTEX_LOCKED (struct semaphore *sem)
+{
+ sema_init(sem, 0);
+}
#define init_mutex(s) init_MUTEX(s)
#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)
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);