diff options
author | Paul Menage <menage@google.com> | 2007-10-19 02:39:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:36 -0400 |
commit | 355e0c48b757b7fcc79ccb98fda8105ed37a1598 (patch) | |
tree | f9687961979a808e46620f4bdf9af05de2fd68e2 /include/linux/cgroup.h | |
parent | bbcb81d09104f0d440974b994c1fc508ccbe9503 (diff) |
Add cgroup write_uint() helper method
Add write_uint() helper method for cgroup subsystems
This helper is analagous to the read_uint() helper method for
reporting u64 values to userspace. It's designed to reduce the amount
of boilerplate requierd for creating new cgroup subsystems.
Signed-off-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index e2dd44f68f9..e95143c884b 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -125,6 +125,14 @@ struct cftype { | |||
125 | ssize_t (*write) (struct cgroup *cont, struct cftype *cft, | 125 | ssize_t (*write) (struct cgroup *cont, struct cftype *cft, |
126 | struct file *file, | 126 | struct file *file, |
127 | const char __user *buf, size_t nbytes, loff_t *ppos); | 127 | const char __user *buf, size_t nbytes, loff_t *ppos); |
128 | |||
129 | /* | ||
130 | * write_uint() is a shortcut for the common case of accepting | ||
131 | * a single integer (as parsed by simple_strtoull) from | ||
132 | * userspace. Use in place of write(); return 0 or error. | ||
133 | */ | ||
134 | int (*write_uint) (struct cgroup *cont, struct cftype *cft, u64 val); | ||
135 | |||
128 | int (*release) (struct inode *inode, struct file *file); | 136 | int (*release) (struct inode *inode, struct file *file); |
129 | }; | 137 | }; |
130 | 138 | ||