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