linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Gao Xiang <hsiangkao@redhat.com>,
	linux-xfs@vger.kernel.org, Dave Chinner <david@fromorbit.com>,
	Eric Sandeen <sandeen@sandeen.net>,
	Dave Chinner <dchinner@redhat.com>
Subject: Re: [PATCH v3 3/6] xfs: move on-disk inode allocation out of xfs_ialloc()
Date: Mon, 7 Dec 2020 08:59:08 -0800	[thread overview]
Message-ID: <20201207165908.GN629293@magnolia> (raw)
In-Reply-To: <20201207134941.GD29249@lst.de>

On Mon, Dec 07, 2020 at 02:49:41PM +0100, Christoph Hellwig wrote:
> On Mon, Dec 07, 2020 at 08:15:30AM +0800, Gao Xiang wrote:
> >  /*
> > + * Initialise a newly allocated inode and return the in-core inode to the
> > + * caller locked exclusively.
> >   */
> > -static int
> > -xfs_ialloc(
> > -	xfs_trans_t	*tp,
> > -	xfs_inode_t	*pip,
> > -	umode_t		mode,
> > -	xfs_nlink_t	nlink,
> > -	dev_t		rdev,
> > -	prid_t		prid,
> > -	xfs_buf_t	**ialloc_context,
> > -	xfs_inode_t	**ipp)
> > +static struct xfs_inode *
> > +xfs_dir_ialloc_init(
> 
> This is boderline bikeshedding, but I would just call this
> xfs_init_new_inode.
> 
> >  int
> >  xfs_dir_ialloc(
> > @@ -954,83 +908,59 @@ xfs_dir_ialloc(
> >  	xfs_inode_t	**ipp)		/* pointer to inode; it will be
> >  					   locked. */
> >  {
> >  	xfs_inode_t	*ip;
> >  	xfs_buf_t	*ialloc_context = NULL;
> > +	xfs_ino_t	pino = dp ? dp->i_ino : 0;
> 
> Maybe spell out parent_inode?  pino reminds of some of the weird Windows
> code that start all variable names for pointers with a "p".
> 
> > +	/* Initialise the newly allocated inode. */
> > +	ip = xfs_dir_ialloc_init(*tpp, dp, ino, mode, nlink, rdev, prid);
> > +	if (IS_ERR(ip))
> > +		return PTR_ERR(ip);
> > +	*ipp = ip;
> >  	return 0;
> 
> I wonder if we should just return the inode by reference from
> xfs_dir_ialloc_init as well, as that nicely fits the calling convention
> in the caller, i.e. this could become
> 
> 	return xfs_init_new_inode(*tpp, dp, ino, mode, nlink, rdev, prid, ipp);
> 
> Note with the right naming we don't really need the comment either,
> as the function name should explain everything.

/me notes that some day he will get around to a formal posting of his
giant inode allocation cleanup series that will wrap these parameters
into a struct so we don't have to pass 8 arguments around, and fix the
inode flag inheritance inconsistencies between userspace and kernel...

--D

  parent reply	other threads:[~2020-12-07 17:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07  0:15 [PATCH v3 0/6] xfs: some xfs_dialloc() cleanup Gao Xiang
2020-12-07  0:15 ` [PATCH v3 1/6] xfs: convert noroom, okalloc in xfs_dialloc() to bool Gao Xiang
2020-12-07  0:15 ` [PATCH v3 2/6] xfs: introduce xfs_dialloc_roll() Gao Xiang
2020-12-07 13:43   ` Christoph Hellwig
2020-12-07 14:11     ` Gao Xiang
2020-12-07  0:15 ` [PATCH v3 3/6] xfs: move on-disk inode allocation out of xfs_ialloc() Gao Xiang
2020-12-07 13:49   ` Christoph Hellwig
2020-12-07 14:19     ` Gao Xiang
2020-12-07 14:21       ` Christoph Hellwig
2020-12-07 20:19       ` Dave Chinner
2020-12-07 16:59     ` Darrick J. Wong [this message]
2020-12-07  0:15 ` [PATCH v3 4/6] xfs: move xfs_dialloc_roll() into xfs_dialloc() Gao Xiang
2020-12-07 13:53   ` Christoph Hellwig
2020-12-07 14:20     ` Gao Xiang
2020-12-07  0:15 ` [PATCH v3 5/6] xfs: spilt xfs_dialloc() into 2 functions Gao Xiang
2020-12-07 13:56   ` Christoph Hellwig
2020-12-07 14:33     ` Gao Xiang
2020-12-07 16:38       ` Christoph Hellwig
2020-12-07  0:15 ` [PATCH v3 6/6] xfs: kill ialloced in xfs_dialloc() Gao Xiang
2020-12-07 13:57   ` Christoph Hellwig
2020-12-07 14:24     ` Gao Xiang
2020-12-07 20:23       ` Dave Chinner
2020-12-07 22:03         ` Gao Xiang

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=20201207165908.GN629293@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=dchinner@redhat.com \
    --cc=hch@lst.de \
    --cc=hsiangkao@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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;
as well as URLs for NNTP newsgroup(s).