diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-01-15 12:27:20 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-15 12:27:20 -0500 |
commit | c0106d72b8d71696dbe9dc80e2c77d4ac63f7531 (patch) | |
tree | ca96d2baecb0555e36219ed6968dc8e306e530ca /include/linux/res_counter.h | |
parent | 5852973c129cf7c7e6c229abb7250673fc2a50c9 (diff) | |
parent | eff317d0834ad1ff03f747f6bc2d76b9a9c95160 (diff) |
Merge branch 'topic/asoc' into next/asoc
Diffstat (limited to 'include/linux/res_counter.h')
-rw-r--r-- | include/linux/res_counter.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 271c1c2c9f6f..dede0a2cfc45 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -43,6 +43,10 @@ struct res_counter { | |||
43 | * the routines below consider this to be IRQ-safe | 43 | * the routines below consider this to be IRQ-safe |
44 | */ | 44 | */ |
45 | spinlock_t lock; | 45 | spinlock_t lock; |
46 | /* | ||
47 | * Parent counter, used for hierarchial resource accounting | ||
48 | */ | ||
49 | struct res_counter *parent; | ||
46 | }; | 50 | }; |
47 | 51 | ||
48 | /** | 52 | /** |
@@ -87,7 +91,7 @@ enum { | |||
87 | * helpers for accounting | 91 | * helpers for accounting |
88 | */ | 92 | */ |
89 | 93 | ||
90 | void res_counter_init(struct res_counter *counter); | 94 | void res_counter_init(struct res_counter *counter, struct res_counter *parent); |
91 | 95 | ||
92 | /* | 96 | /* |
93 | * charge - try to consume more resource. | 97 | * charge - try to consume more resource. |
@@ -103,7 +107,7 @@ void res_counter_init(struct res_counter *counter); | |||
103 | int __must_check res_counter_charge_locked(struct res_counter *counter, | 107 | int __must_check res_counter_charge_locked(struct res_counter *counter, |
104 | unsigned long val); | 108 | unsigned long val); |
105 | int __must_check res_counter_charge(struct res_counter *counter, | 109 | int __must_check res_counter_charge(struct res_counter *counter, |
106 | unsigned long val); | 110 | unsigned long val, struct res_counter **limit_fail_at); |
107 | 111 | ||
108 | /* | 112 | /* |
109 | * uncharge - tell that some portion of the resource is released | 113 | * uncharge - tell that some portion of the resource is released |