diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2013-06-27 18:25:10 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-06-28 18:39:22 -0400 |
commit | 83e782e1a1cc0159888e58e14dfc8f3289663338 (patch) | |
tree | 82d328c90f3d3c89a7011f554e0bb8871dbdee8e /fs | |
parent | 0e6436d99e730f9384f3c11d24a5efb788885fc6 (diff) |
xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD
Remove all incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD. Instead,
start using XFS_GQUOTA_.* XFS_PQUOTA_.* counterparts for GQUOTA and
PQUOTA respectively.
On-disk copy still uses XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD.
Read and write of the superblock does the conversion from *OQUOTA*
to *[PG]QUOTA*.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_mount.c | 51 | ||||
-rw-r--r-- | fs/xfs/xfs_qm.c | 9 | ||||
-rw-r--r-- | fs/xfs/xfs_qm_syscalls.c | 43 | ||||
-rw-r--r-- | fs/xfs/xfs_quota.h | 47 | ||||
-rw-r--r-- | fs/xfs/xfs_quotaops.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_super.c | 16 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_dquot.c | 4 |
7 files changed, 123 insertions, 53 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 2978bb4cc72a..2b0ba3581656 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -336,6 +336,14 @@ xfs_mount_validate_sb( | |||
336 | return XFS_ERROR(EWRONGFS); | 336 | return XFS_ERROR(EWRONGFS); |
337 | } | 337 | } |
338 | 338 | ||
339 | if ((sbp->sb_qflags & (XFS_OQUOTA_ENFD | XFS_OQUOTA_CHKD)) && | ||
340 | (sbp->sb_qflags & (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD | | ||
341 | XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD))) { | ||
342 | xfs_notice(mp, | ||
343 | "Super block has XFS_OQUOTA bits along with XFS_PQUOTA and/or XFS_GQUOTA bits.\n"); | ||
344 | return XFS_ERROR(EFSCORRUPTED); | ||
345 | } | ||
346 | |||
339 | /* | 347 | /* |
340 | * Version 5 superblock feature mask validation. Reject combinations the | 348 | * Version 5 superblock feature mask validation. Reject combinations the |
341 | * kernel cannot support up front before checking anything else. For | 349 | * kernel cannot support up front before checking anything else. For |
@@ -561,6 +569,18 @@ out_unwind: | |||
561 | return error; | 569 | return error; |
562 | } | 570 | } |
563 | 571 | ||
572 | static void | ||
573 | xfs_sb_quota_from_disk(struct xfs_sb *sbp) | ||
574 | { | ||
575 | if (sbp->sb_qflags & XFS_OQUOTA_ENFD) | ||
576 | sbp->sb_qflags |= (sbp->sb_qflags & XFS_PQUOTA_ACCT) ? | ||
577 | XFS_PQUOTA_ENFD : XFS_GQUOTA_ENFD; | ||
578 | if (sbp->sb_qflags & XFS_OQUOTA_CHKD) | ||
579 | sbp->sb_qflags |= (sbp->sb_qflags & XFS_PQUOTA_ACCT) ? | ||
580 | XFS_PQUOTA_CHKD : XFS_GQUOTA_CHKD; | ||
581 | sbp->sb_qflags &= ~(XFS_OQUOTA_ENFD | XFS_OQUOTA_CHKD); | ||
582 | } | ||
583 | |||
564 | void | 584 | void |
565 | xfs_sb_from_disk( | 585 | xfs_sb_from_disk( |
566 | struct xfs_sb *to, | 586 | struct xfs_sb *to, |
@@ -622,6 +642,35 @@ xfs_sb_from_disk( | |||
622 | to->sb_lsn = be64_to_cpu(from->sb_lsn); | 642 | to->sb_lsn = be64_to_cpu(from->sb_lsn); |
623 | } | 643 | } |
624 | 644 | ||
645 | static inline void | ||
646 | xfs_sb_quota_to_disk( | ||
647 | xfs_dsb_t *to, | ||
648 | xfs_sb_t *from, | ||
649 | __int64_t *fields) | ||
650 | { | ||
651 | __uint16_t qflags = from->sb_qflags; | ||
652 | |||
653 | if (*fields & XFS_SB_QFLAGS) { | ||
654 | /* | ||
655 | * The in-core version of sb_qflags do not have | ||
656 | * XFS_OQUOTA_* flags, whereas the on-disk version | ||
657 | * does. So, convert incore XFS_{PG}QUOTA_* flags | ||
658 | * to on-disk XFS_OQUOTA_* flags. | ||
659 | */ | ||
660 | qflags &= ~(XFS_PQUOTA_ENFD | XFS_PQUOTA_CHKD | | ||
661 | XFS_GQUOTA_ENFD | XFS_GQUOTA_CHKD); | ||
662 | |||
663 | if (from->sb_qflags & | ||
664 | (XFS_PQUOTA_ENFD | XFS_GQUOTA_ENFD)) | ||
665 | qflags |= XFS_OQUOTA_ENFD; | ||
666 | if (from->sb_qflags & | ||
667 | (XFS_PQUOTA_CHKD | XFS_GQUOTA_CHKD)) | ||
668 | qflags |= XFS_OQUOTA_CHKD; | ||
669 | to->sb_qflags = cpu_to_be16(qflags); | ||
670 | *fields &= ~XFS_SB_QFLAGS; | ||
671 | } | ||
672 | } | ||
673 | |||
625 | /* | 674 | /* |
626 | * Copy in core superblock to ondisk one. | 675 | * Copy in core superblock to ondisk one. |
627 | * | 676 | * |
@@ -643,6 +692,7 @@ xfs_sb_to_disk( | |||
643 | if (!fields) | 692 | if (!fields) |
644 | return; | 693 | return; |
645 | 694 | ||
695 | xfs_sb_quota_to_disk(to, from, &fields); | ||
646 | while (fields) { | 696 | while (fields) { |
647 | f = (xfs_sb_field_t)xfs_lowbit64((__uint64_t)fields); | 697 | f = (xfs_sb_field_t)xfs_lowbit64((__uint64_t)fields); |
648 | first = xfs_sb_info[f].offset; | 698 | first = xfs_sb_info[f].offset; |
@@ -835,6 +885,7 @@ reread: | |||
835 | */ | 885 | */ |
836 | xfs_sb_from_disk(&mp->m_sb, XFS_BUF_TO_SBP(bp)); | 886 | xfs_sb_from_disk(&mp->m_sb, XFS_BUF_TO_SBP(bp)); |
837 | 887 | ||
888 | xfs_sb_quota_from_disk(&mp->m_sb); | ||
838 | /* | 889 | /* |
839 | * We must be able to do sector-sized and sector-aligned IO. | 890 | * We must be able to do sector-sized and sector-aligned IO. |
840 | */ | 891 | */ |
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index cf09aa845d8c..7a3e007b49f4 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c | |||
@@ -299,8 +299,10 @@ xfs_qm_mount_quotas( | |||
299 | */ | 299 | */ |
300 | if (!XFS_IS_UQUOTA_ON(mp)) | 300 | if (!XFS_IS_UQUOTA_ON(mp)) |
301 | mp->m_qflags &= ~XFS_UQUOTA_CHKD; | 301 | mp->m_qflags &= ~XFS_UQUOTA_CHKD; |
302 | if (!(XFS_IS_GQUOTA_ON(mp) || XFS_IS_PQUOTA_ON(mp))) | 302 | if (!XFS_IS_GQUOTA_ON(mp)) |
303 | mp->m_qflags &= ~XFS_OQUOTA_CHKD; | 303 | mp->m_qflags &= ~XFS_GQUOTA_CHKD; |
304 | if (!XFS_IS_PQUOTA_ON(mp)) | ||
305 | mp->m_qflags &= ~XFS_PQUOTA_CHKD; | ||
304 | 306 | ||
305 | write_changes: | 307 | write_changes: |
306 | /* | 308 | /* |
@@ -1297,7 +1299,8 @@ xfs_qm_quotacheck( | |||
1297 | &buffer_list); | 1299 | &buffer_list); |
1298 | if (error) | 1300 | if (error) |
1299 | goto error_return; | 1301 | goto error_return; |
1300 | flags |= XFS_OQUOTA_CHKD; | 1302 | flags |= XFS_IS_GQUOTA_ON(mp) ? |
1303 | XFS_GQUOTA_CHKD : XFS_PQUOTA_CHKD; | ||
1301 | } | 1304 | } |
1302 | 1305 | ||
1303 | do { | 1306 | do { |
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index b03b2abd1e13..a08801ae24e2 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c | |||
@@ -117,11 +117,11 @@ xfs_qm_scall_quotaoff( | |||
117 | } | 117 | } |
118 | if (flags & XFS_GQUOTA_ACCT) { | 118 | if (flags & XFS_GQUOTA_ACCT) { |
119 | dqtype |= XFS_QMOPT_GQUOTA; | 119 | dqtype |= XFS_QMOPT_GQUOTA; |
120 | flags |= (XFS_OQUOTA_CHKD | XFS_OQUOTA_ENFD); | 120 | flags |= (XFS_GQUOTA_CHKD | XFS_GQUOTA_ENFD); |
121 | inactivate_flags |= XFS_GQUOTA_ACTIVE; | 121 | inactivate_flags |= XFS_GQUOTA_ACTIVE; |
122 | } else if (flags & XFS_PQUOTA_ACCT) { | 122 | } else if (flags & XFS_PQUOTA_ACCT) { |
123 | dqtype |= XFS_QMOPT_PQUOTA; | 123 | dqtype |= XFS_QMOPT_PQUOTA; |
124 | flags |= (XFS_OQUOTA_CHKD | XFS_OQUOTA_ENFD); | 124 | flags |= (XFS_PQUOTA_CHKD | XFS_PQUOTA_ENFD); |
125 | inactivate_flags |= XFS_PQUOTA_ACTIVE; | 125 | inactivate_flags |= XFS_PQUOTA_ACTIVE; |
126 | } | 126 | } |
127 | 127 | ||
@@ -335,14 +335,14 @@ xfs_qm_scall_quotaon( | |||
335 | * quota acct on ondisk without m_qflags' knowing. | 335 | * quota acct on ondisk without m_qflags' knowing. |
336 | */ | 336 | */ |
337 | if (((flags & XFS_UQUOTA_ACCT) == 0 && | 337 | if (((flags & XFS_UQUOTA_ACCT) == 0 && |
338 | (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 && | 338 | (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 && |
339 | (flags & XFS_UQUOTA_ENFD)) | 339 | (flags & XFS_UQUOTA_ENFD)) || |
340 | || | 340 | ((flags & XFS_GQUOTA_ACCT) == 0 && |
341 | (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 && | ||
342 | (flags & XFS_GQUOTA_ENFD)) || | ||
341 | ((flags & XFS_PQUOTA_ACCT) == 0 && | 343 | ((flags & XFS_PQUOTA_ACCT) == 0 && |
342 | (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 && | 344 | (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 && |
343 | (flags & XFS_GQUOTA_ACCT) == 0 && | 345 | (flags & XFS_PQUOTA_ENFD))) { |
344 | (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 && | ||
345 | (flags & XFS_OQUOTA_ENFD))) { | ||
346 | xfs_debug(mp, | 346 | xfs_debug(mp, |
347 | "%s: Can't enforce without acct, flags=%x sbflags=%x\n", | 347 | "%s: Can't enforce without acct, flags=%x sbflags=%x\n", |
348 | __func__, flags, mp->m_sb.sb_qflags); | 348 | __func__, flags, mp->m_sb.sb_qflags); |
@@ -776,9 +776,12 @@ xfs_qm_scall_getquota( | |||
776 | * gets turned off. No need to confuse the user level code, | 776 | * gets turned off. No need to confuse the user level code, |
777 | * so return zeroes in that case. | 777 | * so return zeroes in that case. |
778 | */ | 778 | */ |
779 | if ((!XFS_IS_UQUOTA_ENFORCED(mp) && dqp->q_core.d_flags == XFS_DQ_USER) || | 779 | if ((!XFS_IS_UQUOTA_ENFORCED(mp) && |
780 | (!XFS_IS_OQUOTA_ENFORCED(mp) && | 780 | dqp->q_core.d_flags == XFS_DQ_USER) || |
781 | (dqp->q_core.d_flags & (XFS_DQ_PROJ | XFS_DQ_GROUP)))) { | 781 | (!XFS_IS_GQUOTA_ENFORCED(mp) && |
782 | dqp->q_core.d_flags == XFS_DQ_GROUP) || | ||
783 | (!XFS_IS_PQUOTA_ENFORCED(mp) && | ||
784 | dqp->q_core.d_flags == XFS_DQ_PROJ)) { | ||
782 | dst->d_btimer = 0; | 785 | dst->d_btimer = 0; |
783 | dst->d_itimer = 0; | 786 | dst->d_itimer = 0; |
784 | dst->d_rtbtimer = 0; | 787 | dst->d_rtbtimer = 0; |
@@ -786,8 +789,8 @@ xfs_qm_scall_getquota( | |||
786 | 789 | ||
787 | #ifdef DEBUG | 790 | #ifdef DEBUG |
788 | if (((XFS_IS_UQUOTA_ENFORCED(mp) && dst->d_flags == FS_USER_QUOTA) || | 791 | if (((XFS_IS_UQUOTA_ENFORCED(mp) && dst->d_flags == FS_USER_QUOTA) || |
789 | (XFS_IS_OQUOTA_ENFORCED(mp) && | 792 | (XFS_IS_GQUOTA_ENFORCED(mp) && dst->d_flags == FS_GROUP_QUOTA) || |
790 | (dst->d_flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)))) && | 793 | (XFS_IS_PQUOTA_ENFORCED(mp) && dst->d_flags == FS_PROJ_QUOTA)) && |
791 | dst->d_id != 0) { | 794 | dst->d_id != 0) { |
792 | if ((dst->d_bcount > dst->d_blk_softlimit) && | 795 | if ((dst->d_bcount > dst->d_blk_softlimit) && |
793 | (dst->d_blk_softlimit > 0)) { | 796 | (dst->d_blk_softlimit > 0)) { |
@@ -833,16 +836,16 @@ xfs_qm_export_flags( | |||
833 | uflags = 0; | 836 | uflags = 0; |
834 | if (flags & XFS_UQUOTA_ACCT) | 837 | if (flags & XFS_UQUOTA_ACCT) |
835 | uflags |= FS_QUOTA_UDQ_ACCT; | 838 | uflags |= FS_QUOTA_UDQ_ACCT; |
836 | if (flags & XFS_PQUOTA_ACCT) | ||
837 | uflags |= FS_QUOTA_PDQ_ACCT; | ||
838 | if (flags & XFS_GQUOTA_ACCT) | 839 | if (flags & XFS_GQUOTA_ACCT) |
839 | uflags |= FS_QUOTA_GDQ_ACCT; | 840 | uflags |= FS_QUOTA_GDQ_ACCT; |
841 | if (flags & XFS_PQUOTA_ACCT) | ||
842 | uflags |= FS_QUOTA_PDQ_ACCT; | ||
840 | if (flags & XFS_UQUOTA_ENFD) | 843 | if (flags & XFS_UQUOTA_ENFD) |
841 | uflags |= FS_QUOTA_UDQ_ENFD; | 844 | uflags |= FS_QUOTA_UDQ_ENFD; |
842 | if (flags & (XFS_OQUOTA_ENFD)) { | 845 | if (flags & XFS_GQUOTA_ENFD) |
843 | uflags |= (flags & XFS_GQUOTA_ACCT) ? | 846 | uflags |= FS_QUOTA_GDQ_ENFD; |
844 | FS_QUOTA_GDQ_ENFD : FS_QUOTA_PDQ_ENFD; | 847 | if (flags & XFS_PQUOTA_ENFD) |
845 | } | 848 | uflags |= FS_QUOTA_PDQ_ENFD; |
846 | return (uflags); | 849 | return (uflags); |
847 | } | 850 | } |
848 | 851 | ||
diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h index c38068f26c55..c3483bab9cde 100644 --- a/fs/xfs/xfs_quota.h +++ b/fs/xfs/xfs_quota.h | |||
@@ -161,30 +161,42 @@ typedef struct xfs_qoff_logformat { | |||
161 | #define XFS_GQUOTA_ACCT 0x0040 /* group quota accounting ON */ | 161 | #define XFS_GQUOTA_ACCT 0x0040 /* group quota accounting ON */ |
162 | 162 | ||
163 | /* | 163 | /* |
164 | * Conversion to and from the combined OQUOTA flag (if necessary) | ||
165 | * is done only in xfs_sb_qflags_to_disk() and xfs_sb_qflags_from_disk() | ||
166 | */ | ||
167 | #define XFS_GQUOTA_ENFD 0x0080 /* group quota limits enforced */ | ||
168 | #define XFS_GQUOTA_CHKD 0x0100 /* quotacheck run on group quotas */ | ||
169 | #define XFS_PQUOTA_ENFD 0x0200 /* project quota limits enforced */ | ||
170 | #define XFS_PQUOTA_CHKD 0x0400 /* quotacheck run on project quotas */ | ||
171 | |||
172 | /* | ||
164 | * Quota Accounting/Enforcement flags | 173 | * Quota Accounting/Enforcement flags |
165 | */ | 174 | */ |
166 | #define XFS_ALL_QUOTA_ACCT \ | 175 | #define XFS_ALL_QUOTA_ACCT \ |
167 | (XFS_UQUOTA_ACCT | XFS_GQUOTA_ACCT | XFS_PQUOTA_ACCT) | 176 | (XFS_UQUOTA_ACCT | XFS_GQUOTA_ACCT | XFS_PQUOTA_ACCT) |
168 | #define XFS_ALL_QUOTA_ENFD (XFS_UQUOTA_ENFD | XFS_OQUOTA_ENFD) | 177 | #define XFS_ALL_QUOTA_ENFD \ |
169 | #define XFS_ALL_QUOTA_CHKD (XFS_UQUOTA_CHKD | XFS_OQUOTA_CHKD) | 178 | (XFS_UQUOTA_ENFD | XFS_GQUOTA_ENFD | XFS_PQUOTA_ENFD) |
179 | #define XFS_ALL_QUOTA_CHKD \ | ||
180 | (XFS_UQUOTA_CHKD | XFS_GQUOTA_CHKD | XFS_PQUOTA_CHKD) | ||
170 | 181 | ||
171 | #define XFS_IS_QUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT) | 182 | #define XFS_IS_QUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT) |
172 | #define XFS_IS_UQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT) | 183 | #define XFS_IS_UQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT) |
173 | #define XFS_IS_PQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT) | 184 | #define XFS_IS_PQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT) |
174 | #define XFS_IS_GQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_GQUOTA_ACCT) | 185 | #define XFS_IS_GQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_GQUOTA_ACCT) |
175 | #define XFS_IS_UQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_UQUOTA_ENFD) | 186 | #define XFS_IS_UQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_UQUOTA_ENFD) |
176 | #define XFS_IS_OQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_OQUOTA_ENFD) | 187 | #define XFS_IS_GQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_GQUOTA_ENFD) |
188 | #define XFS_IS_PQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_PQUOTA_ENFD) | ||
177 | 189 | ||
178 | /* | 190 | /* |
179 | * Incore only flags for quotaoff - these bits get cleared when quota(s) | 191 | * Incore only flags for quotaoff - these bits get cleared when quota(s) |
180 | * are in the process of getting turned off. These flags are in m_qflags but | 192 | * are in the process of getting turned off. These flags are in m_qflags but |
181 | * never in sb_qflags. | 193 | * never in sb_qflags. |
182 | */ | 194 | */ |
183 | #define XFS_UQUOTA_ACTIVE 0x0100 /* uquotas are being turned off */ | 195 | #define XFS_UQUOTA_ACTIVE 0x1000 /* uquotas are being turned off */ |
184 | #define XFS_PQUOTA_ACTIVE 0x0200 /* pquotas are being turned off */ | 196 | #define XFS_GQUOTA_ACTIVE 0x2000 /* gquotas are being turned off */ |
185 | #define XFS_GQUOTA_ACTIVE 0x0400 /* gquotas are being turned off */ | 197 | #define XFS_PQUOTA_ACTIVE 0x4000 /* pquotas are being turned off */ |
186 | #define XFS_ALL_QUOTA_ACTIVE \ | 198 | #define XFS_ALL_QUOTA_ACTIVE \ |
187 | (XFS_UQUOTA_ACTIVE | XFS_PQUOTA_ACTIVE | XFS_GQUOTA_ACTIVE) | 199 | (XFS_UQUOTA_ACTIVE | XFS_GQUOTA_ACTIVE | XFS_PQUOTA_ACTIVE) |
188 | 200 | ||
189 | /* | 201 | /* |
190 | * Checking XFS_IS_*QUOTA_ON() while holding any inode lock guarantees | 202 | * Checking XFS_IS_*QUOTA_ON() while holding any inode lock guarantees |
@@ -268,24 +280,23 @@ typedef struct xfs_qoff_logformat { | |||
268 | ((XFS_IS_UQUOTA_ON(mp) && \ | 280 | ((XFS_IS_UQUOTA_ON(mp) && \ |
269 | (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD) == 0) || \ | 281 | (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD) == 0) || \ |
270 | (XFS_IS_GQUOTA_ON(mp) && \ | 282 | (XFS_IS_GQUOTA_ON(mp) && \ |
271 | ((mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD) == 0 || \ | 283 | (mp->m_sb.sb_qflags & XFS_GQUOTA_CHKD) == 0) || \ |
272 | (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT))) || \ | ||
273 | (XFS_IS_PQUOTA_ON(mp) && \ | 284 | (XFS_IS_PQUOTA_ON(mp) && \ |
274 | ((mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD) == 0 || \ | 285 | (mp->m_sb.sb_qflags & XFS_PQUOTA_CHKD) == 0)) |
275 | (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT)))) | ||
276 | 286 | ||
277 | #define XFS_MOUNT_QUOTA_SET1 (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\ | 287 | #define XFS_MOUNT_QUOTA_SET1 (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\ |
278 | XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|\ | 288 | XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\ |
279 | XFS_OQUOTA_ENFD|XFS_OQUOTA_CHKD) | 289 | XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD) |
280 | 290 | ||
281 | #define XFS_MOUNT_QUOTA_SET2 (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\ | 291 | #define XFS_MOUNT_QUOTA_SET2 (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\ |
282 | XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\ | 292 | XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|\ |
283 | XFS_OQUOTA_ENFD|XFS_OQUOTA_CHKD) | 293 | XFS_PQUOTA_ENFD|XFS_PQUOTA_CHKD) |
284 | 294 | ||
285 | #define XFS_MOUNT_QUOTA_ALL (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\ | 295 | #define XFS_MOUNT_QUOTA_ALL (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\ |
286 | XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|\ | 296 | XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\ |
287 | XFS_OQUOTA_ENFD|XFS_OQUOTA_CHKD|\ | 297 | XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD|\ |
288 | XFS_GQUOTA_ACCT) | 298 | XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD|\ |
299 | XFS_PQUOTA_CHKD) | ||
289 | 300 | ||
290 | 301 | ||
291 | /* | 302 | /* |
diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c index 71926d630527..20e30f93b0c7 100644 --- a/fs/xfs/xfs_quotaops.c +++ b/fs/xfs/xfs_quotaops.c | |||
@@ -75,8 +75,10 @@ xfs_fs_set_xstate( | |||
75 | flags |= XFS_GQUOTA_ACCT; | 75 | flags |= XFS_GQUOTA_ACCT; |
76 | if (uflags & FS_QUOTA_UDQ_ENFD) | 76 | if (uflags & FS_QUOTA_UDQ_ENFD) |
77 | flags |= XFS_UQUOTA_ENFD; | 77 | flags |= XFS_UQUOTA_ENFD; |
78 | if (uflags & (FS_QUOTA_PDQ_ENFD|FS_QUOTA_GDQ_ENFD)) | 78 | if (uflags & FS_QUOTA_GDQ_ENFD) |
79 | flags |= XFS_OQUOTA_ENFD; | 79 | flags |= XFS_GQUOTA_ENFD; |
80 | if (uflags & FS_QUOTA_PDQ_ENFD) | ||
81 | flags |= XFS_PQUOTA_ENFD; | ||
80 | 82 | ||
81 | switch (op) { | 83 | switch (op) { |
82 | case Q_XQUOTAON: | 84 | case Q_XQUOTAON: |
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index e5e8b5ee8bfa..1d68ffcdeaa7 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
@@ -360,17 +360,17 @@ xfs_parseargs( | |||
360 | } else if (!strcmp(this_char, MNTOPT_PQUOTA) || | 360 | } else if (!strcmp(this_char, MNTOPT_PQUOTA) || |
361 | !strcmp(this_char, MNTOPT_PRJQUOTA)) { | 361 | !strcmp(this_char, MNTOPT_PRJQUOTA)) { |
362 | mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | | 362 | mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | |
363 | XFS_OQUOTA_ENFD); | 363 | XFS_PQUOTA_ENFD); |
364 | } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { | 364 | } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { |
365 | mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); | 365 | mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); |
366 | mp->m_qflags &= ~XFS_OQUOTA_ENFD; | 366 | mp->m_qflags &= ~XFS_PQUOTA_ENFD; |
367 | } else if (!strcmp(this_char, MNTOPT_GQUOTA) || | 367 | } else if (!strcmp(this_char, MNTOPT_GQUOTA) || |
368 | !strcmp(this_char, MNTOPT_GRPQUOTA)) { | 368 | !strcmp(this_char, MNTOPT_GRPQUOTA)) { |
369 | mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | | 369 | mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | |
370 | XFS_OQUOTA_ENFD); | 370 | XFS_GQUOTA_ENFD); |
371 | } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { | 371 | } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { |
372 | mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); | 372 | mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); |
373 | mp->m_qflags &= ~XFS_OQUOTA_ENFD; | 373 | mp->m_qflags &= ~XFS_GQUOTA_ENFD; |
374 | } else if (!strcmp(this_char, MNTOPT_DELAYLOG)) { | 374 | } else if (!strcmp(this_char, MNTOPT_DELAYLOG)) { |
375 | xfs_warn(mp, | 375 | xfs_warn(mp, |
376 | "delaylog is the default now, option is deprecated."); | 376 | "delaylog is the default now, option is deprecated."); |
@@ -559,12 +559,12 @@ xfs_showargs( | |||
559 | /* Either project or group quotas can be active, not both */ | 559 | /* Either project or group quotas can be active, not both */ |
560 | 560 | ||
561 | if (mp->m_qflags & XFS_PQUOTA_ACCT) { | 561 | if (mp->m_qflags & XFS_PQUOTA_ACCT) { |
562 | if (mp->m_qflags & XFS_OQUOTA_ENFD) | 562 | if (mp->m_qflags & XFS_PQUOTA_ENFD) |
563 | seq_puts(m, "," MNTOPT_PRJQUOTA); | 563 | seq_puts(m, "," MNTOPT_PRJQUOTA); |
564 | else | 564 | else |
565 | seq_puts(m, "," MNTOPT_PQUOTANOENF); | 565 | seq_puts(m, "," MNTOPT_PQUOTANOENF); |
566 | } else if (mp->m_qflags & XFS_GQUOTA_ACCT) { | 566 | } else if (mp->m_qflags & XFS_GQUOTA_ACCT) { |
567 | if (mp->m_qflags & XFS_OQUOTA_ENFD) | 567 | if (mp->m_qflags & XFS_GQUOTA_ENFD) |
568 | seq_puts(m, "," MNTOPT_GRPQUOTA); | 568 | seq_puts(m, "," MNTOPT_GRPQUOTA); |
569 | else | 569 | else |
570 | seq_puts(m, "," MNTOPT_GQUOTANOENF); | 570 | seq_puts(m, "," MNTOPT_GQUOTANOENF); |
@@ -1132,8 +1132,8 @@ xfs_fs_statfs( | |||
1132 | spin_unlock(&mp->m_sb_lock); | 1132 | spin_unlock(&mp->m_sb_lock); |
1133 | 1133 | ||
1134 | if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && | 1134 | if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && |
1135 | ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))) == | 1135 | ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == |
1136 | (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD)) | 1136 | (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD)) |
1137 | xfs_qm_statvfs(ip, statp); | 1137 | xfs_qm_statvfs(ip, statp); |
1138 | return 0; | 1138 | return 0; |
1139 | } | 1139 | } |
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c index 7ea7485f9fb8..3ba64d540168 100644 --- a/fs/xfs/xfs_trans_dquot.c +++ b/fs/xfs/xfs_trans_dquot.c | |||
@@ -632,8 +632,8 @@ xfs_trans_dqresv( | |||
632 | if ((flags & XFS_QMOPT_FORCE_RES) == 0 && | 632 | if ((flags & XFS_QMOPT_FORCE_RES) == 0 && |
633 | dqp->q_core.d_id && | 633 | dqp->q_core.d_id && |
634 | ((XFS_IS_UQUOTA_ENFORCED(dqp->q_mount) && XFS_QM_ISUDQ(dqp)) || | 634 | ((XFS_IS_UQUOTA_ENFORCED(dqp->q_mount) && XFS_QM_ISUDQ(dqp)) || |
635 | (XFS_IS_OQUOTA_ENFORCED(dqp->q_mount) && | 635 | (XFS_IS_GQUOTA_ENFORCED(dqp->q_mount) && XFS_QM_ISGDQ(dqp)) || |
636 | (XFS_QM_ISPDQ(dqp) || XFS_QM_ISGDQ(dqp))))) { | 636 | (XFS_IS_PQUOTA_ENFORCED(dqp->q_mount) && XFS_QM_ISPDQ(dqp)))) { |
637 | if (nblks > 0) { | 637 | if (nblks > 0) { |
638 | /* | 638 | /* |
639 | * dquot is locked already. See if we'd go over the | 639 | * dquot is locked already. See if we'd go over the |