aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPaul Menage <menage@google.com>2008-04-29 03:59:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:08 -0400
commit2c7eabf37647dd459d555e76954b4de87be2321f (patch)
tree553a080db29ad1d9724e6c7da30f64f5fe7cc12a /kernel
parentf4c753b7eacc277e506066abdda351cbc1cf8e6a (diff)
CGroup API files: add res_counter_read_u64()
Adds a function for returning the value of a resource counter member, in a form suitable for use in a cgroup read_u64 control file method. Signed-off-by: Paul Menage <menage@google.com> Cc: "Li Zefan" <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Paul Jackson <pj@sgi.com> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: "YAMAMOTO Takashi" <yamamoto@valinux.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/res_counter.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/res_counter.c b/kernel/res_counter.c
index a508c2769463..70587657dda3 100644
--- a/kernel/res_counter.c
+++ b/kernel/res_counter.c
@@ -93,6 +93,11 @@ ssize_t res_counter_read(struct res_counter *counter, int member,
93 pos, buf, s - buf); 93 pos, buf, s - buf);
94} 94}
95 95
96u64 res_counter_read_u64(struct res_counter *counter, int member)
97{
98 return *res_counter_member(counter, member);
99}
100
96ssize_t res_counter_write(struct res_counter *counter, int member, 101ssize_t res_counter_write(struct res_counter *counter, int member,
97 const char __user *userbuf, size_t nbytes, loff_t *pos, 102 const char __user *userbuf, size_t nbytes, loff_t *pos,
98 int (*write_strategy)(char *st_buf, unsigned long long *val)) 103 int (*write_strategy)(char *st_buf, unsigned long long *val))