Commit f4c753b7eacc277e506066abdda351cbc1cf8e6a

Authored by Paul Menage
Committed by Linus Torvalds
1 parent 3ff31d0cca

CGroup API files: rename read/write_uint methods to read_write_u64

Several people have justifiably complained that the "_uint" suffix is
inappropriate for functions that handle u64 values, so this patch just renames
all these functions and their users to have the suffic _u64.

[peterz@infradead.org: build fix]
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: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 4 changed files with 32 additions and 32 deletions Side-by-side Diff

include/linux/cgroup.h
... ... @@ -190,20 +190,20 @@
190 190 struct file *file,
191 191 char __user *buf, size_t nbytes, loff_t *ppos);
192 192 /*
193   - * read_uint() is a shortcut for the common case of returning a
  193 + * read_u64() is a shortcut for the common case of returning a
194 194 * single integer. Use it in place of read()
195 195 */
196   - u64 (*read_uint) (struct cgroup *cgrp, struct cftype *cft);
  196 + u64 (*read_u64) (struct cgroup *cgrp, struct cftype *cft);
197 197 ssize_t (*write) (struct cgroup *cgrp, struct cftype *cft,
198 198 struct file *file,
199 199 const char __user *buf, size_t nbytes, loff_t *ppos);
200 200  
201 201 /*
202   - * write_uint() is a shortcut for the common case of accepting
  202 + * write_u64() is a shortcut for the common case of accepting
203 203 * a single integer (as parsed by simple_strtoull) from
204 204 * userspace. Use in place of write(); return 0 or error.
205 205 */
206   - int (*write_uint) (struct cgroup *cgrp, struct cftype *cft, u64 val);
  206 + int (*write_u64) (struct cgroup *cgrp, struct cftype *cft, u64 val);
207 207  
208 208 int (*release) (struct inode *inode, struct file *file);
209 209 };
... ... @@ -1311,10 +1311,10 @@
1311 1311 FILE_RELEASE_AGENT,
1312 1312 };
1313 1313  
1314   -static ssize_t cgroup_write_uint(struct cgroup *cgrp, struct cftype *cft,
1315   - struct file *file,
1316   - const char __user *userbuf,
1317   - size_t nbytes, loff_t *unused_ppos)
  1314 +static ssize_t cgroup_write_u64(struct cgroup *cgrp, struct cftype *cft,
  1315 + struct file *file,
  1316 + const char __user *userbuf,
  1317 + size_t nbytes, loff_t *unused_ppos)
1318 1318 {
1319 1319 char buffer[64];
1320 1320 int retval = 0;
... ... @@ -1338,7 +1338,7 @@
1338 1338 return -EINVAL;
1339 1339  
1340 1340 /* Pass to subsystem */
1341   - retval = cft->write_uint(cgrp, cft, val);
  1341 + retval = cft->write_u64(cgrp, cft, val);
1342 1342 if (!retval)
1343 1343 retval = nbytes;
1344 1344 return retval;
1345 1345  
1346 1346  
... ... @@ -1419,18 +1419,18 @@
1419 1419 return -ENODEV;
1420 1420 if (cft->write)
1421 1421 return cft->write(cgrp, cft, file, buf, nbytes, ppos);
1422   - if (cft->write_uint)
1423   - return cgroup_write_uint(cgrp, cft, file, buf, nbytes, ppos);
  1422 + if (cft->write_u64)
  1423 + return cgroup_write_u64(cgrp, cft, file, buf, nbytes, ppos);
1424 1424 return -EINVAL;
1425 1425 }
1426 1426  
1427   -static ssize_t cgroup_read_uint(struct cgroup *cgrp, struct cftype *cft,
1428   - struct file *file,
1429   - char __user *buf, size_t nbytes,
1430   - loff_t *ppos)
  1427 +static ssize_t cgroup_read_u64(struct cgroup *cgrp, struct cftype *cft,
  1428 + struct file *file,
  1429 + char __user *buf, size_t nbytes,
  1430 + loff_t *ppos)
1431 1431 {
1432 1432 char tmp[64];
1433   - u64 val = cft->read_uint(cgrp, cft);
  1433 + u64 val = cft->read_u64(cgrp, cft);
1434 1434 int len = sprintf(tmp, "%llu\n", (unsigned long long) val);
1435 1435  
1436 1436 return simple_read_from_buffer(buf, nbytes, ppos, tmp, len);
... ... @@ -1490,8 +1490,8 @@
1490 1490  
1491 1491 if (cft->read)
1492 1492 return cft->read(cgrp, cft, file, buf, nbytes, ppos);
1493   - if (cft->read_uint)
1494   - return cgroup_read_uint(cgrp, cft, file, buf, nbytes, ppos);
  1493 + if (cft->read_u64)
  1494 + return cgroup_read_u64(cgrp, cft, file, buf, nbytes, ppos);
1495 1495 return -EINVAL;
1496 1496 }
1497 1497  
1498 1498  
... ... @@ -2158,14 +2158,14 @@
2158 2158  
2159 2159 {
2160 2160 .name = "notify_on_release",
2161   - .read_uint = cgroup_read_notify_on_release,
  2161 + .read_u64 = cgroup_read_notify_on_release,
2162 2162 .write = cgroup_common_file_write,
2163 2163 .private = FILE_NOTIFY_ON_RELEASE,
2164 2164 },
2165 2165  
2166 2166 {
2167 2167 .name = "releasable",
2168   - .read_uint = cgroup_read_releasable,
  2168 + .read_u64 = cgroup_read_releasable,
2169 2169 .private = FILE_RELEASABLE,
2170 2170 }
2171 2171 };
kernel/cgroup_debug.c
... ... @@ -65,21 +65,21 @@
65 65 static struct cftype files[] = {
66 66 {
67 67 .name = "cgroup_refcount",
68   - .read_uint = cgroup_refcount_read,
  68 + .read_u64 = cgroup_refcount_read,
69 69 },
70 70 {
71 71 .name = "taskcount",
72   - .read_uint = taskcount_read,
  72 + .read_u64 = taskcount_read,
73 73 },
74 74  
75 75 {
76 76 .name = "current_css_set",
77   - .read_uint = current_css_set_read,
  77 + .read_u64 = current_css_set_read,
78 78 },
79 79  
80 80 {
81 81 .name = "current_css_set_refcount",
82   - .read_uint = current_css_set_refcount_read,
  82 + .read_u64 = current_css_set_refcount_read,
83 83 },
84 84 };
85 85  
... ... @@ -9057,13 +9057,13 @@
9057 9057 }
9058 9058  
9059 9059 #ifdef CONFIG_FAIR_GROUP_SCHED
9060   -static int cpu_shares_write_uint(struct cgroup *cgrp, struct cftype *cftype,
  9060 +static int cpu_shares_write_u64(struct cgroup *cgrp, struct cftype *cftype,
9061 9061 u64 shareval)
9062 9062 {
9063 9063 return sched_group_set_shares(cgroup_tg(cgrp), shareval);
9064 9064 }
9065 9065  
9066   -static u64 cpu_shares_read_uint(struct cgroup *cgrp, struct cftype *cft)
  9066 +static u64 cpu_shares_read_u64(struct cgroup *cgrp, struct cftype *cft)
9067 9067 {
9068 9068 struct task_group *tg = cgroup_tg(cgrp);
9069 9069  
... ... @@ -9133,8 +9133,8 @@
9133 9133 #ifdef CONFIG_FAIR_GROUP_SCHED
9134 9134 {
9135 9135 .name = "shares",
9136   - .read_uint = cpu_shares_read_uint,
9137   - .write_uint = cpu_shares_write_uint,
  9136 + .read_u64 = cpu_shares_read_u64,
  9137 + .write_u64 = cpu_shares_write_u64,
9138 9138 },
9139 9139 #endif
9140 9140 #ifdef CONFIG_RT_GROUP_SCHED
... ... @@ -9145,8 +9145,8 @@
9145 9145 },
9146 9146 {
9147 9147 .name = "rt_period_us",
9148   - .read_uint = cpu_rt_period_read_uint,
9149   - .write_uint = cpu_rt_period_write_uint,
  9148 + .read_u64 = cpu_rt_period_read_uint,
  9149 + .write_u64 = cpu_rt_period_write_uint,
9150 9150 },
9151 9151 #endif
9152 9152 };
... ... @@ -9277,8 +9277,8 @@
9277 9277 static struct cftype files[] = {
9278 9278 {
9279 9279 .name = "usage",
9280   - .read_uint = cpuusage_read,
9281   - .write_uint = cpuusage_write,
  9280 + .read_u64 = cpuusage_read,
  9281 + .write_u64 = cpuusage_write,
9282 9282 },
9283 9283 };
9284 9284