Merge branch 'pm-domains' into for-linus
[linux-2.6.git] / kernel / res_counter.c
index bcdabf3..34683ef 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/types.h>
 #include <linux/parser.h>
 #include <linux/fs.h>
-#include <linux/slab.h>
 #include <linux/res_counter.h>
 #include <linux/uaccess.h>
 #include <linux/mm.h>
@@ -127,10 +126,24 @@ ssize_t res_counter_read(struct res_counter *counter, int member,
                        pos, buf, s - buf);
 }
 
+#if BITS_PER_LONG == 32
+u64 res_counter_read_u64(struct res_counter *counter, int member)
+{
+       unsigned long flags;
+       u64 ret;
+
+       spin_lock_irqsave(&counter->lock, flags);
+       ret = *res_counter_member(counter, member);
+       spin_unlock_irqrestore(&counter->lock, flags);
+
+       return ret;
+}
+#else
 u64 res_counter_read_u64(struct res_counter *counter, int member)
 {
        return *res_counter_member(counter, member);
 }
+#endif
 
 int res_counter_memparse_write_strategy(const char *buf,
                                        unsigned long long *res)