From: Dave Chinner <david@fromorbit.com>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v8 5/5] xfs: Use new qs_pquota field in fs_quota_stat for Q_XGETQSTAT
Date: Fri, 17 May 2013 15:14:41 +1000 [thread overview]
Message-ID: <20130517051441.GQ24635@dastard> (raw)
In-Reply-To: <1368220889-25188-6-git-send-email-sekharan@us.ibm.com>
On Fri, May 10, 2013 at 04:21:29PM -0500, Chandra Seetharaman wrote:
> For the Q_XGETQSTAT quota command, if the new version of fs_quota_stat
> data structure is used, fill the project quota information.
>
> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
> ---
> fs/xfs/xfs_qm_syscalls.c | 39 +++++++++++++++++++++++++--------------
> 1 files changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
> index c27b0e4..7c5876b 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -420,20 +420,14 @@ xfs_qm_scall_getqstat(
> bool tempgqip = false;
> bool temppqip = false;
>
> - if (!xfs_sb_version_hasquota(&mp->m_sb)) {
> - out->qs_uquota.qfs_ino = NULLFSINO;
> - out->qs_gquota.qfs_ino = NULLFSINO;
> - out->qs_pquota.qfs_ino = NULLFSINO;
> + out->qs_uquota.qfs_ino = NULLFSINO;
> + out->qs_gquota.qfs_ino = NULLFSINO;
> + out->qs_pquota.qfs_ino = NULLFSINO;
> +
> + if (!xfs_sb_version_hasquota(&mp->m_sb))
> return (0);
> - }
> out->qs_flags = (__uint16_t) xfs_qm_export_flags(mp->m_qflags &
> - (XFS_ALL_QUOTA_ACCT|
> - XFS_ALL_QUOTA_ENFD));
> - out->qs_uquota.qfs_ino = mp->m_sb.sb_uquotino;
> - out->qs_gquota.qfs_ino = mp->m_sb.sb_gquotino;
> - if (&out->qs_gquota != &out->qs_pquota)
> - out->qs_pquota.qfs_ino = mp->m_sb.sb_pquotino;
> -
> + (XFS_ALL_QUOTA_ACCT| XFS_ALL_QUOTA_ENFD));
> if (q) {
> uip = q->qi_uquotaip;
> gip = q->qi_gquotaip;
> @@ -454,21 +448,38 @@ xfs_qm_scall_getqstat(
> 0, 0, &pip) == 0)
> temppqip = true;
> }
> +
> if (uip) {
> + out->qs_uquota.qfs_ino = mp->m_sb.sb_uquotino;
> out->qs_uquota.qfs_nblks = uip->i_d.di_nblocks;
> out->qs_uquota.qfs_nextents = uip->i_d.di_nextents;
> if (tempuqip)
> IRELE(uip);
> }
> if (gip) {
> + out->qs_gquota.qfs_ino = mp->m_sb.sb_gquotino;
> out->qs_gquota.qfs_nblks = gip->i_d.di_nblocks;
> out->qs_gquota.qfs_nextents = gip->i_d.di_nextents;
> if (tempgqip)
> IRELE(gip);
> }
> if (pip) {
> - out->qs_pquota.qfs_nblks = pip->i_d.di_nblocks;
> - out->qs_pquota.qfs_nextents = pip->i_d.di_nextents;
> + if (out->qs_version >= FS_QSTAT_VERSION_2) {
> + out->qs_pquota.qfs_ino = mp->m_sb.sb_pquotino;
> + out->qs_pquota.qfs_nblks = pip->i_d.di_nblocks;
> + out->qs_pquota.qfs_nextents = pip->i_d.di_nextents;
> + } else {
> + /*
> + * In FS_QSTAT_VERSION version, there is no
> + * qs_pquota, and there is no combined support
> + * for gquota/pquota. qs_gquota is shared for
> + * providing the pquota/gquota information to
> + * the user space.
> + */
Move that comment to the head of the function. i.e.:
/*
* We support two different versions of the fs_quota_stat structure
* here. If the version is FS_QSTAT_VERSION, then there is no
* separate project quota fields, and so we write project quota
* information into the group quota fields. With FS_QSTAT_VERSION_2,
* there is a separate project quota field so we can use that
* instead to pass both group and project quota back to user space
* in the one call.
*/
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-05-17 5:15 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
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 [this message]
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=20130517051441.GQ24635@dastard \
--to=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