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>

authored by Li Zefan and committed by Linus Torvalds ffd2d883 a043e3b2

+23 -25
+23 -25
include/linux/cgroup.h
··· 186 char name[MAX_CFTYPE_NAME]; 187 int private; 188 int (*open) (struct inode *inode, struct file *file); 189 - ssize_t (*read) (struct cgroup *cont, struct cftype *cft, 190 struct file *file, 191 char __user *buf, size_t nbytes, loff_t *ppos); 192 /* 193 * read_uint() is a shortcut for the common case of returning a 194 * single integer. Use it in place of read() 195 */ 196 - u64 (*read_uint) (struct cgroup *cont, struct cftype *cft); 197 - ssize_t (*write) (struct cgroup *cont, struct cftype *cft, 198 struct file *file, 199 const char __user *buf, size_t nbytes, loff_t *ppos); 200 ··· 203 * a single integer (as parsed by simple_strtoull) from 204 * userspace. Use in place of write(); return 0 or error. 205 */ 206 - int (*write_uint) (struct cgroup *cont, struct cftype *cft, u64 val); 207 208 int (*release) (struct inode *inode, struct file *file); 209 }; ··· 218 219 /* Add a new file to the given cgroup directory. Should only be 220 * called by subsystems from within a populate() method */ 221 - int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, 222 const struct cftype *cft); 223 224 /* Add a set of new files to the given cgroup directory. Should 225 * only be called by subsystems from within a populate() method */ 226 - int cgroup_add_files(struct cgroup *cont, 227 struct cgroup_subsys *subsys, 228 const struct cftype cft[], 229 int count); 230 231 - int cgroup_is_removed(const struct cgroup *cont); 232 233 - int cgroup_path(const struct cgroup *cont, char *buf, int buflen); 234 235 - int cgroup_task_count(const struct cgroup *cont); 236 237 /* Return true if the cgroup is a descendant of the current cgroup */ 238 - int cgroup_is_descendant(const struct cgroup *cont); 239 240 /* Control Group subsystem type. See Documentation/cgroups.txt for details */ 241 242 struct cgroup_subsys { 243 struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, 244 - struct cgroup *cont); 245 - void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont); 246 - void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); 247 int (*can_attach)(struct cgroup_subsys *ss, 248 - struct cgroup *cont, struct task_struct *tsk); 249 - void (*attach)(struct cgroup_subsys *ss, struct cgroup *cont, 250 - struct cgroup *old_cont, struct task_struct *tsk); 251 void (*fork)(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, 254 - struct cgroup *cont); 255 - void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cont); 256 void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); 257 int subsys_id; 258 int active; ··· 273 #undef SUBSYS 274 275 static inline struct cgroup_subsys_state *cgroup_subsys_state( 276 - struct cgroup *cont, int subsys_id) 277 { 278 - return cont->subsys[subsys_id]; 279 } 280 281 static inline struct cgroup_subsys_state *task_subsys_state( ··· 289 { 290 return task_subsys_state(task, subsys_id)->cgroup; 291 } 292 - 293 - int cgroup_path(const struct cgroup *cont, char *buf, int buflen); 294 295 int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss); 296 ··· 311 * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task() 312 * callback, but not while calling the process_task() callback. 313 */ 314 - void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); 315 - struct task_struct *cgroup_iter_next(struct cgroup *cont, 316 struct cgroup_iter *it); 317 - void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); 318 int cgroup_scan_tasks(struct cgroup_scanner *scan); 319 int cgroup_attach_task(struct cgroup *, struct task_struct *); 320
··· 186 char name[MAX_CFTYPE_NAME]; 187 int private; 188 int (*open) (struct inode *inode, struct file *file); 189 + ssize_t (*read) (struct cgroup *cgrp, struct cftype *cft, 190 struct file *file, 191 char __user *buf, size_t nbytes, loff_t *ppos); 192 /* 193 * read_uint() is a shortcut for the common case of returning a 194 * single integer. Use it in place of read() 195 */ 196 + u64 (*read_uint) (struct cgroup *cgrp, struct cftype *cft); 197 + ssize_t (*write) (struct cgroup *cgrp, struct cftype *cft, 198 struct file *file, 199 const char __user *buf, size_t nbytes, loff_t *ppos); 200 ··· 203 * a single integer (as parsed by simple_strtoull) from 204 * userspace. Use in place of write(); return 0 or error. 205 */ 206 + int (*write_uint) (struct cgroup *cgrp, struct cftype *cft, u64 val); 207 208 int (*release) (struct inode *inode, struct file *file); 209 }; ··· 218 219 /* Add a new file to the given cgroup directory. Should only be 220 * called by subsystems from within a populate() method */ 221 + int cgroup_add_file(struct cgroup *cgrp, struct cgroup_subsys *subsys, 222 const struct cftype *cft); 223 224 /* Add a set of new files to the given cgroup directory. Should 225 * only be called by subsystems from within a populate() method */ 226 + int cgroup_add_files(struct cgroup *cgrp, 227 struct cgroup_subsys *subsys, 228 const struct cftype cft[], 229 int count); 230 231 + int cgroup_is_removed(const struct cgroup *cgrp); 232 233 + int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen); 234 235 + int cgroup_task_count(const struct cgroup *cgrp); 236 237 /* Return true if the cgroup is a descendant of the current cgroup */ 238 + int cgroup_is_descendant(const struct cgroup *cgrp); 239 240 /* Control Group subsystem type. See Documentation/cgroups.txt for details */ 241 242 struct cgroup_subsys { 243 struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, 244 + struct cgroup *cgrp); 245 + void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); 246 + void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); 247 int (*can_attach)(struct cgroup_subsys *ss, 248 + struct cgroup *cgrp, struct task_struct *tsk); 249 + void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 250 + struct cgroup *old_cgrp, struct task_struct *tsk); 251 void (*fork)(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, 254 + struct cgroup *cgrp); 255 + void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); 256 void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); 257 int subsys_id; 258 int active; ··· 273 #undef SUBSYS 274 275 static inline struct cgroup_subsys_state *cgroup_subsys_state( 276 + struct cgroup *cgrp, int subsys_id) 277 { 278 + return cgrp->subsys[subsys_id]; 279 } 280 281 static inline struct cgroup_subsys_state *task_subsys_state( ··· 289 { 290 return task_subsys_state(task, subsys_id)->cgroup; 291 } 292 293 int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss); 294 ··· 313 * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task() 314 * callback, but not while calling the process_task() callback. 315 */ 316 + void cgroup_iter_start(struct cgroup *cgrp, struct cgroup_iter *it); 317 + struct task_struct *cgroup_iter_next(struct cgroup *cgrp, 318 struct cgroup_iter *it); 319 + void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); 320 int cgroup_scan_tasks(struct cgroup_scanner *scan); 321 int cgroup_attach_task(struct cgroup *, struct task_struct *); 322