mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Menage <menage@google.com>
To: balbir@in.ibm.com, pj@sgi.com, Pavel Emelianov <xemul@openvz.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	vatsa@linux.vnet.ibm.com, akpm@linux-foundation.org
Cc: containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [RFC][PATCH 4/7] CGroup API: Add res_counter_read_uint()
Date: Fri, 15 Feb 2008 12:44:22 -0800	[thread overview]
Message-ID: <20080215204821.252919000@menage.corp.google.com> (raw)
In-Reply-To: <20080215204418.535025000@menage.corp.google.com>

[-- Attachment #1: resource_counter_read_uint.patch --]
[-- Type: text/plain, Size: 1640 bytes --]

Adds a function for returning the value of a resource counter member,
in a form suitable for use in a cgroup read_uint control file method.

Signed-off-by: Paul Menage <menage@google.com>

---
 include/linux/res_counter.h |    1 +
 kernel/res_counter.c        |    5 +++++
 2 files changed, 6 insertions(+)

Index: cgroupmap-2.6.24-mm1/include/linux/res_counter.h
===================================================================
--- cgroupmap-2.6.24-mm1.orig/include/linux/res_counter.h
+++ cgroupmap-2.6.24-mm1/include/linux/res_counter.h
@@ -54,6 +54,7 @@ struct res_counter {
 ssize_t res_counter_read(struct res_counter *counter, int member,
 		const char __user *buf, size_t nbytes, loff_t *pos,
 		int (*read_strategy)(unsigned long long val, char *s));
+u64 res_counter_read_uint(struct res_counter *counter, int member);
 ssize_t res_counter_write(struct res_counter *counter, int member,
 		const char __user *buf, size_t nbytes, loff_t *pos,
 		int (*write_strategy)(char *buf, unsigned long long *val));
Index: cgroupmap-2.6.24-mm1/kernel/res_counter.c
===================================================================
--- cgroupmap-2.6.24-mm1.orig/kernel/res_counter.c
+++ cgroupmap-2.6.24-mm1/kernel/res_counter.c
@@ -92,6 +92,11 @@ ssize_t res_counter_read(struct res_coun
 			pos, buf, s - buf);
 }
 
+u64 res_counter_read_uint(struct res_counter *counter, int member)
+{
+	return *res_counter_member(counter, member);
+}
+
 ssize_t res_counter_write(struct res_counter *counter, int member,
 		const char __user *userbuf, size_t nbytes, loff_t *pos,
 		int (*write_strategy)(char *st_buf, unsigned long long *val))

--

  parent reply	other threads:[~2008-02-15 20:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-15 20:44 [RFC][PATCH 0/7] CGroup API: More structured API for CGroups control files Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 1/7] CGroup API: Add cgroup.api control file Paul Menage
2008-02-16 10:07   ` Balbir Singh
2008-02-16 17:44     ` Paul Menage
2008-02-18  9:45       ` Li Zefan
2008-02-18 10:32         ` Balbir Singh
2008-02-19 21:57         ` Paul Jackson
2008-02-20  2:51           ` Paul Menage
2008-02-20  5:17             ` Paul Jackson
2008-02-20  5:23               ` Paul Menage
2008-02-20  2:51         ` Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 2/7] CGroup API: Add cgroup map data type Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 3/7] CGroup API: Use cgroup map for memcontrol stats file Paul Menage
2008-02-15 20:44 ` Paul Menage [this message]
2008-02-15 20:44 ` [RFC][PATCH 5/7] CGroup API: Use read_uint in memory controller Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 6/7] CGroup API: Use descriptions for memory controller API files Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 7/7] CGroup API: Update cpusets to use cgroup structured file API Paul Menage
2008-02-17  3:29   ` Paul Jackson
2008-02-17 17:18     ` Paul Menage
2008-02-17 17:28       ` Paul Jackson
2008-02-17 17:48         ` Paul Menage
2008-02-18  9:55     ` Li Zefan
     [not found]       ` <47B96805.7070002@linux.vnet.ibm.com>
2008-02-18 11:13         ` Balbir Singh
2008-02-18 11:52           ` Andreas Schwab
     [not found]             ` <47B971C6.4080807@linux.vnet.ibm.com>
2008-02-18 11:56               ` Balbir Singh
2008-02-16  4:21 ` [RFC][PATCH 0/7] CGroup API: More structured API for CGroups control files KAMEZAWA Hiroyuki
2008-02-16  9:31   ` Li Zefan
2008-02-16 17:40     ` 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=20080215204821.252919000@menage.corp.google.com \
    --to=menage@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@in.ibm.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    --cc=vatsa@linux.vnet.ibm.com \
    --cc=xemul@openvz.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

all inboxes | Powered by JetHome®