EcryptFS development
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: James Morris <jmorris@namei.org>
Cc: Latchesar Ionkov <lucho@ionkov.net>,
	Dave Kleikamp <shaggy@kernel.org>,
	jfs-discussion@lists.sourceforge.net,
	linux-integrity@vger.kernel.org,
	Martin Brandenburg <martin@omnibond.com>,
	samba-technical@lists.samba.org,
	Dominique Martinet <asmadeus@codewreck.org>,
	Mimi Zohar <zohar@linux.ibm.com>,
	linux-unionfs@vger.kernel.org,
	David Howells <dhowells@redhat.com>, Chris Mason <clm@fb.com>,
	"David S. Miller" <davem@davemloft.net>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Eric Paris <eparis@parisplace.org>,
	netdev@vger.kernel.org, Tyler Hicks <tyhicks@canonical.com>,
	linux-afs@lists.infradead.org,
	Mike Marshall <hubcap@omnibond.com>,
	linux-xfs@vger.kernel.org,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Sage Weil <sage@redhat.com>, Miklos Szeredi <miklos@szeredi.hu>,
	Richard Weinberger <richard@nod.at>,
	Mark Fasheh <mark@fasheh.com>, Hugh Dickins <hughd@google.com>,
	Ernesto
Subject: Re: [PATCH] Add flags option to get xattr method paired to __vfs_getxattr
Date: Thu, 15 Aug 2019 22:43:22 +0200	[thread overview]
Message-ID: <20190815204322.GB6782@kroah.com> (raw)
In-Reply-To: <alpine.LRH.2.21.1908160515130.12729@namei.org>

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

  reply	other threads:[~2019-08-15 20:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 19:32 [PATCH] Add flags option to get xattr method paired to __vfs_getxattr Mark Salyzyn via Linux-f2fs-devel
2019-08-13  8:28 ` kbuild test robot
2019-08-13  8:48 ` Greg Kroah-Hartman
2019-08-13 14:37   ` Mark Salyzyn via Linux-f2fs-devel
2019-08-15 19:20   ` James Morris
2019-08-15 20:43     ` Greg Kroah-Hartman [this message]
2019-08-15 21:26     ` Mark Salyzyn
2019-08-15 22:27       ` James Morris
2019-08-16 15:30         ` Mark Salyzyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190815204322.GB6782@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=agruenba@redhat.com \
    --cc=asmadeus@codewreck.org \
    --cc=clm@fb.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=eparis@parisplace.org \
    --cc=hubcap@omnibond.com \
    --cc=hughd@google.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jmorris@namei.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=mark@fasheh.com \
    --cc=martin@omnibond.com \
    --cc=miklos@szeredi.hu \
    --cc=netdev@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=sage@redhat.com \
    --cc=samba-technical@lists.samba.org \
    --cc=shaggy@kernel.org \
    --cc=tyhicks@canonical.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox