Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 53FFF29E0F for ; Fri, 10 May 2013 16:22:09 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 41B1B8F8039 for ; Fri, 10 May 2013 14:22:09 -0700 (PDT) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by cuda.sgi.com with ESMTP id GSTvNylsiuUSQLf0 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 10 May 2013 14:22:08 -0700 (PDT) Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 May 2013 15:22:06 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 61B3F3E40030 for ; Fri, 10 May 2013 15:21:29 -0600 (MDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4ALLih4125748 for ; Fri, 10 May 2013 15:21:44 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4ALLinK019694 for ; Fri, 10 May 2013 15:21:44 -0600 From: Chandra Seetharaman Subject: [PATCH v8 5/5] xfs: Use new qs_pquota field in fs_quota_stat for Q_XGETQSTAT Date: Fri, 10 May 2013 16:21:29 -0500 Message-Id: <1368220889-25188-6-git-send-email-sekharan@us.ibm.com> In-Reply-To: <1368220889-25188-1-git-send-email-sekharan@us.ibm.com> References: <1368220889-25188-1-git-send-email-sekharan@us.ibm.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com Cc: Chandra Seetharaman 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 --- 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. + */ + out->qs_gquota.qfs_ino = mp->m_sb.sb_pquotino; + out->qs_gquota.qfs_nblks = pip->i_d.di_nblocks; + out->qs_gquota.qfs_nextents = pip->i_d.di_nextents; + } if (temppqip) IRELE(pip); } -- 1.7.1 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs