aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-02-23 18:24:09 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-23 20:13:24 -0500
commitffd2d883399cbbb641e55730676ce1ec4845d99d (patch)
tree9c8d7aa567c33214bc20b0a78be0abfb0e782bfa
parenta043e3b2c63445512c5592cbe3c8694f3c655e81 (diff)
cgroup: clean up cgroup.h
- replace old name 'cont' with 'cgrp' (Paul Menage did this cleanup for cgroup.c in commit bd89aabc6761de1c35b154fe6f914a445d301510) - remove a duplicate declaration of cgroup_path() Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/cgroup.h48
1 files changed, 23 insertions, 25 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 2ebf7afedd9f..028ba3b523b1 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -186,15 +186,15 @@ struct cftype {
186 char name[MAX_CFTYPE_NAME]; 186 char name[MAX_CFTYPE_NAME];
187 int private; 187 int private;
188 int (*open) (struct inode *inode, struct file *file); 188 int (*open) (struct inode *inode, struct file *file);
189 ssize_t (*read) (struct cgroup *cont, struct cftype *cft, 189 ssize_t (*read) (struct cgroup *cgrp, struct cftype *cft,
190 struct file *file, 190 struct file *file,
191 char __user *buf, size_t nbytes, loff_t *ppos); 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_uint() is a shortcut for the common case of returning a
194 * single integer. Use it in place of read() 194 * single integer. Use it in place of read()
195 */ 195 */
196 u64 (*read_uint) (struct cgroup *cont, struct cftype *cft); 196 u64 (*read_uint) (struct cgroup *cgrp, struct cftype *cft);
197 ssize_t (*write) (struct cgroup *cont, struct cftype *cft, 197 ssize_t (*write) (struct cgroup *cgrp, struct cftype *cft,
198 struct file *file, 198 struct file *file,
199 const char __user *buf, size_t nbytes, loff_t *ppos); 199 const char __user *buf, size_t nbytes, loff_t *ppos);
200 200
@@ -203,7 +203,7 @@ struct cftype {
203 * a single integer (as parsed by simple_strtoull) from 203 * a single integer (as parsed by simple_strtoull) from
204 * userspace. Use in place of write(); return 0 or error. 204 * userspace. Use in place of write(); return 0 or error.
205 */ 205 */
206 int (*write_uint) (struct cgroup *cont, struct cftype *cft, u64 val); 206 int (*write_uint) (struct cgroup *cgrp, struct cftype *cft, u64 val);
207 207
208 int (*release) (struct inode *inode, struct file *file); 208 int (*release) (struct inode *inode, struct file *file);
209}; 209};
@@ -218,41 +218,41 @@ struct cgroup_scanner {
218 218
219/* Add a new file to the given cgroup directory. Should only be 219/* Add a new file to the given cgroup directory. Should only be
220 * called by subsystems from within a populate() method */ 220 * called by subsystems from within a populate() method */
221int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, 221int cgroup_add_file(struct cgroup *cgrp, struct cgroup_subsys *subsys,
222 const struct cftype *cft); 222 const struct cftype *cft);
223 223
224/* Add a set of new files to the given cgroup directory. Should 224/* Add a set of new files to the given cgroup directory. Should
225 * only be called by subsystems from within a populate() method */ 225 * only be called by subsystems from within a populate() method */
226int cgroup_add_files(struct cgroup *cont, 226int cgroup_add_files(struct cgroup *cgrp,
227 struct cgroup_subsys *subsys, 227 struct cgroup_subsys *subsys,
228 const struct cftype cft[], 228 const struct cftype cft[],
229 int count); 229 int count);
230 230
231int cgroup_is_removed(const struct cgroup *cont); 231int cgroup_is_removed(const struct cgroup *cgrp);
232 232
233int cgroup_path(const struct cgroup *cont, char *buf, int buflen); 233int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen);
234 234
235int cgroup_task_count(const struct cgroup *cont); 235int cgroup_task_count(const struct cgroup *cgrp);
236 236
237/* Return true if the cgroup is a descendant of the current cgroup */ 237/* Return true if the cgroup is a descendant of the current cgroup */
238int cgroup_is_descendant(const struct cgroup *cont); 238int cgroup_is_descendant(const struct cgroup *cgrp);
239 239
240/* Control Group subsystem type. See Documentation/cgroups.txt for details */ 240/* Control Group subsystem type. See Documentation/cgroups.txt for details */
241 241
242struct cgroup_subsys { 242struct cgroup_subsys {
243 struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, 243 struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss,
244 struct cgroup *cont); 244 struct cgroup *cgrp);
245 void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont); 245 void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
246 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); 246 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
247 int (*can_attach)(struct cgroup_subsys *ss, 247 int (*can_attach)(struct cgroup_subsys *ss,
248 struct cgroup *cont, struct task_struct *tsk); 248 struct cgroup *cgrp, struct task_struct *tsk);
249 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cont, 249 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
250 struct cgroup *old_cont, struct task_struct *tsk); 250 struct cgroup *old_cgrp, struct task_struct *tsk);
251 void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); 251 void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
252 void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); 252 void (*exit)(struct cgroup_subsys *ss, struct task_struct *task);
253 int (*populate)(struct cgroup_subsys *ss, 253 int (*populate)(struct cgroup_subsys *ss,
254 struct cgroup *cont); 254 struct cgroup *cgrp);
255 void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cont); 255 void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp);
256 void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); 256 void (*bind)(struct cgroup_subsys *ss, struct cgroup *root);
257 int subsys_id; 257 int subsys_id;
258 int active; 258 int active;
@@ -273,9 +273,9 @@ struct cgroup_subsys {
273#undef SUBSYS 273#undef SUBSYS
274 274
275static inline struct cgroup_subsys_state *cgroup_subsys_state( 275static inline struct cgroup_subsys_state *cgroup_subsys_state(
276 struct cgroup *cont, int subsys_id) 276 struct cgroup *cgrp, int subsys_id)
277{ 277{
278 return cont->subsys[subsys_id]; 278 return cgrp->subsys[subsys_id];
279} 279}
280 280
281static inline struct cgroup_subsys_state *task_subsys_state( 281static inline struct cgroup_subsys_state *task_subsys_state(
@@ -290,8 +290,6 @@ static inline struct cgroup* task_cgroup(struct task_struct *task,
290 return task_subsys_state(task, subsys_id)->cgroup; 290 return task_subsys_state(task, subsys_id)->cgroup;
291} 291}
292 292
293int cgroup_path(const struct cgroup *cont, char *buf, int buflen);
294
295int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss); 293int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss);
296 294
297/* A cgroup_iter should be treated as an opaque object */ 295/* A cgroup_iter should be treated as an opaque object */
@@ -313,10 +311,10 @@ struct cgroup_iter {
313 * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task() 311 * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task()
314 * callback, but not while calling the process_task() callback. 312 * callback, but not while calling the process_task() callback.
315 */ 313 */
316void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); 314void cgroup_iter_start(struct cgroup *cgrp, struct cgroup_iter *it);
317struct task_struct *cgroup_iter_next(struct cgroup *cont, 315struct task_struct *cgroup_iter_next(struct cgroup *cgrp,
318 struct cgroup_iter *it); 316 struct cgroup_iter *it);
319void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); 317void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it);
320int cgroup_scan_tasks(struct cgroup_scanner *scan); 318int cgroup_scan_tasks(struct cgroup_scanner *scan);
321int cgroup_attach_task(struct cgroup *, struct task_struct *); 319int cgroup_attach_task(struct cgroup *, struct task_struct *);
322 320