From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E79CC3A589 for ; Thu, 15 Aug 2019 20:43:37 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 477602171F; Thu, 15 Aug 2019 20:43:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="Sg9OLSrN"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="IAqYmaNB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="rmevilO9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 477602171F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hyMau-000483-QP; Thu, 15 Aug 2019 20:43:36 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hyMat-00047f-7g; Thu, 15 Aug 2019 20:43:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CwQ/0EejkrmNJB3s/c5x0QrEieuuLi6e5/NeZ6sCt6E=; b=Sg9OLSrN7lGuu2SNDeytZwpCVO gb98Lae6ysK2dlYgueaDNDuHLz0osPJ72ncQbtwF45GY044tflKDIuwkNQx9Hwtlmuy1fD1VWDnrT nCP6EDbIVlYqfc2pCjjEaz4906nC5BOA/3WC+B3vFnSamGvQJJzJjRstJ0RUBMOXNZso=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CwQ/0EejkrmNJB3s/c5x0QrEieuuLi6e5/NeZ6sCt6E=; b=IAqYmaNBIsLazj8FsB59MTzmvq YXSrhllSdbdyzMKMwJ/5NuxV5B17daQCYVfS34lCONb7zlxAqu5soCSCtILN3iHQ00vsdehOUkcYb za9FWbXoPVsPsAIqaqfUmsktCLxPUpKEPLqsM0lv4hlWJCmSqi2ZN8zj5Rl6iY+yl/SI=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1hyMap-005ByL-84; Thu, 15 Aug 2019 20:43:35 +0000 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5BB2B2083B; Thu, 15 Aug 2019 20:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565901805; bh=4MUbuhxyjB/Z/I0+KEuHYyPv1fvr/qroc0kojX6LQUI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rmevilO9FFuTpF1TkeHr9rMjq0tx8UWAlZu1cW/zsMuDRMCXNIqbtamv/Bh9PWjxr uMcyMcUqmrlEz/U6ipnvwnFJksubQpe8uhV+mxBP/PuZfI7m0SnpKLNF/GD9rIRrXm 9i2PofIAyA1t7LZj0WwS4y+NrRc1E+LScCfI1k7c= Date: Thu, 15 Aug 2019 22:43:22 +0200 From: Greg Kroah-Hartman To: James Morris Message-ID: <20190815204322.GB6782@kroah.com> References: <20190812193320.200472-1-salyzyn@android.com> <20190813084801.GA972@kroah.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Headers-End: 1hyMap-005ByL-84 Subject: Re: [f2fs-dev] [PATCH] Add flags option to get xattr method paired to __vfs_getxattr X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Latchesar Ionkov , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, linux-integrity@vger.kernel.org, Martin Brandenburg , samba-technical@lists.samba.org, Dominique Martinet , Mimi Zohar , linux-unionfs@vger.kernel.org, David Howells , Chris Mason , "David S. Miller" , Andreas Dilger , Eric Paris , netdev@vger.kernel.org, Tyler Hicks , linux-afs@lists.infradead.org, Mike Marshall , linux-xfs@vger.kernel.org, Andreas Gruenbacher , Sage Weil , Miklos Szeredi , Richard Weinberger , Mark Fasheh , Hugh Dickins , Ernesto =?iso-8859-1?Q?A=2E_Fern=E1ndez?= , cluster-devel@redhat.com, selinux@vger.kernel.org, Vyacheslav Dubeyko , Casey Schaufler , v9fs-developer@lists.sourceforge.net, Ilya Dryomov , linux-ext4@vger.kernel.org, kernel-team@android.com, linux-mm@kvack.org, devel@lists.orangefs.org, Serge Hallyn , linux-cifs@vger.kernel.org, Eric Van Hensbergen , ecryptfs@vger.kernel.org, Josef Bacik , reiserfs-devel@vger.kernel.org, Tejun Heo , Joel Becker , linux-mtd@lists.infradead.org, David Sterba , Jaegeuk Kim , ceph-devel@vger.kernel.org, Trond Myklebust , Paul Moore , linux-nfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Theodore Ts'o , linux-fsdevel@vger.kernel.org, Joseph Qi , Mathieu Malaterre , Stephen Smalley , "Darrick J. Wong" , Jeff Layton , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Mark Salyzyn , Steve French , linux-security-module@vger.kernel.org, ocfs2-devel@oss.oracle.com, Jan Kara , Bob Peterson , Phillip Lougher , Andrew Morton , David Woodhouse , Anna Schumaker , linux-btrfs@vger.kernel.org, Alexander Viro Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Fri, Aug 16, 2019 at 05:20:36AM +1000, James Morris wrote: > On Tue, 13 Aug 2019, Greg Kroah-Hartman wrote: > > > On Mon, Aug 12, 2019 at 12:32:49PM -0700, Mark Salyzyn wrote: > > > --- a/include/linux/xattr.h > > > +++ b/include/linux/xattr.h > > > @@ -30,10 +30,10 @@ struct xattr_handler { > > > const char *prefix; > > > int flags; /* fs private flags */ > > > bool (*list)(struct dentry *dentry); > > > - int (*get)(const struct xattr_handler *, struct dentry *dentry, > > > + int (*get)(const struct xattr_handler *handler, struct dentry *dentry, > > > struct inode *inode, const char *name, void *buffer, > > > - size_t size); > > > - int (*set)(const struct xattr_handler *, struct dentry *dentry, > > > + size_t size, int flags); > > > + int (*set)(const struct xattr_handler *handler, struct dentry *dentry, > > > struct inode *inode, const char *name, const void *buffer, > > > size_t size, int flags); > > > > Wow, 7 arguments. Isn't there some nice rule of thumb that says once > > you get more then 5, a function becomes impossible to understand? > > > > Surely this could be a structure passed in here somehow, that way when > > you add the 8th argument in the future, you don't have to change > > everything yet again? :) > > > > I don't have anything concrete to offer as a replacement fix for this, > > but to me this just feels really wrong... > > How about something like: > > struct xattr_gs_args { > struct dentry *dentry; > struct inode *inode; As he said in a later message, dentry and inode is redundant, only 1 is needed (dentry I think?) > const char *name; > const void *buffer; > size_t size; > int flags; > }; > > int (*get)(const struct xattr_handler *handler, struct xattr_gs_args *args); > int (*set)(const struct xattr_handler *handler, struct xattr_gs_args *args); But yes, that would be much much better. thanks, greg k-h _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel