[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6599ad830707201441q65c8efc2kecd99d6d8094672@mail.gmail.com>
Date: Fri, 20 Jul 2007 14:41:22 -0700
From: "Paul Menage" <menage@...gle.com>
To: "Balbir Singh" <balbir@...ux.vnet.ibm.com>
Cc: "Andrew Morton" <akpm@...ux-foundation.org>,
"Peter Zijlstra" <a.p.zijlstra@...llo.nl>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
"Linux Containers" <containers@...ts.osdl.org>,
"YAMAMOTO Takashi" <yamamoto@...inux.co.jp>,
"Linux MM Mailing List" <linux-mm@...ck.org>,
"Vaidyanathan Srinivasan" <svaidy@...ux.vnet.ibm.com>,
"Pavel Emelianov" <xemul@...nvz.org>,
"Dave Hansen" <haveblue@...ibm.com>,
"Eric W Biederman" <ebiederm@...ssion.com>
Subject: Re: [RFC][-mm PATCH 8/8] Add switch to control what type of pages to limit (v3)
On 7/20/07, Balbir Singh <balbir@...ux.vnet.ibm.com> wrote:
> -static struct mem_container init_mem_container;
> +static ssize_t mem_control_type_read(struct container *cont,
> + struct cftype *cft,
> + struct file *file, char __user *userbuf,
> + size_t nbytes, loff_t *ppos)
> +{
> + unsigned long val;
> + char buf[64], *s;
> + struct mem_container *mem;
> +
> + mem = mem_container_from_cont(cont);
> + s = buf;
> + val = mem->control_type;
> + s += sprintf(s, "%lu\n", val);
> + return simple_read_from_buffer((void __user *)userbuf, nbytes,
> + ppos, buf, s - buf);
> +}
This could just use the read_uint64() hook and be something like
static u64 mem_container_control_type_read(struct container *cont,
struct cftype *cft)
{
return mem_container_from_cont(cont)->control_type;
}
Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists