# This file is used by configure to get version information
#
PKG_MAJOR=1
-PKG_MINOR=1
-PKG_REVISION=9
+PKG_MINOR=2
+PKG_REVISION=0
PKG_BUILD=0
static inodata_t ***inomap;
static int nflag;
static int pflag;
-static qdata_t **qpdata;
-static int qpdo;
+static qdata_t **qgdata;
+static int qgdo;
static qdata_t **qudata;
static int qudo;
static unsigned sbversion;
freetab_t *freetab);
static xfs_ino_t process_node_dir_v1(blkmap_t *blkmap, int *dot,
int *dotdot, inodata_t *id);
-static void process_quota(int isproj, inodata_t *id,
+static void process_quota(int isgrp, inodata_t *id,
blkmap_t *blkmap);
static void process_rtbitmap(blkmap_t *blkmap);
static void process_rtsummary(blkmap_t *blkmap);
int *dotdot, inodata_t *id);
static xfs_ino_t process_shortform_dir_v1(xfs_dinode_t *dip, int *dot,
int *dotdot, inodata_t *id);
-static void quota_add(xfs_dqid_t projid, xfs_dqid_t userid,
+static void quota_add(xfs_dqid_t grpid, xfs_dqid_t usrid,
int dq, xfs_qcnt_t bc, xfs_qcnt_t ic,
xfs_qcnt_t rc);
static void quota_add1(qdata_t **qt, xfs_dqid_t id, int dq,
}
if (qudo)
quota_check("user", qudata);
- if (qpdo)
- quota_check("project", qpdata);
+ if (qgdo)
+ quota_check("group", qgdata);
if (sbver_err > mp->m_sb.sb_agcount / 2)
dbprintf("WARNING: this may be a newer XFS filesystem.\n");
if (error)
if (mp->m_sb.sb_inoalignmt)
sbversion |= XFS_SB_VERSION_ALIGNBIT;
if ((mp->m_sb.sb_uquotino && mp->m_sb.sb_uquotino != NULLFSINO) ||
- (mp->m_sb.sb_pquotino && mp->m_sb.sb_pquotino != NULLFSINO))
+ (mp->m_sb.sb_gquotino && mp->m_sb.sb_gquotino != NULLFSINO))
sbversion |= XFS_SB_VERSION_QUOTABIT;
quota_init();
return 1;
addlink_inode(id);
}
else if (id->ino == mp->m_sb.sb_uquotino ||
- id->ino == mp->m_sb.sb_pquotino) {
+ id->ino == mp->m_sb.sb_gquotino) {
type = DBM_QUOTA;
blkmap = blkmap_alloc(dic->di_nextents);
addlink_inode(id);
break;
}
}
- if (qpdo || qudo) {
+ if (qgdo || qudo) {
switch (type) {
case DBM_DATA:
case DBM_DIR:
* If the CHKD flag is not set, this can legitimately contain garbage;
* xfs_repair may have cleared that bit.
*/
- else if (type == DBM_QUOTA && (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD))
- process_quota(id->ino == mp->m_sb.sb_pquotino, id, blkmap);
+ else if (type == DBM_QUOTA) {
+ if (id->ino == mp->m_sb.sb_uquotino &&
+ (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) &&
+ (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD))
+ process_quota(0, id, blkmap);
+ else if (id->ino == mp->m_sb.sb_gquotino &&
+ (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) &&
+ (mp->m_sb.sb_qflags & XFS_GQUOTA_CHKD))
+ process_quota(1, id, blkmap);
+ }
if (blkmap)
blkmap_free(blkmap);
}
static void
process_quota(
- int isproj,
+ int isgrp,
inodata_t *id,
blkmap_t *blkmap)
{
int t;
perblock = (int)(mp->m_sb.sb_blocksize / sizeof(*dqb));
- s = isproj ? "project" : "user";
- exp_flags = isproj ? XFS_DQ_PROJ : XFS_DQ_USER;
+ s = isgrp ? "group" : "user";
+ exp_flags = isgrp ? XFS_DQ_GROUP : XFS_DQ_USER;
dqid = 0;
qbno = NULLFILEOFF;
while ((qbno = blkmap_next_off(blkmap, qbno, &t)) !=
error++;
continue;
}
- quota_add(isproj ? dqid : -1, isproj ? -1 : dqid, 1,
+ quota_add(isgrp ? dqid : -1, isgrp ? -1 : dqid, 1,
INT_GET(dqb->dd_diskdq.d_bcount, ARCH_CONVERT),
INT_GET(dqb->dd_diskdq.d_icount, ARCH_CONVERT),
INT_GET(dqb->dd_diskdq.d_rtbcount, ARCH_CONVERT));
static void
quota_add(
- xfs_dqid_t projid,
- xfs_dqid_t userid,
+ xfs_dqid_t grpid,
+ xfs_dqid_t usrid,
int dq,
xfs_qcnt_t bc,
xfs_qcnt_t ic,
xfs_qcnt_t rc)
{
- if (qudo && userid != -1)
- quota_add1(qudata, userid, dq, bc, ic, rc);
- if (qpdo && projid != -1)
- quota_add1(qpdata, projid, dq, bc, ic, rc);
+ if (qudo && usrid != -1)
+ quota_add1(qudata, usrid, dq, bc, ic, rc);
+ if (qgdo && grpid != -1)
+ quota_add1(qgdata, grpid, dq, bc, ic, rc);
}
static void
{
qudo = mp->m_sb.sb_uquotino != 0 &&
mp->m_sb.sb_uquotino != NULLFSINO &&
+ (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) &&
(mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD);
- qpdo = mp->m_sb.sb_pquotino != 0 &&
- mp->m_sb.sb_pquotino != NULLFSINO &&
- (mp->m_sb.sb_qflags & XFS_PQUOTA_CHKD);
+ qgdo = mp->m_sb.sb_gquotino != 0 &&
+ mp->m_sb.sb_gquotino != NULLFSINO &&
+ (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) &&
+ (mp->m_sb.sb_qflags & XFS_GQUOTA_CHKD);
if (qudo)
qudata = xcalloc(QDATA_HASH_SIZE, sizeof(qdata_t *));
- if (qpdo)
- qpdata = xcalloc(QDATA_HASH_SIZE, sizeof(qdata_t *));
+ if (qgdo)
+ qgdata = xcalloc(QDATA_HASH_SIZE, sizeof(qdata_t *));
}
static void
static void dquot_help(void);
static const cmdinfo_t dquot_cmd =
- { "dquot", NULL, dquot_f, 1, 2, 1, "[project|user id]",
- "set current address to project or user quota block", dquot_help };
+ { "dquot", NULL, dquot_f, 1, 2, 1, "[gid|uid]",
+ "set current address to group or user quota block", dquot_help };
const field_t dqblk_hfld[] = {
{ "", FLDT_DQBLK, OI(0), C1, 0, TYP_NONE },
{
bmap_ext_t bm;
int c;
- int doproj;
+ int dogrp;
xfs_dqid_t id;
xfs_ino_t ino;
int nex;
int qoff;
char *s;
- doproj = optind = 0;
- while ((c = getopt(argc, argv, "pu")) != EOF) {
+ dogrp = optind = 0;
+ while ((c = getopt(argc, argv, "gu")) != EOF) {
switch (c) {
- case 'p':
- doproj = 1;
+ case 'g':
+ dogrp = 1;
break;
case 'u':
- doproj = 0;
+ dogrp = 0;
break;
default:
dbprintf("bad option for dquot command\n");
return 0;
}
}
- s = doproj ? "project" : "user";
+ s = dogrp ? "group" : "user";
if (optind != argc - 1) {
dbprintf("dquot command requires one %s id argument\n", s);
return 0;
}
- ino = doproj ? mp->m_sb.sb_pquotino : mp->m_sb.sb_uquotino;
+ ino = dogrp ? mp->m_sb.sb_gquotino : mp->m_sb.sb_uquotino;
if (ino == 0 || ino == NULLFSINO) {
dbprintf("no %s quota inode present\n", s);
return 0;
skipd = 1;
else if (!qflag &&
(ino == mp->m_sb.sb_uquotino ||
- ino == mp->m_sb.sb_pquotino))
+ ino == mp->m_sb.sb_gquotino))
skipd = 1;
else
skipd = !fflag;
else if (iocur_top->ino == mp->m_sb.sb_rsumino)
return TYP_RTSUMMARY;
else if (iocur_top->ino == mp->m_sb.sb_uquotino ||
- iocur_top->ino == mp->m_sb.sb_pquotino)
+ iocur_top->ino == mp->m_sb.sb_gquotino)
return TYP_DQBLK;
else
return TYP_DATA;
{ "fdblocks", FLDT_UINT64D, OI(OFF(fdblocks)), C1, 0, TYP_NONE },
{ "frextents", FLDT_UINT64D, OI(OFF(frextents)), C1, 0, TYP_NONE },
{ "uquotino", FLDT_INO, OI(OFF(uquotino)), C1, 0, TYP_INODE },
- { "pquotino", FLDT_INO, OI(OFF(pquotino)), C1, 0, TYP_INODE },
+ { "gquotino", FLDT_INO, OI(OFF(gquotino)), C1, 0, TYP_INODE },
{ "qflags", FLDT_UINT16X, OI(OFF(qflags)), C1, 0, TYP_NONE },
{ "flags", FLDT_UINT8X, OI(OFF(flags)), C1, 0, TYP_NONE },
{ "shared_vn", FLDT_UINT8D, OI(OFF(shared_vn)), C1, 0, TYP_NONE },
+xfsprogs (1.2.0) unstable; urgency=low
+
+ * Support for group quota added
+ * Stripe unit/stripe width extraction for MD devices
+ * Added mkfs.xfs heuristics for size of internal log
+
+ -- Nathan Scott <nathans@debian.org> Sun, 1 Apr 2001 16:49:26 +1000
+
xfsprogs (1.1.6) unstable; urgency=low
* Fix sparc build failure - fcntl.h missing O_DIRECT (closes: #90211)
+xfsprogs-1.2.0 (1 April 2001)
+ - support for group quota added
+ - some headers updated, in particular <xqm.h>
+ - now in late stages of beta
+
xfsprogs-1.1.9 (26 March 2001)
- - Added automagic stripe unit/stripe width extraction for MD devices
+ - added automagic stripe unit/stripe width extraction for MD devices
xfsprogs-1.1.8 (23 March 2001)
- mkfs heuristics to make a qualified guess of internal logsize
CAVEATS
-Group quota are not implemented in the first Linux/XFS release, but are
-pencilled in for the next release.
-
The XFS allocation mechanism will always reserve the maximum amount of
space required before proceeding with a space allocation. If insufficient
space for this reservation is available, due to the users block quota limit
filesystem-sized blocks.
On IRIX, XFS supports project quota. This is not (ever) likely to be
-supported on Linux/XFS, as the concept of a project is peculiar to IRIX.
+supported on Linux/XFS, as the concept of a project is specific to IRIX.
A filesystem that has used user quota on IRIX, however, can be migrated
to Linux, and vice-versa, as the ondisk format is shared between both
versions of XFS (and Linux/XFS is "endian clean").
#define XFS_BLI_CANCEL 0x2
/*
* This flag indicates that the buffer contains on disk
- * user or projectdquots and may require special recovery handling.
+ * user or group dquots and may require special recovery handling.
*/
#define XFS_BLI_UDQUOT_BUF 0x4
-#define XFS_BLI_PDQUOT_BUF 0x8
+/* #define XFS_BLI_PDQUOT_BUF 0x8 */
+#define XFS_BLI_GDQUOT_BUF 0x10
#define XFS_BLI_CHUNK 128
#define XFS_BLI_SHIFT 7
typedef struct xfs_disk_dquot {
/*16*/ u_int16_t d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
/*8 */ u_int8_t d_version; /* dquot version */
-/*8 */ u_int8_t d_flags; /* XFS_DQ_USER/DQ_PROJ */
-/*32*/ xfs_dqid_t d_id; /* user id or proj id */
+/*8 */ u_int8_t d_flags; /* XFS_DQ_USER/PROJ/GROUP */
+/*32*/ xfs_dqid_t d_id; /* user,project,group id */
/*64*/ xfs_qcnt_t d_blk_hardlimit;/* absolute limit on disk blks */
/*64*/ xfs_qcnt_t d_blk_softlimit;/* preferred limit on disk blks */
/*64*/ xfs_qcnt_t d_ino_hardlimit;/* maximum # allocated inodes */
* flags for q_flags field in the dquot.
*/
#define XFS_DQ_USER 0x0001 /* a user quota */
-#define XFS_DQ_PROJ 0x0002 /* a project quota */
-
+/* #define XFS_DQ_PROJ 0x0002 -- project quota (IRIX) */
+#define XFS_DQ_GROUP 0x0004 /* a group quota */
#define XFS_DQ_FLOCKED 0x0008 /* flush lock taken */
#define XFS_DQ_DIRTY 0x0010 /* dquot is dirty */
#define XFS_DQ_WANT 0x0020 /* for lookup/reclaim race */
#define XFS_DQ_MARKER 0x0080 /* sentinel */
/*
- * In the worst case, when both user and proj quotas on,
+ * In the worst case, when both user and group quotas are on,
* we can have a max of three dquots changing in a single transaction.
*/
#define XFS_DQUOT_LOGRES(mp) (sizeof(xfs_disk_dquot_t) * 3)
typedef struct xfs_dq_logformat {
__uint16_t qlf_type; /* dquot log item type */
__uint16_t qlf_size; /* size of this item */
- xfs_dqid_t qlf_id; /* usr/proj id number : 32 bits */
+ xfs_dqid_t qlf_id; /* usr/grp id number : 32 bits */
__int64_t qlf_blkno; /* blkno of dquot buffer */
__int32_t qlf_len; /* len of dquot buffer */
__uint32_t qlf_boffset; /* off of dquot in buffer */
typedef struct xfs_qoff_logformat {
unsigned short qf_type; /* quotaoff log item type */
unsigned short qf_size; /* size of this item */
- unsigned int qf_flags; /* USR and/or PRJ */
+ unsigned int qf_flags; /* USR and/or GRP */
char qf_pad[12]; /* padding for future */
} xfs_qoff_logformat_t;
struct pm *xd_pmp;
int xd_blkalgn;
int xd_ioflag;
- xfs_off_t xd_start;
+ xfs_off_t xd_start;
size_t xd_length;
} xfs_dio_t;
struct xfs_mount *i_mount; /* fs mount struct ptr */
struct bhv_desc i_bhv_desc; /* inode behavior descriptor*/
struct xfs_dquot *i_udquot; /* user dquot */
- struct xfs_dquot *i_pdquot; /* project dquot */
+ struct xfs_dquot *i_gdquot; /* group dquot */
/* Inode location stuff */
xfs_ino_t i_ino; /* inode number (agno/agino)*/
#define __XFS_QUOTA_H__
/*
- * We use only 16-bit prid's in the inode, not the 64-bit version in the proc.
- * uid_t is hard-coded to 32 bits in the inode. Hence, an 'id' in a dquot is
- * 32 bits..
+ * uid_t and gid_t are hard-coded to 32 bits in the inode.
+ * Hence, an 'id' in a dquot is 32 bits..
*/
typedef __int32_t xfs_dqid_t;
+
/*
* Eventhough users may not have quota limits occupying all 64-bits,
* they may need 64-bit accounting. Hence, 64-bit quota-counters,
- * and quota-limits. This is a waste in the common case, but heh ...
+ * and quota-limits. This is a waste in the common case, but hey ...
*/
typedef __uint64_t xfs_qcnt_t;
typedef __uint16_t xfs_qwarncnt_t;
#define XFS_UQUOTA_ACCT 0x0001 /* user quota accounting ON */
#define XFS_UQUOTA_ENFD 0x0002 /* user quota limits enforced */
#define XFS_UQUOTA_CHKD 0x0004 /* quotacheck run on usr quotas */
-#define XFS_PQUOTA_ACCT 0x0008 /* project quota accounting ON */
-#define XFS_PQUOTA_ENFD 0x0010 /* proj quota limits enforced */
-#define XFS_PQUOTA_CHKD 0x0020 /* quotacheck run on prj quotas */
+#define XFS_PQUOTA_ACCT 0x0008 /* (IRIX) project quota accounting ON */
+#define XFS_GQUOTA_ENFD 0x0010 /* group quota limits enforced */
+#define XFS_GQUOTA_CHKD 0x0020 /* quotacheck run on grp quotas */
+#define XFS_GQUOTA_ACCT 0x0040 /* group quota accounting ON */
/*
* Incore only flags for quotaoff - these bits get cleared when quota(s)
* are in the process of getting turned off. These flags are in m_qflags but
* never in sb_qflags.
*/
-#define XFS_UQUOTA_ACTIVE 0x0040 /* uquotas are being turned off */
-#define XFS_PQUOTA_ACTIVE 0x0080 /* pquotas are being turned off */
+#define XFS_UQUOTA_ACTIVE 0x0080 /* uquotas are being turned off */
+#define XFS_GQUOTA_ACTIVE 0x0100 /* gquotas are being turned off */
/*
* Typically, we turn quotas off if we weren't explicitly asked to
* This stops quotas getting turned off in the root filesystem everytime
* the system boots up a miniroot.
*/
-#define XFS_QUOTA_MAYBE 0x0100 /* Turn quotas on if SB has quotas on */
+#define XFS_QUOTA_MAYBE 0x0200 /* Turn quotas on if SB has quotas on */
/*
* Checking XFS_IS_*QUOTA_ON() while holding any inode lock guarantees
* quota will be not be switched off as long as that inode lock is held.
*/
#define XFS_IS_QUOTA_ON(mp) ((mp)->m_qflags & (XFS_UQUOTA_ACTIVE | \
- XFS_PQUOTA_ACTIVE))
+ XFS_GQUOTA_ACTIVE))
#define XFS_IS_UQUOTA_ON(mp) ((mp)->m_qflags & XFS_UQUOTA_ACTIVE)
-#define XFS_IS_PQUOTA_ON(mp) ((mp)->m_qflags & XFS_PQUOTA_ACTIVE)
+#define XFS_IS_GQUOTA_ON(mp) ((mp)->m_qflags & XFS_GQUOTA_ACTIVE)
/*
* Flags to tell various functions what to do. Not all of these are meaningful
#define XFS_QMOPT_DQLOCK 0x0000001 /* dqlock */
#define XFS_QMOPT_DQALLOC 0x0000002 /* alloc dquot ondisk if needed */
#define XFS_QMOPT_UQUOTA 0x0000004 /* user dquot requested */
-#define XFS_QMOPT_PQUOTA 0x0000008 /* proj dquot requested */
+#define XFS_QMOPT_GQUOTA 0x0000008 /* group dquot requested */
#define XFS_QMOPT_FORCE_RES 0x0000010 /* ignore quota limits */
#define XFS_QMOPT_DQSUSER 0x0000020 /* don't cache super users dquot */
#define XFS_QMOPT_SBVERSION 0x0000040 /* change superblock version num */
#define XFS_TRANS_DQ_DELRTBCOUNT XFS_QMOPT_DELRTBCOUNT
-#define XFS_QMOPT_QUOTALL (XFS_QMOPT_UQUOTA|XFS_QMOPT_PQUOTA)
+#define XFS_QMOPT_QUOTALL (XFS_QMOPT_UQUOTA|XFS_QMOPT_GQUOTA)
#define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS)
/*
*/
#define XFS_NOT_DQATTACHED(mp, ip) ((XFS_IS_UQUOTA_ON(mp) &&\
(ip)->i_udquot == NULL) || \
- (XFS_IS_PQUOTA_ON(mp) && \
- (ip)->i_pdquot == NULL))
+ (XFS_IS_GQUOTA_ON(mp) && \
+ (ip)->i_gdquot == NULL))
#define XFS_QM_NEED_QUOTACHECK(mp) ((XFS_IS_UQUOTA_ON(mp) && \
(mp->m_sb.sb_qflags & \
XFS_UQUOTA_CHKD) == 0) || \
- (XFS_IS_PQUOTA_ON(mp) && \
+ (XFS_IS_GQUOTA_ON(mp) && \
(mp->m_sb.sb_qflags & \
- XFS_PQUOTA_CHKD) == 0))
+ XFS_GQUOTA_CHKD) == 0))
#define XFS_MOUNT_QUOTA_ALL (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
- XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|\
- XFS_PQUOTA_ENFD|XFS_PQUOTA_CHKD)
+ XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\
+ XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD)
#define XFS_MOUNT_QUOTA_MASK (XFS_MOUNT_QUOTA_ALL | XFS_UQUOTA_ACTIVE | \
- XFS_PQUOTA_ACTIVE)
+ XFS_GQUOTA_ACTIVE)
#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
struct xfs_dquot *);
extern int xfs_qm_vop_dqalloc(struct xfs_mount *,
struct xfs_inode *,
- uid_t, xfs_prid_t, uint,
+ uid_t, gid_t, uint,
struct xfs_dquot **,
struct xfs_dquot **);
extern int xfs_qm_vop_chown_dqalloc(struct xfs_mount *,
struct xfs_inode *,
- int, uid_t, xfs_prid_t,
+ int, uid_t, gid_t,
struct xfs_dquot **,
struct xfs_dquot **);
#define xfs_trans_unreserve_blkquota(tp, ip, nblks) \
xfs_trans_reserve_quota_nblks(tp, ip, -(nblks), 0, XFS_QMOPT_RES_REGBLKS)
-#define xfs_trans_reserve_quota(tp, udq, pdq, nb, ni, f) \
-xfs_trans_reserve_quota_bydquots(tp, udq, pdq, nb, ni, f|XFS_QMOPT_RES_REGBLKS)
+#define xfs_trans_reserve_quota(tp, udq, gdq, nb, ni, f) \
+xfs_trans_reserve_quota_bydquots(tp, udq, gdq, nb, ni, f|XFS_QMOPT_RES_REGBLKS)
-#define xfs_trans_unreserve_quota(tp, ud, pd, b, i, f) \
-xfs_trans_reserve_quota_bydquots(tp, ud, pd, -(b), -(i), f|XFS_QMOPT_RES_REGBLKS)
+#define xfs_trans_unreserve_quota(tp, ud, gd, b, i, f) \
+xfs_trans_reserve_quota_bydquots(tp, ud, gd, -(b), -(i), f|XFS_QMOPT_RES_REGBLKS)
/*
* Realtime disk block quota reservations
* End contiguous fields.
*/
xfs_ino_t sb_uquotino; /* user quota inode */
- xfs_ino_t sb_pquotino; /* project quota inode */
+ xfs_ino_t sb_gquotino; /* group quota inode */
__uint16_t sb_qflags; /* quota flags */
__uint8_t sb_flags; /* misc. flags */
__uint8_t sb_shared_vn; /* shared version number */
XFS_SBS_SECTLOG, XFS_SBS_INODELOG, XFS_SBS_INOPBLOG, XFS_SBS_AGBLKLOG,
XFS_SBS_REXTSLOG, XFS_SBS_INPROGRESS, XFS_SBS_IMAX_PCT, XFS_SBS_ICOUNT,
XFS_SBS_IFREE, XFS_SBS_FDBLOCKS, XFS_SBS_FREXTENTS, XFS_SBS_UQUOTINO,
- XFS_SBS_PQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN,
+ XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN,
XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG,
XFS_SBS_DUMMY,
XFS_SBS_FIELDCOUNT
#define XFS_SB_RSUMINO XFS_SB_MVAL(RSUMINO)
#define XFS_SB_VERSIONNUM XFS_SB_MVAL(VERSIONNUM)
#define XFS_SB_UQUOTINO XFS_SB_MVAL(UQUOTINO)
-#define XFS_SB_PQUOTINO XFS_SB_MVAL(PQUOTINO)
+#define XFS_SB_GQUOTINO XFS_SB_MVAL(GQUOTINO)
#define XFS_SB_QFLAGS XFS_SB_MVAL(QFLAGS)
#define XFS_SB_SHARED_VN XFS_SB_MVAL(SHARED_VN)
#define XFS_SB_UNIT XFS_SB_MVAL(UNIT)
#define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1)
#define XFS_SB_MOD_BITS \
(XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \
- XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_PQUOTINO | \
+ XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \
XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH)
/*
*/
#define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */
#define XFS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */
-#define XFS_QUOTA_PDQ_ACCT (1<<2) /* project quota accounting */
-#define XFS_QUOTA_PDQ_ENFD (1<<3) /* project quota limits enforcement */
-#define XFS_QUOTA_GDQ_ACCT (1<<4) /* group quota accounting */
-#define XFS_QUOTA_GDQ_ENFD (1<<5) /* group quota limits enforcement */
+#define XFS_QUOTA_GDQ_ACCT (1<<2) /* group quota accounting */
+#define XFS_QUOTA_GDQ_ENFD (1<<3) /* group quota limits enforcement */
#define XFS_USER_QUOTA (1<<0) /* user quota type */
-#define XFS_PROJ_QUOTA (1<<1) /* project quota type */
+#define XFS_PROJ_QUOTA (1<<1) /* (IRIX) project quota type */
#define XFS_GROUP_QUOTA (1<<2) /* group quota type */
/*
* fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system.
* Provides a centralized way to get meta infomation about the quota subsystem.
- * eg. space taken up for user and aggregate quotas, number of dquots currently
+ * eg. space taken up for user and group quotas, number of dquots currently
* incore.
*/
#define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */
__u16 qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
__s8 qs_pad; /* unused */
fs_qfilestat_t qs_uquota; /* user quota storage information */
- fs_qfilestat_t qs_aquota; /* aggr quota storage information */
+ fs_qfilestat_t qs_gquota; /* group quota storage information */
__u32 qs_incoredqs; /* number of dquots incore */
__s32 qs_btimelimit; /* limit for blks timer */
__s32 qs_itimelimit; /* limit for inodes timer */
*/
if (XFS_IS_QUOTA_ON(mp) &&
ap->ip->i_ino != mp->m_sb.sb_uquotino &&
- ap->ip->i_ino != mp->m_sb.sb_pquotino)
+ ap->ip->i_ino != mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(ap->tp, ap->ip,
ap->wasdel ?
XFS_TRANS_DQ_DELRTBCOUNT :
*/
if (XFS_IS_QUOTA_ON(mp) &&
ap->ip->i_ino != mp->m_sb.sb_uquotino &&
- ap->ip->i_ino != mp->m_sb.sb_pquotino)
+ ap->ip->i_ino != mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(ap->tp, ap->ip,
ap->wasdel ?
XFS_TRANS_DQ_DELBCOUNT :
ip->i_d.di_nblocks--;
if (XFS_IS_QUOTA_ON(mp) &&
ip->i_ino != mp->m_sb.sb_uquotino &&
- ip->i_ino != mp->m_sb.sb_pquotino)
+ ip->i_ino != mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L);
xfs_trans_binval(tp, cbp);
if (cur->bc_bufs[0] == cbp)
nblks = len * mp->m_sb.sb_rextsize;
if (XFS_IS_QUOTA_ON(mp) &&
ip->i_ino != mp->m_sb.sb_uquotino &&
- ip->i_ino != mp->m_sb.sb_pquotino)
+ ip->i_ino != mp->m_sb.sb_gquotino)
qfield = XFS_TRANS_DQ_RTBCOUNT;
}
/*
nblks = del->br_blockcount;
if (XFS_IS_QUOTA_ON(mp) &&
ip->i_ino != mp->m_sb.sb_uquotino &&
- ip->i_ino != mp->m_sb.sb_pquotino)
+ ip->i_ino != mp->m_sb.sb_gquotino)
qfield = XFS_TRANS_DQ_BCOUNT;
/*
* If we're freeing meta-data, then the transaction
ip->i_d.di_nblocks++;
if (XFS_IS_QUOTA_ON(mp) &&
ip->i_ino != mp->m_sb.sb_uquotino &&
- ip->i_ino != mp->m_sb.sb_pquotino)
+ ip->i_ino != mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, 1L);
abp = xfs_btree_get_bufl(mp, tp, args.fsbno, 0);
/*
ip->i_d.di_nblocks = 1;
if (XFS_IS_QUOTA_ON(args.mp) &&
ip->i_ino != args.mp->m_sb.sb_uquotino &&
- ip->i_ino != args.mp->m_sb.sb_pquotino)
+ ip->i_ino != args.mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT,
1L);
flags |= XFS_ILOG_FEXT(whichfork);
(int)del.br_blockcount, rsvd);
if (XFS_IS_QUOTA_ON(ip->i_mount)) {
ASSERT(ip->i_ino != mp->m_sb.sb_uquotino);
- ASSERT(ip->i_ino != mp->m_sb.sb_pquotino);
+ ASSERT(ip->i_ino != mp->m_sb.sb_gquotino);
if (!isrt)
xfs_trans_unreserve_blkquota(NULL, ip,
(long)del.br_blockcount);
xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, XFS_ILOG_CORE);
if (XFS_IS_QUOTA_ON(mp) &&
cur->bc_private.b.ip->i_ino != mp->m_sb.sb_uquotino &&
- cur->bc_private.b.ip->i_ino != mp->m_sb.sb_pquotino)
+ cur->bc_private.b.ip->i_ino != mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(cur->bc_tp, cur->bc_private.b.ip,
XFS_TRANS_DQ_BCOUNT, -1L);
xfs_trans_binval(cur->bc_tp, rbp);
ip->i_d.di_nblocks--;
if (XFS_IS_QUOTA_ON(cur->bc_mp) &&
ip->i_ino != cur->bc_mp->m_sb.sb_uquotino &&
- ip->i_ino != cur->bc_mp->m_sb.sb_pquotino)
+ ip->i_ino != cur->bc_mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(cur->bc_tp, ip, XFS_TRANS_DQ_BCOUNT,
-1L);
xfs_trans_binval(cur->bc_tp, cbp);
xfs_trans_log_inode(args.tp, cur->bc_private.b.ip, XFS_ILOG_CORE);
if (XFS_IS_QUOTA_ON(args.mp) &&
cur->bc_private.b.ip->i_ino != args.mp->m_sb.sb_uquotino &&
- cur->bc_private.b.ip->i_ino != args.mp->m_sb.sb_pquotino)
+ cur->bc_private.b.ip->i_ino != args.mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(args.tp, cur->bc_private.b.ip,
XFS_TRANS_DQ_BCOUNT, 1L);
rbp = xfs_btree_get_bufl(args.mp, args.tp, args.fsbno, 0);
cur->bc_private.b.ip->i_d.di_nblocks++;
if (XFS_IS_QUOTA_ON(args.mp) &&
cur->bc_private.b.ip->i_ino != args.mp->m_sb.sb_uquotino &&
- cur->bc_private.b.ip->i_ino != args.mp->m_sb.sb_pquotino)
+ cur->bc_private.b.ip->i_ino != args.mp->m_sb.sb_gquotino)
xfs_trans_mod_dquot_byino(args.tp, cur->bc_private.b.ip,
XFS_TRANS_DQ_BCOUNT, 1L);
bp = xfs_btree_get_bufl(args.mp, cur->bc_tp, args.fsbno, 0);
{ offsetof(xfs_sb_t, sb_fdblocks), 0 },
{ offsetof(xfs_sb_t, sb_frextents), 0 },
{ offsetof(xfs_sb_t, sb_uquotino), 0 },
- { offsetof(xfs_sb_t, sb_pquotino), 0 },
+ { offsetof(xfs_sb_t, sb_gquotino), 0 },
{ offsetof(xfs_sb_t, sb_qflags), 0 },
{ offsetof(xfs_sb_t, sb_flags), 0 },
{ offsetof(xfs_sb_t, sb_shared_vn), 0 },
ASSERT(qoff_f);
if (qoff_f->qf_flags & XFS_UQUOTA_ACCT)
strcpy(str, "USER QUOTA");
- if (qoff_f->qf_flags & XFS_PQUOTA_ACCT)
- strcat(str, "PROJ QUOTA");
+ if (qoff_f->qf_flags & XFS_GQUOTA_ACCT)
+ strcat(str, "GROUP QUOTA");
printf("\tQUOTAOFF: #regs:%d type:%s\n",
qoff_f->qf_size, str);
}
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_pquotino = 0;
+ sbp->sb_uquotino = sbp->sb_gquotino = 0;
sbp->sb_qflags = 0;
sbp->sb_unit = dsunit;
sbp->sb_width = dswidth;
rval |= XR_AG_SB_SEC;
}
- if (sb->sb_inprogress == 1 && sb->sb_pquotino) {
+ if (sb->sb_inprogress == 1 && sb->sb_gquotino) {
if (!no_modify)
- sb->sb_pquotino = 0;
+ sb->sb_gquotino = 0;
if (sb->sb_versionnum & XR_PART_SECSB_VNMASK || !do_bzero) {
rval |= XR_AG_SB;
do_warn(
- "non-null project quota inode field in superblock %d\n",
+ "non-null group quota inode field in superblock %d\n",
i);
} else
rval |= XR_AG_SB_SEC;
return(1);
}
- } else if (lino == mp->m_sb.sb_pquotino) {
+ } else if (lino == mp->m_sb.sb_gquotino) {
if (type != XR_INO_DATA) {
- do_warn("project quota inode has bad type 0x%x\n",
+ do_warn("group quota inode has bad type 0x%x\n",
INT_GET(dinoc->di_mode, ARCH_CONVERT) & IFMT);
if (!no_modify) {
*used = is_free;
*isa_dir = 0;
- mp->m_sb.sb_pquotino = NULLFSINO;
+ mp->m_sb.sb_gquotino = NULLFSINO;
return(1);
}
"entry in shorform dir %llu references user quota inode %llu\n",
ino, lino);
junkit = 1;
- } else if (lino == mp->m_sb.sb_pquotino) {
+ } else if (lino == mp->m_sb.sb_gquotino) {
do_warn(
- "entry in shorform dir %llu references proj quota inode %llu\n",
+ "entry in shorform dir %llu references group quota inode %llu\n",
ino, lino);
junkit = 1;
} else if ((irec_p = find_inode_rec(XFS_INO_TO_AGNO(mp, lino),
do_warn(
"\twould clear ino number in entry %d...\n", i);
}
- } else if (lino == mp->m_sb.sb_pquotino) {
+ } else if (lino == mp->m_sb.sb_gquotino) {
do_warn(
-"entry #%d, bno %d in directory %llu references proj quota inode %llu\n",
+"entry #%d, bno %d in directory %llu references group quota inode %llu\n",
i, da_bno, ino, lino);
if (!no_modify) {
do_warn(
} else if (lino == mp->m_sb.sb_uquotino) {
junkit = 1;
junkreason = "user quota";
- } else if (lino == mp->m_sb.sb_pquotino) {
+ } else if (lino == mp->m_sb.sb_gquotino) {
junkit = 1;
- junkreason = "project quota";
+ junkreason = "group quota";
} else if ((irec_p = find_inode_rec(XFS_INO_TO_AGNO(mp, lino),
XFS_INO_TO_AGINO(mp, lino))) != NULL) {
/*
} else if (INT_GET(dep->inumber, ARCH_CONVERT) == mp->m_sb.sb_uquotino) {
clearino = 1;
clearreason = "user quota";
- } else if (INT_GET(dep->inumber, ARCH_CONVERT) == mp->m_sb.sb_pquotino) {
+ } else if (INT_GET(dep->inumber, ARCH_CONVERT) == mp->m_sb.sb_gquotino) {
clearino = 1;
- clearreason = "project quota";
+ clearreason = "group quota";
} else if (INT_GET(dep->inumber, ARCH_CONVERT) == old_orphanage_ino) {
/*
* Do nothing, silently ignore it, entry has already
EXTERN int lost_quotas;
EXTERN int have_uquotino;
-EXTERN int have_pquotino;
+EXTERN int have_gquotino;
EXTERN int lost_uquotino;
-EXTERN int lost_pquotino;
+EXTERN int lost_gquotino;
EXTERN xfs_agino_t first_prealloc_ino;
EXTERN xfs_agino_t last_prealloc_ino;
lost_uquotino = 0;
}
- if (mp->m_sb.sb_pquotino != NULLFSINO && mp->m_sb.sb_pquotino != 0) {
- irec = find_inode_rec(XFS_INO_TO_AGNO(mp, mp->m_sb.sb_pquotino),
- XFS_INO_TO_AGINO(mp, mp->m_sb.sb_pquotino));
+ if (mp->m_sb.sb_gquotino != NULLFSINO && mp->m_sb.sb_gquotino != 0) {
+ irec = find_inode_rec(XFS_INO_TO_AGNO(mp, mp->m_sb.sb_gquotino),
+ XFS_INO_TO_AGINO(mp, mp->m_sb.sb_gquotino));
if (irec == NULL || is_inode_free(irec,
- mp->m_sb.sb_pquotino - irec->ino_startnum)) {
- mp->m_sb.sb_pquotino = NULLFSINO;
- lost_pquotino = 1;
+ mp->m_sb.sb_gquotino - irec->ino_startnum)) {
+ mp->m_sb.sb_gquotino = NULLFSINO;
+ lost_gquotino = 1;
} else
- lost_pquotino = 0;
+ lost_gquotino = 0;
}
}
if (fs_quotas &&
(mp->m_sb.sb_uquotino == NULLFSINO || mp->m_sb.sb_uquotino == 0) &&
- (mp->m_sb.sb_pquotino == NULLFSINO || mp->m_sb.sb_pquotino == 0)) {
+ (mp->m_sb.sb_gquotino == NULLFSINO || mp->m_sb.sb_gquotino == 0)) {
lost_quotas = 1;
fs_quotas = 0;
} else if (!verify_inum(mp, mp->m_sb.sb_uquotino) &&
- !verify_inum(mp, mp->m_sb.sb_uquotino)) {
+ !verify_inum(mp, mp->m_sb.sb_gquotino)) {
fs_quotas = 1;
}
}
- irec->ino_startnum;
add_inode_reached(irec, offset);
}
- if (mp->m_sb.sb_pquotino
- && mp->m_sb.sb_pquotino != NULLFSINO) {
+ if (mp->m_sb.sb_gquotino
+ && mp->m_sb.sb_gquotino != NULLFSINO) {
irec = find_inode_rec(XFS_INO_TO_AGNO(mp,
- mp->m_sb.sb_pquotino),
- XFS_INO_TO_AGINO(mp, mp->m_sb.sb_pquotino));
- offset = XFS_INO_TO_AGINO(mp, mp->m_sb.sb_pquotino)
+ mp->m_sb.sb_gquotino),
+ XFS_INO_TO_AGINO(mp, mp->m_sb.sb_gquotino));
+ offset = XFS_INO_TO_AGINO(mp, mp->m_sb.sb_gquotino)
- irec->ino_startnum;
add_inode_reached(irec, offset);
}
xfs_ino_t rbmino;
xfs_ino_t rsumino;
xfs_ino_t uquotino;
- xfs_ino_t pquotino;
+ xfs_ino_t gquotino;
__uint16_t versionnum;
rootino = dest->sb_rootino;
rbmino = dest->sb_rbmino;
rsumino = dest->sb_rsumino;
uquotino = dest->sb_uquotino;
- pquotino = dest->sb_pquotino;
+ gquotino = dest->sb_gquotino;
versionnum = dest->sb_versionnum;
dest->sb_rbmino = rbmino;
dest->sb_rsumino = rsumino;
dest->sb_uquotino = uquotino;
- dest->sb_pquotino = pquotino;
+ dest->sb_gquotino = gquotino;
dest->sb_versionnum = versionnum;
* protect against stray bits in the quota flag field
*/
if (sb->sb_qflags & ~(XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|
- XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|
- XFS_PQUOTA_ENFD|XFS_PQUOTA_CHKD)) {
+ XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|
+ XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD)) {
/*
* update the incore superblock, if we're in
* no_modify mode, it'll never get flushed out
do_warn("bogus quota flags 0x%x set in superblock",
sb->sb_qflags & ~(XFS_UQUOTA_ACCT|
XFS_UQUOTA_ENFD|
- XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|
- XFS_PQUOTA_ENFD|XFS_PQUOTA_CHKD));
+ XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|
+ XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD));
sb->sb_qflags &= (XFS_UQUOTA_ACCT|
XFS_UQUOTA_ENFD|
- XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|
- XFS_PQUOTA_ENFD|XFS_PQUOTA_CHKD);
+ XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|
+ XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD);
if (!no_modify)
do_warn(", bogus flags will be cleared\n");
XFS_SB_VERSION_SUBALIGN(sb);
}
}
-
- return;
}
/*
fs_ino_alignment = 0;
fs_has_extflgbit = 0;
have_uquotino = 0;
- have_pquotino = 0;
+ have_gquotino = 0;
issue_warning = 0;
/*
sb->sb_uquotino != NULLFSINO)
have_uquotino = 1;
- if (sb->sb_pquotino != 0 &&
- sb->sb_pquotino != NULLFSINO)
- have_pquotino = 1;
+ if (sb->sb_gquotino != 0 &&
+ sb->sb_gquotino != NULLFSINO)
+ have_gquotino = 1;
}
}
"Inode allocation btrees are too corrupted, skipping phases 6 and 7\n");
}
- if (lost_quotas && !have_uquotino && !have_pquotino) {
+ if (lost_quotas && !have_uquotino && !have_gquotino) {
if (!no_modify) {
do_warn(
"Warning: no quota inodes were found. Quotas disabled.\n");
}
}
- if (lost_pquotino) {
+ if (lost_gquotino) {
if (!no_modify) {
do_warn(
- "Warning: project quota information was cleared.\n");
+ "Warning: group quota information was cleared.\n");
do_warn(
-"Project quotas can not be enforced until limit information is recreated.\n");
+"Group quotas can not be enforced until limit information is recreated.\n");
} else {
do_warn(
- "Warning: project quota information would be cleared.\n");
+ "Warning: group quota information would be cleared.\n");
do_warn(
-"Project quotas could not be enforced until limit information was recreated.\n");
+"Group quotas could not be enforced until limit information was recreated.\n");
}
}
}
sb = XFS_BUF_TO_SBP(sbp);
- if (sb->sb_qflags & (XFS_UQUOTA_CHKD|XFS_PQUOTA_CHKD)) {
+ if (sb->sb_qflags & (XFS_UQUOTA_CHKD|XFS_GQUOTA_CHKD)) {
do_warn(
"Note - quota info will be regenerated on next quota mount.\n");
- sb->sb_qflags &= ~(XFS_UQUOTA_CHKD|XFS_PQUOTA_CHKD);
+ sb->sb_qflags &= ~(XFS_UQUOTA_CHKD|XFS_GQUOTA_CHKD);
}
if (clear_sunit) {