]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/res_counter.h
Merge branch 'linus' into core/iommu
[karo-tx-linux.git] / include / linux / res_counter.h
index 271c1c2c9f6f741016f0917c360469ae5ee872a5..dede0a2cfc45980a067e916ea1fabfeee273c7fb 100644 (file)
@@ -43,6 +43,10 @@ struct res_counter {
         * the routines below consider this to be IRQ-safe
         */
        spinlock_t lock;
+       /*
+        * Parent counter, used for hierarchial resource accounting
+        */
+       struct res_counter *parent;
 };
 
 /**
@@ -87,7 +91,7 @@ enum {
  * helpers for accounting
  */
 
-void res_counter_init(struct res_counter *counter);
+void res_counter_init(struct res_counter *counter, struct res_counter *parent);
 
 /*
  * charge - try to consume more resource.
@@ -103,7 +107,7 @@ void res_counter_init(struct res_counter *counter);
 int __must_check res_counter_charge_locked(struct res_counter *counter,
                unsigned long val);
 int __must_check res_counter_charge(struct res_counter *counter,
-               unsigned long val);
+               unsigned long val, struct res_counter **limit_fail_at);
 
 /*
  * uncharge - tell that some portion of the resource is released