diff options
author | Paul Menage <menage@google.com> | 2008-04-29 03:59:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:08 -0400 |
commit | 2c3daa722b624eaf0c5ea60e4f180bd0684542e2 (patch) | |
tree | afdb7e2068b018569dda8415b184b6de2ab330a6 /mm/memcontrol.c | |
parent | 2c7eabf37647dd459d555e76954b4de87be2321f (diff) |
CGroup API files: use read_u64 in memory controller
Update the memory controller to use read_u64 for its limit/usage/failcnt
control files, calling the new res_counter_read_u64() function.
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 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2e0bfc93484..e227d7c5989 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -853,13 +853,10 @@ static int mem_cgroup_write_strategy(char *buf, unsigned long long *tmp) | |||
853 | return 0; | 853 | return 0; |
854 | } | 854 | } |
855 | 855 | ||
856 | static ssize_t mem_cgroup_read(struct cgroup *cont, | 856 | static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft) |
857 | struct cftype *cft, struct file *file, | ||
858 | char __user *userbuf, size_t nbytes, loff_t *ppos) | ||
859 | { | 857 | { |
860 | return res_counter_read(&mem_cgroup_from_cont(cont)->res, | 858 | return res_counter_read_u64(&mem_cgroup_from_cont(cont)->res, |
861 | cft->private, userbuf, nbytes, ppos, | 859 | cft->private); |
862 | NULL); | ||
863 | } | 860 | } |
864 | 861 | ||
865 | static ssize_t mem_cgroup_write(struct cgroup *cont, struct cftype *cft, | 862 | static ssize_t mem_cgroup_write(struct cgroup *cont, struct cftype *cft, |
@@ -950,18 +947,18 @@ static struct cftype mem_cgroup_files[] = { | |||
950 | { | 947 | { |
951 | .name = "usage_in_bytes", | 948 | .name = "usage_in_bytes", |
952 | .private = RES_USAGE, | 949 | .private = RES_USAGE, |
953 | .read = mem_cgroup_read, | 950 | .read_u64 = mem_cgroup_read, |
954 | }, | 951 | }, |
955 | { | 952 | { |
956 | .name = "limit_in_bytes", | 953 | .name = "limit_in_bytes", |
957 | .private = RES_LIMIT, | 954 | .private = RES_LIMIT, |
958 | .write = mem_cgroup_write, | 955 | .write = mem_cgroup_write, |
959 | .read = mem_cgroup_read, | 956 | .read_u64 = mem_cgroup_read, |
960 | }, | 957 | }, |
961 | { | 958 | { |
962 | .name = "failcnt", | 959 | .name = "failcnt", |
963 | .private = RES_FAILCNT, | 960 | .private = RES_FAILCNT, |
964 | .read = mem_cgroup_read, | 961 | .read_u64 = mem_cgroup_read, |
965 | }, | 962 | }, |
966 | { | 963 | { |
967 | .name = "force_empty", | 964 | .name = "force_empty", |