From: Wanpeng Li <liwp.linux@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Boaz Harrosh <bharrosh@panasas.com>,
Wanpeng Li <liwp.linux@gmail.com>,
Fengguang Wu <fengguang.wu@intel.com>,
Rob Landley <rob@landley.net>,
Alexander Viro <viro@zeniv.linux.org.uk>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Lucas De Marchi <lucas.demarchi@profusion.mobi>,
"David S. Miller" <davem@davemloft.net>, Jan Kara <jack@suse.cz>,
Mel Gorman <mgorman@suse.de>, Minchan Kim <minchan.kim@gmail.com>,
David Howells <dhowells@redhat.com>,
James Morris <james.l.morris@oracle.com>,
Ingo Molnar <mingo@elte.hu>,
Michel Lespinasse <walken@google.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
Gavin Shan <shangw@linux.vnet.ibm.com>,
Wanpeng Li <liwp@linux.vnet.ibm.com>
Subject: Re: [PATCH v2] remove no longer use of pdflush interface
Date: Wed, 6 Jun 2012 17:32:14 +0800 [thread overview]
Message-ID: <20120606093213.GB10953@kernel> (raw)
In-Reply-To: <4FCF08BE.3040801@panasas.com>
On Wed, Jun 06, 2012 at 10:37:34AM +0300, Boaz Harrosh wrote:
>On 06/06/2012 10:31 AM, Boaz Harrosh wrote:
>
>> On 06/06/2012 01:28 AM, Andrew Morton wrote:
>>
>>> On Tue, 5 Jun 2012 17:26:11 +0800
>>> Wanpeng Li <liwp.linux@gmail.com> wrote:
>>>
>>> So perhaps the solution is to give up on the generic proc_obsolete()
>>> idea, and just add a handler specifically for nr_pdflush_threads, whcih
>>> uses printk_once().
>>>
>>
>>
>> If there are many users than a self made print once is worth it
>> we can use the ctl_table->data pointer for this, some thing like:
>>
>> int nr_pdflush_was_printed;
>>
>> @@ -1095,11 +1095,9 @@ static struct ctl_table vm_table[] = {
>> .extra1 = &zero,
>> },
>> {
>> - .procname = "nr_pdflush_threads",
>> - .data = &nr_pdflush_threads,
>> - .maxlen = sizeof nr_pdflush_threads,
>> - .mode = 0444 /* read-only*/,
>> - .proc_handler = proc_dointvec,
>> + .data = &nr_pdflush_was_printed,
>> + .procname = "nr_pdflush_threads",
>> + .mode = 0444 /* read-only */,
>> + .proc_handler = proc_obsolete,
>> },
>>
>>
>> +/* notice associated proc deprecated */
>> +int proc_deprecated(struct ctl_table *table, int write,
>> + void __user *buffer, size_t *lenp, loff_t *ppos, )
>> +{
>> + if (*ctl_table->data) {
>
>
>+ if(!*ctl_table->data) {
if(!*table->data) {
>
>> + printk(KERN_WARNING "%s exported in /proc is deprecated\n",
>> + table->procname);
>> + *ctl_table->data = 0;
>
>
>+ *ctl_table->data = 1;
*table->data = 1;
Regards,
Wanpeng Li
>
>stupid me, time for coffee
>
>Boaz
>
>> + }
>> + return -ENOSYS;
>> +}
>
>
next prev parent reply other threads:[~2012-06-06 9:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 9:26 [PATCH v2] remove no longer use of pdflush interface Wanpeng Li
2012-06-05 14:45 ` Gavin Shan
2012-06-06 3:00 ` Wanpeng Li
2012-06-05 22:28 ` Andrew Morton
2012-06-06 3:21 ` Wanpeng Li
2012-06-06 4:01 ` Andrew Morton
2012-06-06 7:31 ` Boaz Harrosh
2012-06-06 7:36 ` Boaz Harrosh
2012-06-06 7:37 ` Boaz Harrosh
2012-06-06 9:32 ` Wanpeng Li [this message]
2012-06-06 10:55 ` Wanpeng Li
2012-06-06 13:26 ` Fengguang Wu
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=20120606093213.GB10953@kernel \
--to=liwp.linux@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bharrosh@panasas.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=fengguang.wu@intel.com \
--cc=jack@suse.cz \
--cc=james.l.morris@oracle.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liwp@linux.vnet.ibm.com \
--cc=lucas.demarchi@profusion.mobi \
--cc=mgorman@suse.de \
--cc=minchan.kim@gmail.com \
--cc=mingo@elte.hu \
--cc=rob@landley.net \
--cc=shangw@linux.vnet.ibm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=walken@google.com \
/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;
as well as URLs for NNTP newsgroup(s).