From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx162.postini.com [74.125.245.162]) by kanga.kvack.org (Postfix) with SMTP id E96BE6B000E for ; Tue, 29 Jan 2013 15:49:23 -0500 (EST) Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 29 Jan 2013 15:49:22 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 97D4CC90044 for ; Tue, 29 Jan 2013 15:49:18 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0TKnIXi20512906 for ; Tue, 29 Jan 2013 15:49:18 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0TKnFMG024930 for ; Tue, 29 Jan 2013 18:49:16 -0200 Message-ID: <510835C6.8070200@linux.vnet.ibm.com> Date: Tue, 29 Jan 2013 14:49:10 -0600 From: Seth Jennings MIME-Version: 1.0 Subject: Re: [PATCHv3 1/6] debugfs: add get/set for atomic types References: <1359409767-30092-1-git-send-email-sjenning@linux.vnet.ibm.com> <1359409767-30092-2-git-send-email-sjenning@linux.vnet.ibm.com> <20130129203509.GB27740@konrad-lan.dumpdata.com> In-Reply-To: <20130129203509.GB27740@konrad-lan.dumpdata.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Konrad Rzeszutek Wilk Cc: Andrew Morton , Greg Kroah-Hartman , Nitin Gupta , Minchan Kim , Dan Magenheimer , Robert Jennings , Jenifer Hopper , Mel Gorman , Johannes Weiner , Rik van Riel , Larry Woodman , Benjamin Herrenschmidt , Dave Hansen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org On 01/29/2013 02:35 PM, Konrad Rzeszutek Wilk wrote: > On Mon, Jan 28, 2013 at 03:49:22PM -0600, Seth Jennings wrote: >> debugfs currently lack the ability to create attributes >> that set/get atomic_t values. >> >> This patch adds support for this through a new >> debugfs_create_atomic_t() function. >> >> Signed-off-by: Seth Jennings >> Acked-by: Greg Kroah-Hartman >> --- >> fs/debugfs/file.c | 42 ++++++++++++++++++++++++++++++++++++++++++ >> include/linux/debugfs.h | 2 ++ >> 2 files changed, 44 insertions(+) >> >> diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c >> index c5ca6ae..fa26d5b 100644 >> --- a/fs/debugfs/file.c >> +++ b/fs/debugfs/file.c >> @@ -21,6 +21,7 @@ >> #include >> #include >> #include >> +#include >> >> static ssize_t default_read_file(struct file *file, char __user *buf, >> size_t count, loff_t *ppos) >> @@ -403,6 +404,47 @@ struct dentry *debugfs_create_size_t(const char *name, umode_t mode, >> } >> EXPORT_SYMBOL_GPL(debugfs_create_size_t); >> >> +static int debugfs_atomic_t_set(void *data, u64 val) > > Should the 'data' be 'atomic_t *' just to make sure nobody messes this > up? Or would that bring too much header changes? DEFINE_SIMPLE_ATTRIBUTE() uses simple_attr_open() whose signature requires the argument be a void *. So we can't change it (easily). Seth -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753109Ab3A2UuI (ORCPT ); Tue, 29 Jan 2013 15:50:08 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:54389 "EHLO e7.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331Ab3A2UuG (ORCPT ); Tue, 29 Jan 2013 15:50:06 -0500 Message-ID: <510835C6.8070200@linux.vnet.ibm.com> Date: Tue, 29 Jan 2013 14:49:10 -0600 From: Seth Jennings User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Konrad Rzeszutek Wilk CC: Andrew Morton , Greg Kroah-Hartman , Nitin Gupta , Minchan Kim , Dan Magenheimer , Robert Jennings , Jenifer Hopper , Mel Gorman , Johannes Weiner , Rik van Riel , Larry Woodman , Benjamin Herrenschmidt , Dave Hansen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: Re: [PATCHv3 1/6] debugfs: add get/set for atomic types References: <1359409767-30092-1-git-send-email-sjenning@linux.vnet.ibm.com> <1359409767-30092-2-git-send-email-sjenning@linux.vnet.ibm.com> <20130129203509.GB27740@konrad-lan.dumpdata.com> In-Reply-To: <20130129203509.GB27740@konrad-lan.dumpdata.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13012920-5806-0000-0000-00001EE6E128 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/29/2013 02:35 PM, Konrad Rzeszutek Wilk wrote: > On Mon, Jan 28, 2013 at 03:49:22PM -0600, Seth Jennings wrote: >> debugfs currently lack the ability to create attributes >> that set/get atomic_t values. >> >> This patch adds support for this through a new >> debugfs_create_atomic_t() function. >> >> Signed-off-by: Seth Jennings >> Acked-by: Greg Kroah-Hartman >> --- >> fs/debugfs/file.c | 42 ++++++++++++++++++++++++++++++++++++++++++ >> include/linux/debugfs.h | 2 ++ >> 2 files changed, 44 insertions(+) >> >> diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c >> index c5ca6ae..fa26d5b 100644 >> --- a/fs/debugfs/file.c >> +++ b/fs/debugfs/file.c >> @@ -21,6 +21,7 @@ >> #include >> #include >> #include >> +#include >> >> static ssize_t default_read_file(struct file *file, char __user *buf, >> size_t count, loff_t *ppos) >> @@ -403,6 +404,47 @@ struct dentry *debugfs_create_size_t(const char *name, umode_t mode, >> } >> EXPORT_SYMBOL_GPL(debugfs_create_size_t); >> >> +static int debugfs_atomic_t_set(void *data, u64 val) > > Should the 'data' be 'atomic_t *' just to make sure nobody messes this > up? Or would that bring too much header changes? DEFINE_SIMPLE_ATTRIBUTE() uses simple_attr_open() whose signature requires the argument be a void *. So we can't change it (easily). Seth