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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,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 E3EE4C3A589 for ; Thu, 15 Aug 2019 20:23:18 +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 AAE102083B; Thu, 15 Aug 2019 20:23:18 +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="kKdSuMeC"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="a2fg5L5f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAE102083B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=namei.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-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hyMHF-0003uv-Vr; Thu, 15 Aug 2019 20:23:17 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hyMHE-0003uc-6V; Thu, 15 Aug 2019 20:23:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:MIME-Version:References:Message-ID: In-Reply-To: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=2eL823Jqvx1j1kcFLhAmk6F9wnIxhnSdO5FaHYmKU8I=; b=kKdSuMeCtGJMIwqDHVdCwsoIIK C1ZGYmrl3fruLpQgoBRGhHR5imX44U78R5GYdn9hlV30cV/Pd78DdLKoQEGP27NSBeOVMNQJR30pL OFveD3Ipopk2wqfm8ECiQ8RJKDvsF+MoxXj5uGzHwHBnTzuBkFEkJ2GbDygcAcPJg/eA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:MIME-Version:References:Message-ID:In-Reply-To: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=2eL823Jqvx1j1kcFLhAmk6F9wnIxhnSdO5FaHYmKU8I=; b=a2fg5L5fdFC72Rua/cY3wPVh2Z dAMLgFqAiUvNYEbsdRRK3FM727iYPoqW6KW9m5Isp0MGuSN7Yu3SL5aIFhJn2fdw114VJd+YIisTR rVe+T3VYlO9/M9tlSgmFu4tNGFYPBP5JCBryq7lVoKHiP7FcwN0+Fkq8VuWrf5Zg2PFw=; Received: from namei.org ([65.99.196.166]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1hyMHB-004mCm-2G; Thu, 15 Aug 2019 20:23:16 +0000 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id x7FJKa6b013630; Thu, 15 Aug 2019 19:20:36 GMT Date: Fri, 16 Aug 2019 05:20:36 +1000 (AEST) From: James Morris To: Greg Kroah-Hartman In-Reply-To: <20190813084801.GA972@kroah.com> Message-ID: References: <20190812193320.200472-1-salyzyn@android.com> <20190813084801.GA972@kroah.com> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 X-Headers-End: 1hyMHB-004mCm-2G 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 , =?ISO-8859-15?Q?Ernesto_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 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; 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); -- James Morris _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel