Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754796Ab2FFHoe (ORCPT ); Wed, 6 Jun 2012 03:44:34 -0400 Received: from natasha.panasas.com ([67.152.220.90]:45845 "EHLO natasha.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445Ab2FFHoc (ORCPT ); Wed, 6 Jun 2012 03:44:32 -0400 Message-ID: <4FCF08BE.3040801@panasas.com> Date: Wed, 6 Jun 2012 10:37:34 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Andrew Morton CC: Wanpeng Li , Fengguang Wu , Rob Landley , Alexander Viro , "Eric W. Biederman" , Lucas De Marchi , "David S. Miller" , Jan Kara , Mel Gorman , Minchan Kim , David Howells , James Morris , Ingo Molnar , Michel Lespinasse , , , , Gavin Shan , Wanpeng Li Subject: Re: [PATCH v2] remove no longer use of pdflush interface References: <1338888372-3555-1-git-send-email-liwp.linux@gmail.com> <20120605152845.8b633881.akpm@linux-foundation.org> <4FCF0740.1040204@panasas.com> In-Reply-To: <4FCF0740.1040204@panasas.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1677 Lines: 64 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 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) { > + printk(KERN_WARNING "%s exported in /proc is deprecated\n", > + table->procname); > + *ctl_table->data = 0; + *ctl_table->data = 1; stupid me, time for coffee Boaz > + } > + return -ENOSYS; > +} -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/