public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jeff Liu <jeff.liu@oracle.com>
Cc: Christoph Hellwig <hch@infradead.org>, Ben Myers <bpm@sgi.com>,
	Chandra Seetharaman <sekharan@us.ibm.com>,
	Mark Tinguely <tinguely@sgi.com>,
	xfs@oss.sgi.com
Subject: Re: [PATCH 2/4] xfs: Add pquota fields where gquota is used
Date: Tue, 17 Jul 2012 03:36:45 -0400	[thread overview]
Message-ID: <20120717073645.GB24395@infradead.org> (raw)
In-Reply-To: <4FFFDDE5.8010403@oracle.com>

>  		if (error) {
>  			if (uip)
>  				IRELE(uip);
> @@ -1421,9 +1474,24 @@ xfs_qm_init_quotainos(
>  			return XFS_ERROR(error);
>  		}
>  	}
> +	/* Why not define a XFS_SB_PQUOTINO? */
> +	if (XFS_IS_PQUOTA_ON(mp) && pip == NULL) {
> +		error = xfs_qm_qino_alloc(mp, &pip,
> +					  sbflags | XFS_SB_GQUOTINO,
> +					  flags | XFS_QMOPT_PQUOTA);
> +		if (error) {
> +			if (uip)
> +				IRELE(uip);
> +			if (gip)
> +				IRELE(gip);
> +
> +			return XFS_ERROR(error);

It would probably be good to have return labels here so that each
IRELE statements only needs to be written once, e.g.

out_rele_uip:
	if (uip)
		IRELE(uip);
out_rele_gip:
	if (gip)
		IRELE(gip);
out:
	return XFS_ERROR(error);

> +			if ((error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)uid,
> +						  XFS_DQ_USER,
> +						  XFS_QMOPT_DQALLOC |
> +						  XFS_QMOPT_DOWARN, &uq))) {

Please move assignments out of conditionals for all code touched, e.g.:

			error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)uid,
					     XFS_DQ_USER,
					     XFS_QMOPT_DQALLOC |
					     XFS_QMOPT_DOWARN, &uq);
			if (error) {

Otherwise this looks good to me.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2012-07-17  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13  8:35 [PATCH 2/4] xfs: Add pquota fields where gquota is used Jeff Liu
2012-07-17  7:36 ` Christoph Hellwig [this message]
2012-07-17 12:47   ` Jeff Liu

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=20120717073645.GB24395@infradead.org \
    --to=hch@infradead.org \
    --cc=bpm@sgi.com \
    --cc=jeff.liu@oracle.com \
    --cc=sekharan@us.ibm.com \
    --cc=tinguely@sgi.com \
    --cc=xfs@oss.sgi.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