public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chandra Seetharaman <sekharan@us.ibm.com>
To: xfs@oss.sgi.com
Cc: Chandra Seetharaman <sekharan@us.ibm.com>
Subject: [PATCH 4/4] xfsprogs: Add support to mkfs to add pquotino by adding a new option.
Date: Fri, 20 Jul 2012 18:04:24 -0500	[thread overview]
Message-ID: <20120720230424.20689.59555.sendpatchset@chandra-lucid.austin.ibm.com> (raw)
In-Reply-To: <20120720230350.20689.40213.sendpatchset@chandra-lucid.austin.ibm.com>

Add support to mkfs to have a separate inode field for project quota.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---
 mkfs/xfs_mkfs.c |   22 +++++++++++++++++-----
 mkfs/xfs_mkfs.h |    3 ++-
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index f527f3d..872a304 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -90,6 +90,8 @@ char	*dopts[] = {
 	"projinherit",
 #define D_EXTSZINHERIT	14
 	"extszinherit",
+#define D_NO_OQUOTA	15
+	"seppquota",
 	NULL
 };
 
@@ -922,6 +924,7 @@ main(
 	libxfs_init_t		xi;
 	struct fs_topology	ft;
 	int			lazy_sb_counters;
+	int			seppquota;
 
 	progname = basename(argv[0]);
 	setlocale(LC_ALL, "");
@@ -930,6 +933,7 @@ main(
 
 	attrversion = 2;
 	projid32bit = 0;
+	seppquota = 1;
 	blflag = bsflag = slflag = ssflag = lslflag = lssflag = 0;
 	blocklog = blocksize = 0;
 	sectorlog = lsectorlog = XFS_MIN_SECTORSIZE_LOG;
@@ -1178,6 +1182,14 @@ main(
 					fsx.fsx_xflags |= \
 						XFS_DIFLAG_EXTSZINHERIT;
 					break;
+				case D_NO_OQUOTA:
+					if (!value)
+						value = "0";
+					c = atoi(value);
+					if (c < 0 || c > 1)
+						illegal(value, "d seppquota");
+					seppquota = c;
+					break;
 				default:
 					unknown('d', value);
 				}
@@ -2278,7 +2290,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
 	if (!qflag || Nflag) {
 		printf(_(
 		   "meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n"
-		   "         =%-22s sectsz=%-5u attr=%u, projid32bit=%u\n"
+		   "         =%-22s sectsz=%-5u attr=%u, projid32bit=%u, seppquota=%d\n"
 		   "data     =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
 		   "         =%-22s sunit=%-6u swidth=%u blks\n"
 		   "naming   =version %-14u bsize=%-6u ascii-ci=%d\n"
@@ -2286,7 +2298,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
 		   "         =%-22s sectsz=%-5u sunit=%d blks, lazy-count=%d\n"
 		   "realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n"),
 			dfile, isize, (long long)agcount, (long long)agsize,
-			"", sectorsize, attrversion, projid32bit,
+			"", sectorsize, attrversion, projid32bit, seppquota,
 			"", blocksize, (long long)dblocks, imaxpct,
 			"", dsunit, dswidth,
 			dirversion, dirblocksize, nci,
@@ -2330,7 +2342,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
 	sbp->sb_fdblocks = dblocks - agcount * XFS_PREALLOC_BLOCKS(mp) -
 		(loginternal ? logblocks : 0);
 	sbp->sb_frextents = 0;	/* will do a free later */
-	sbp->sb_uquotino = sbp->sb_gquotino = 0;
+	sbp->sb_uquotino = sbp->sb_gquotino = sbp->sb_pquotino = 0;
 	sbp->sb_qflags = 0;
 	sbp->sb_unit = dsunit;
 	sbp->sb_width = dswidth;
@@ -2353,7 +2365,7 @@ an AG size that is one stripe unit smaller, for example %llu.\n"),
 		sbp->sb_logsectsize = 0;
 	}
 	sbp->sb_features2 = XFS_SB_VERSION2_MKFS(lazy_sb_counters,
-					attrversion == 2, projid32bit == 1, 0);
+					attrversion == 2, projid32bit == 1, 0, seppquota);
 	sbp->sb_versionnum = XFS_SB_VERSION_MKFS(iaflag, dsunit != 0,
 					logversion == 2, attrversion == 1,
 					(sectorsize != BBSIZE ||
@@ -2821,7 +2833,7 @@ usage( void )
 /* blocksize */		[-b log=n|size=num]\n\
 /* data subvol */	[-d agcount=n,agsize=n,file,name=xxx,size=num,\n\
 			    (sunit=value,swidth=value|su=num,sw=num),\n\
-			    sectlog=n|sectsize=num\n\
+			    sectlog=n|sectsize=num,seppquota=0|1\n\
 /* inode size */	[-i log=n|perblock=n|size=num,maxpct=n,attr=0|1|2,\n\
 			    projid32bit=0|1]\n\
 /* log subvol */	[-l agnum=n,internal,size=num,logdev=xxx,version=n\n\
diff --git a/mkfs/xfs_mkfs.h b/mkfs/xfs_mkfs.h
index f25a7f3..d597bb3 100644
--- a/mkfs/xfs_mkfs.h
+++ b/mkfs/xfs_mkfs.h
@@ -36,11 +36,12 @@
 	        XFS_DFL_SB_VERSION_BITS |                               \
 	0 ) : XFS_SB_VERSION_1 )
 
-#define XFS_SB_VERSION2_MKFS(lazycount, attr2, projid32bit, parent) (\
+#define XFS_SB_VERSION2_MKFS(lazycount, attr2, projid32bit, parent, seppquota) (\
 	((lazycount) ? XFS_SB_VERSION2_LAZYSBCOUNTBIT : 0) |		\
 	((attr2) ? XFS_SB_VERSION2_ATTR2BIT : 0) |			\
 	((projid32bit) ? XFS_SB_VERSION2_PROJID32BIT : 0) |		\
 	((parent) ? XFS_SB_VERSION2_PARENTBIT : 0) |			\
+	((seppquota) ? XFS_SB_VERSION2_NO_OQUOTA : 0) |			\
 	0 )
 
 #define	XFS_DFL_BLOCKSIZE_LOG	12		/* 4096 byte blocks */
-- 
1.7.1

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

  parent reply	other threads:[~2012-07-20 23:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 23:03 [PATCH 0/4] xfsprogs: Allow pquota and gquota to be used together Chandra Seetharaman
2012-07-20 23:03 ` [PATCH 1/4] xfsprogs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD Chandra Seetharaman
2012-07-20 23:04 ` [PATCH 2/4] xfsprogs: Add new field pquotaino to on disk superblock Chandra Seetharaman
2012-07-20 23:04 ` [PATCH 3/4] xfsprogs: Add qs_pquota to the fs_quota Chandra Seetharaman
2012-07-20 23:04 ` Chandra Seetharaman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-01-23 17:32 [PATCH 0/4] xfsprogs: Allow pquota and gquota to be used together Chandra Seetharaman
2012-01-23 17:33 ` [PATCH 4/4] xfsprogs: Add support to mkfs to add pquotino by adding a new option Chandra Seetharaman
2012-05-04 16:47   ` 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=20120720230424.20689.59555.sendpatchset@chandra-lucid.austin.ibm.com \
    --to=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