linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chandra Seetharaman <sekharan@us.ibm.com>
To: xfs@oss.sgi.com
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Steven Whitehouse <swhiteho@redhat.com>, Jan Kara <jack@suse.cz>,
	Chandra Seetharaman <sekharan@us.ibm.com>,
	Abhijith Das <adas@redhat.com>
Subject: [PATCH 3/3] gfs2: Add support for the Q_XGETQSTATV
Date: Tue,  6 Aug 2013 17:27:09 -0500	[thread overview]
Message-ID: <1375828029-26360-4-git-send-email-sekharan@us.ibm.com> (raw)
In-Reply-To: <1375828029-26360-1-git-send-email-sekharan@us.ibm.com>

For gfs2, add support for Q_XGETQSTATV quotactl command.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>

---
 fs/gfs2/quota.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 3768c2f..57f246d 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -1462,6 +1462,32 @@ static int gfs2_quota_get_xstate(struct super_block *sb,
 	return 0;
 }
 
+static int gfs2_quota_get_xstatev(struct super_block *sb,
+				 struct fs_quota_statv *fqs)
+{
+	struct gfs2_sbd *sdp = sb->s_fs_info;
+
+	switch (sdp->sd_args.ar_quota) {
+	case GFS2_QUOTA_ON:
+		fqs->qs_flags |= (FS_QUOTA_UDQ_ENFD | FS_QUOTA_GDQ_ENFD);
+		/*FALLTHRU*/
+	case GFS2_QUOTA_ACCOUNT:
+		fqs->qs_flags |= (FS_QUOTA_UDQ_ACCT | FS_QUOTA_GDQ_ACCT);
+		break;
+	case GFS2_QUOTA_OFF:
+		break;
+	}
+
+	if (sdp->sd_quota_inode) {
+		fqs->qs_uquota.qfs_ino = GFS2_I(sdp->sd_quota_inode)->i_no_addr;
+		fqs->qs_uquota.qfs_nblks = sdp->sd_quota_inode->i_blocks;
+	}
+	fqs->qs_uquota.qfs_nextents = 1; /* unsupported */
+	fqs->qs_gquota = fqs->qs_uquota; /* its the same inode in both cases */
+	fqs->qs_incoredqs = atomic_read(&qd_lru_count);
+	return 0;
+}
+
 static int gfs2_get_dqblk(struct super_block *sb, struct kqid qid,
 			  struct fs_disk_quota *fdq)
 {
@@ -1604,6 +1630,7 @@ out_put:
 
 const struct quotactl_ops gfs2_quotactl_ops = {
 	.quota_sync     = gfs2_quota_sync,
+	.get_xstatev    = gfs2_quota_get_xstatev,
 	.get_xstate     = gfs2_quota_get_xstate,
 	.get_dqblk	= gfs2_get_dqblk,
 	.set_dqblk	= gfs2_set_dqblk,
-- 
1.7.1

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

  parent reply	other threads:[~2013-08-06 22:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-06 22:27 [PATCH 0/3] Add a new quotactl command to support 3 quota types in XFS Chandra Seetharaman
2013-08-06 22:27 ` [PATCH 1/3] quota: Add a new quotactl command Q_XGETQSTATV Chandra Seetharaman
2013-08-13 20:42   ` Rich Johnston
2013-08-13 20:50     ` Chandra Seetharaman
2013-08-13 21:22     ` Jan Kara
2013-08-13 22:22       ` Rich Johnston
2013-08-13 22:39       ` Chandra Seetharaman
2013-08-14  9:31         ` Jan Kara
2013-08-21  6:43   ` Christoph Hellwig
2013-08-21 13:01     ` Jan Kara
2013-08-21 18:12       ` Ben Myers
2013-08-21 18:19         ` Christoph Hellwig
2013-08-21 21:15           ` Chandra Seetharaman
2013-08-29 17:00             ` Chandra Seetharaman
2013-08-29 17:48               ` Ben Myers
2013-08-06 22:27 ` [PATCH 2/3] xfs: Add support for the Q_XGETQSTATV Chandra Seetharaman
2013-08-13 20:42   ` Rich Johnston
2013-08-06 22:27 ` Chandra Seetharaman [this message]
2013-08-13 20:42   ` [PATCH 3/3] gfs2: " Rich Johnston
2013-08-20 22:25 ` [PATCH 0/3] Add a new quotactl command to support 3 quota types in XFS Ben Myers
2013-08-21 12:28   ` Steven Whitehouse
2013-08-21 17:44     ` Ben Myers

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=1375828029-26360-4-git-send-email-sekharan@us.ibm.com \
    --to=sekharan@us.ibm.com \
    --cc=adas@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=swhiteho@redhat.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;
as well as URLs for NNTP newsgroup(s).