Linux Container Development
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
To: Balbir Singh
	<balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: [PATCH 1/3] Typedefs the read and write functions in cftype
Date: Wed, 03 Oct 2007 14:55:09 +0400	[thread overview]
Message-ID: <4703750D.9070204@openvz.org> (raw)
In-Reply-To: <470374A7.6030805-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>

This is just to reduce the code amount in the future.

Signed-off-by: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>

---

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 8747932..0635004 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -178,6 +178,15 @@ struct css_set {
  *	- the 'cftype' of the file is file->f_dentry->d_fsdata
  */
 
+struct cftype;
+
+typedef ssize_t (*cft_read) (struct cgroup *cont, struct cftype *cft,
+			 struct file *file,
+			 char __user *buf, size_t nbytes, loff_t *ppos);
+typedef ssize_t (*cft_write) (struct cgroup *cont, struct cftype *cft,
+			  struct file *file,
+			  const char __user *buf, size_t nbytes, loff_t *ppos);
+
 #define MAX_CFTYPE_NAME 64
 struct cftype {
 	/* By convention, the name should begin with the name of the
@@ -185,18 +194,14 @@ struct cftype {
 	char name[MAX_CFTYPE_NAME];
 	int private;
 	int (*open) (struct inode *inode, struct file *file);
-	ssize_t (*read) (struct cgroup *cont, struct cftype *cft,
-			 struct file *file,
-			 char __user *buf, size_t nbytes, loff_t *ppos);
+	cft_read read;
 	/*
 	 * read_uint() is a shortcut for the common case of returning a
 	 * single integer. Use it in place of read()
 	 */
 	u64 (*read_uint) (struct cgroup *cont, struct cftype *cft);
-	ssize_t (*write) (struct cgroup *cont, struct cftype *cft,
-			  struct file *file,
-			  const char __user *buf, size_t nbytes, loff_t *ppos);
 
+	cft_write write;
 	/*
 	 * write_uint() is a shortcut for the common case of accepting
 	 * a single integer (as parsed by simple_strtoull) from

  parent reply	other threads:[~2007-10-03 10:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-03 10:53 [PATCH 0/3] Consolidate cgroup files creation for resource counters Pavel Emelyanov
     [not found] ` <470374A7.6030805-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-10-03 10:55   ` Pavel Emelyanov [this message]
2007-10-03 10:57   ` [PATCH 2/3] Introduce the res_counter_populate() function Pavel Emelyanov
     [not found]     ` <470375B2.5090100-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-10-03 16:02       ` Paul Menage
     [not found]         ` <6599ad830710030902h71737aban4e7cf4e4d1e4d4d1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-10-04  6:40           ` Pavel Emelyanov
2007-10-03 18:02       ` Balbir Singh
2007-10-03 10:59   ` [PATCH 3/3] Use the res_counter_populate in memory controller Pavel Emelyanov
2007-10-03 17:59   ` [PATCH 0/3] Consolidate cgroup files creation for resource counters Balbir Singh
  -- strict thread matches above, loose matches on Subject: below --
2007-10-04  9:18 [PATCH 0/3] Consolidate cgroup files creation for resource counters (v2) Pavel Emelyanov
     [not found] ` <4704AFC9.4030606-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-10-04  9:18   ` [PATCH 1/3] Typedefs the read and write functions in cftype Pavel Emelyanov
     [not found]     ` <4704AFFF.4000000-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2007-10-04 15:18       ` Paul Menage

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4703750D.9070204@openvz.org \
    --to=xemul-gefaqzzx7r8dnm+yrofe0a@public.gmane.org \
    --cc=balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox