Whamcloud - gitweb
Land b1_6_bug11013 onto HEAD (20070313_0924)
[fs/lustre-release.git] / lustre / include / liblustre.h
index e801dc6..40c042e 100644 (file)
@@ -709,6 +709,8 @@ typedef struct { volatile int counter; } atomic_t;
 #define atomic_dec(a)  do { (a)->counter--; } while (0)
 #define atomic_add(b,a)  do {(a)->counter += b;} while (0)
 #define atomic_sub(b,a)  do {(a)->counter -= b;} while (0)
+#define atomic_sub_return(n,a) ((a)->counter -= n)
+#define atomic_dec_return(a)  atomic_sub_return(1,a)
 
 #ifndef likely
 #define likely(exp) (exp)