Commit 2c3daa722b624eaf0c5ea60e4f180bd0684542e2
Committed by
Linus Torvalds
1 parent
2c7eabf376
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 6 additions and 9 deletions Side-by-side Diff
mm/memcontrol.c
... | ... | @@ -853,13 +853,10 @@ |
853 | 853 | return 0; |
854 | 854 | } |
855 | 855 | |
856 | -static ssize_t mem_cgroup_read(struct cgroup *cont, | |
857 | - struct cftype *cft, struct file *file, | |
858 | - char __user *userbuf, size_t nbytes, loff_t *ppos) | |
856 | +static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft) | |
859 | 857 | { |
860 | - return res_counter_read(&mem_cgroup_from_cont(cont)->res, | |
861 | - cft->private, userbuf, nbytes, ppos, | |
862 | - NULL); | |
858 | + return res_counter_read_u64(&mem_cgroup_from_cont(cont)->res, | |
859 | + cft->private); | |
863 | 860 | } |
864 | 861 | |
865 | 862 | static ssize_t mem_cgroup_write(struct cgroup *cont, struct cftype *cft, |
866 | 863 | |
867 | 864 | |
... | ... | @@ -950,18 +947,18 @@ |
950 | 947 | { |
951 | 948 | .name = "usage_in_bytes", |
952 | 949 | .private = RES_USAGE, |
953 | - .read = mem_cgroup_read, | |
950 | + .read_u64 = mem_cgroup_read, | |
954 | 951 | }, |
955 | 952 | { |
956 | 953 | .name = "limit_in_bytes", |
957 | 954 | .private = RES_LIMIT, |
958 | 955 | .write = mem_cgroup_write, |
959 | - .read = mem_cgroup_read, | |
956 | + .read_u64 = mem_cgroup_read, | |
960 | 957 | }, |
961 | 958 | { |
962 | 959 | .name = "failcnt", |
963 | 960 | .private = RES_FAILCNT, |
964 | - .read = mem_cgroup_read, | |
961 | + .read_u64 = mem_cgroup_read, | |
965 | 962 | }, |
966 | 963 | { |
967 | 964 | .name = "force_empty", |