public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Chandra Seetharaman <sekharan@us.ibm.com>, xfs@oss.sgi.com
Subject: Re: [PATCH v8 2/5] xfs: Add pquota fields where gquota is used.
Date: Fri, 17 May 2013 13:40:19 +0800	[thread overview]
Message-ID: <5195C2C3.3000603@oracle.com> (raw)
In-Reply-To: <20130517030125.GT29466@dastard>

On 05/17/2013 11:01 AM, Dave Chinner wrote:
> On Mon, May 13, 2013 at 11:59:36AM +0800, Jeff Liu wrote:
>> Hi,
>>
>>> +struct xfs_inode *
>>> +xfs_dq_to_quota_inode(struct xfs_dquot *dqp)
>>> +{
>>> +	if (XFS_QM_ISUDQ(dqp))
>>> +		return dqp->q_mount->m_quotainfo->qi_uquotaip;
>>> +	if (XFS_QM_ISGDQ(dqp))
>>> +		return dqp->q_mount->m_quotainfo->qi_gquotaip;
>>> +	ASSERT(XFS_QM_ISPDQ(dqp));
>>> +	return dqp->q_mount->m_quotainfo->qi_pquotaip;
>>> +}
>> Is it better to replace above conditional judgment with 'switch...case'?
>> i.e.
>> static inline struct xfs_inode *
>> xfs_dq_to_qip(struct xfs_dquot *dqp)
>> {
>> 	switch (dqp->dq_flags) {
>> 	case XFS_DQ_USER:
>> 		return dqp->q_mount->m_quotainfo->qi_uquotaip;
>> 	case XFS_DQ_GROUP:
>> 		return dqp->q_mount->m_quotainfo->qi_gqoutaip;
>> 	case XFS_DQ_PROJ:
>> 		return dqp->q_mount->m_quotainfo->qi_pquotaip;
>> 	}
> 
> Doesn't work because dq_flags can have other fields set in it (e.g
> XFS_DQ_DIRTY). It would need to be:
> 
> 	switch (dqp->dq_flags & XFS_DQ_ALLTYPES) {
> 	....
> 	}
Ah, yep. thanks for the teaching. :)

Thanks,
-Jeff

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

  reply	other threads:[~2013-05-17  5:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 21:21 [PATCH v8 0/5] xfs: Allow pquota and gquota to be used together Chandra Seetharaman
2013-05-10 21:21 ` [PATCH v8 1/5] xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD Chandra Seetharaman
2013-05-13  3:15   ` Jeff Liu
2013-05-14 22:19     ` Chandra Seetharaman
2013-05-17  2:55   ` Dave Chinner
2013-05-24 21:45     ` Chandra Seetharaman
2013-05-10 21:21 ` [PATCH v8 2/5] xfs: Add pquota fields where gquota is used Chandra Seetharaman
2013-05-13  3:59   ` Jeff Liu
2013-05-17  3:01     ` Dave Chinner
2013-05-17  5:40       ` Jeff Liu [this message]
2013-05-17 21:15     ` Chandra Seetharaman
2013-05-17  4:23   ` Dave Chinner
2013-05-24 21:57     ` Chandra Seetharaman
2013-06-10 23:17       ` Dave Chinner
2013-06-11 23:08         ` Chandra Seetharaman
2013-05-10 21:21 ` [PATCH v8 3/5] xfs: Start using pquotaino from the superblock Chandra Seetharaman
2013-05-13  4:24   ` Jeff Liu
2013-05-17  4:46   ` Dave Chinner
2013-05-24 22:09     ` Chandra Seetharaman
2013-06-10 23:20       ` Dave Chinner
2013-05-10 21:21 ` [PATCH v8 4/5] xfs: Add proper versioning support to fs_quota_stat Chandra Seetharaman
2013-05-13  4:29   ` Jeff Liu
2013-05-17  5:10   ` Dave Chinner
2013-05-24 22:17     ` Chandra Seetharaman
2013-06-10 23:27       ` Dave Chinner
2013-06-11 23:13         ` Chandra Seetharaman
2013-05-10 21:21 ` [PATCH v8 5/5] xfs: Use new qs_pquota field in fs_quota_stat for Q_XGETQSTAT Chandra Seetharaman
2013-05-17  5:14   ` Dave Chinner
2013-05-24 22:17     ` Chandra Seetharaman

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=5195C2C3.3000603@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=david@fromorbit.com \
    --cc=sekharan@us.ibm.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