diff options
author | Nathan Scott <nathans@sgi.com> | 2005-06-21 01:38:48 -0400 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-06-21 01:38:48 -0400 |
commit | c8ad20ffeb592d66ea869c57f8c525a9d727c67b (patch) | |
tree | 3306edfe984170bc881a1d7fbeab29b4b59f0305 /fs/xfs/quota/xfs_qm_syscalls.c | |
parent | 8401e9631c26dca9ebbc6997ac445fd49b06c79e (diff) |
[XFS] Add support for project quota, based on Dan Knappes earlier work.
SGI-PV: 932952
SGI-Modid: xfs-linux:xfs-kern:22805a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/quota/xfs_qm_syscalls.c')
-rw-r--r-- | fs/xfs/quota/xfs_qm_syscalls.c | 151 |
1 files changed, 92 insertions, 59 deletions
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 229f5b5a2d25..365a054f02d6 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c | |||
@@ -118,40 +118,41 @@ xfs_qm_quotactl( | |||
118 | * The following commands are valid even when quotaoff. | 118 | * The following commands are valid even when quotaoff. |
119 | */ | 119 | */ |
120 | switch (cmd) { | 120 | switch (cmd) { |
121 | case Q_XQUOTARM: | ||
121 | /* | 122 | /* |
122 | * truncate quota files. quota must be off. | 123 | * Truncate quota files. quota must be off. |
123 | */ | 124 | */ |
124 | case Q_XQUOTARM: | ||
125 | if (XFS_IS_QUOTA_ON(mp) || addr == NULL) | 125 | if (XFS_IS_QUOTA_ON(mp) || addr == NULL) |
126 | return XFS_ERROR(EINVAL); | 126 | return XFS_ERROR(EINVAL); |
127 | if (vfsp->vfs_flag & VFS_RDONLY) | 127 | if (vfsp->vfs_flag & VFS_RDONLY) |
128 | return XFS_ERROR(EROFS); | 128 | return XFS_ERROR(EROFS); |
129 | return (xfs_qm_scall_trunc_qfiles(mp, | 129 | return (xfs_qm_scall_trunc_qfiles(mp, |
130 | xfs_qm_import_qtype_flags(*(uint *)addr))); | 130 | xfs_qm_import_qtype_flags(*(uint *)addr))); |
131 | |||
132 | case Q_XGETQSTAT: | ||
131 | /* | 133 | /* |
132 | * Get quota status information. | 134 | * Get quota status information. |
133 | */ | 135 | */ |
134 | case Q_XGETQSTAT: | ||
135 | return (xfs_qm_scall_getqstat(mp, (fs_quota_stat_t *)addr)); | 136 | return (xfs_qm_scall_getqstat(mp, (fs_quota_stat_t *)addr)); |
136 | 137 | ||
138 | case Q_XQUOTAON: | ||
137 | /* | 139 | /* |
138 | * QUOTAON for root f/s and quota enforcement on others.. | 140 | * QUOTAON - enabling quota enforcement. |
139 | * Quota accounting for non-root f/s's must be turned on | 141 | * Quota accounting must be turned on at mount time. |
140 | * at mount time. | ||
141 | */ | 142 | */ |
142 | case Q_XQUOTAON: | ||
143 | if (addr == NULL) | 143 | if (addr == NULL) |
144 | return XFS_ERROR(EINVAL); | 144 | return XFS_ERROR(EINVAL); |
145 | if (vfsp->vfs_flag & VFS_RDONLY) | 145 | if (vfsp->vfs_flag & VFS_RDONLY) |
146 | return XFS_ERROR(EROFS); | 146 | return XFS_ERROR(EROFS); |
147 | return (xfs_qm_scall_quotaon(mp, | 147 | return (xfs_qm_scall_quotaon(mp, |
148 | xfs_qm_import_flags(*(uint *)addr))); | 148 | xfs_qm_import_flags(*(uint *)addr))); |
149 | case Q_XQUOTAOFF: | 149 | |
150 | case Q_XQUOTAOFF: | ||
150 | if (vfsp->vfs_flag & VFS_RDONLY) | 151 | if (vfsp->vfs_flag & VFS_RDONLY) |
151 | return XFS_ERROR(EROFS); | 152 | return XFS_ERROR(EROFS); |
152 | break; | 153 | break; |
153 | 154 | ||
154 | default: | 155 | default: |
155 | break; | 156 | break; |
156 | } | 157 | } |
157 | 158 | ||
@@ -159,7 +160,7 @@ xfs_qm_quotactl( | |||
159 | return XFS_ERROR(ESRCH); | 160 | return XFS_ERROR(ESRCH); |
160 | 161 | ||
161 | switch (cmd) { | 162 | switch (cmd) { |
162 | case Q_XQUOTAOFF: | 163 | case Q_XQUOTAOFF: |
163 | if (vfsp->vfs_flag & VFS_RDONLY) | 164 | if (vfsp->vfs_flag & VFS_RDONLY) |
164 | return XFS_ERROR(EROFS); | 165 | return XFS_ERROR(EROFS); |
165 | error = xfs_qm_scall_quotaoff(mp, | 166 | error = xfs_qm_scall_quotaoff(mp, |
@@ -167,42 +168,39 @@ xfs_qm_quotactl( | |||
167 | B_FALSE); | 168 | B_FALSE); |
168 | break; | 169 | break; |
169 | 170 | ||
170 | /* | 171 | case Q_XGETQUOTA: |
171 | * Defaults to XFS_GETUQUOTA. | ||
172 | */ | ||
173 | case Q_XGETQUOTA: | ||
174 | error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_USER, | 172 | error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_USER, |
175 | (fs_disk_quota_t *)addr); | 173 | (fs_disk_quota_t *)addr); |
176 | break; | 174 | break; |
177 | /* | 175 | case Q_XGETGQUOTA: |
178 | * Set limits, both hard and soft. Defaults to Q_SETUQLIM. | 176 | error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_GROUP, |
179 | */ | 177 | (fs_disk_quota_t *)addr); |
180 | case Q_XSETQLIM: | 178 | break; |
179 | case Q_XGETPQUOTA: | ||
180 | error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_PROJ, | ||
181 | (fs_disk_quota_t *)addr); | ||
182 | break; | ||
183 | |||
184 | case Q_XSETQLIM: | ||
181 | if (vfsp->vfs_flag & VFS_RDONLY) | 185 | if (vfsp->vfs_flag & VFS_RDONLY) |
182 | return XFS_ERROR(EROFS); | 186 | return XFS_ERROR(EROFS); |
183 | error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_USER, | 187 | error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_USER, |
184 | (fs_disk_quota_t *)addr); | 188 | (fs_disk_quota_t *)addr); |
185 | break; | 189 | break; |
186 | 190 | case Q_XSETGQLIM: | |
187 | case Q_XSETGQLIM: | ||
188 | if (vfsp->vfs_flag & VFS_RDONLY) | 191 | if (vfsp->vfs_flag & VFS_RDONLY) |
189 | return XFS_ERROR(EROFS); | 192 | return XFS_ERROR(EROFS); |
190 | error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_GROUP, | 193 | error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_GROUP, |
191 | (fs_disk_quota_t *)addr); | 194 | (fs_disk_quota_t *)addr); |
192 | break; | 195 | break; |
193 | 196 | case Q_XSETPQLIM: | |
194 | 197 | if (vfsp->vfs_flag & VFS_RDONLY) | |
195 | case Q_XGETGQUOTA: | 198 | return XFS_ERROR(EROFS); |
196 | error = xfs_qm_scall_getquota(mp, (xfs_dqid_t)id, XFS_DQ_GROUP, | 199 | error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_PROJ, |
197 | (fs_disk_quota_t *)addr); | 200 | (fs_disk_quota_t *)addr); |
198 | break; | 201 | break; |
199 | 202 | ||
200 | /* | 203 | default: |
201 | * Quotas are entirely undefined after quotaoff in XFS quotas. | ||
202 | * For instance, there's no way to set limits when quotaoff. | ||
203 | */ | ||
204 | |||
205 | default: | ||
206 | error = XFS_ERROR(EINVAL); | 204 | error = XFS_ERROR(EINVAL); |
207 | break; | 205 | break; |
208 | } | 206 | } |
@@ -286,8 +284,12 @@ xfs_qm_scall_quotaoff( | |||
286 | } | 284 | } |
287 | if (flags & XFS_GQUOTA_ACCT) { | 285 | if (flags & XFS_GQUOTA_ACCT) { |
288 | dqtype |= XFS_QMOPT_GQUOTA; | 286 | dqtype |= XFS_QMOPT_GQUOTA; |
289 | flags |= (XFS_GQUOTA_CHKD | XFS_GQUOTA_ENFD); | 287 | flags |= (XFS_OQUOTA_CHKD | XFS_OQUOTA_ENFD); |
290 | inactivate_flags |= XFS_GQUOTA_ACTIVE; | 288 | inactivate_flags |= XFS_GQUOTA_ACTIVE; |
289 | } else if (flags & XFS_PQUOTA_ACCT) { | ||
290 | dqtype |= XFS_QMOPT_PQUOTA; | ||
291 | flags |= (XFS_OQUOTA_CHKD | XFS_OQUOTA_ENFD); | ||
292 | inactivate_flags |= XFS_PQUOTA_ACTIVE; | ||
291 | } | 293 | } |
292 | 294 | ||
293 | /* | 295 | /* |
@@ -364,7 +366,8 @@ xfs_qm_scall_quotaoff( | |||
364 | /* | 366 | /* |
365 | * If quotas is completely disabled, close shop. | 367 | * If quotas is completely disabled, close shop. |
366 | */ | 368 | */ |
367 | if ((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_ALL) { | 369 | if (((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET1) || |
370 | ((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET2)) { | ||
368 | mutex_unlock(&(XFS_QI_QOFFLOCK(mp))); | 371 | mutex_unlock(&(XFS_QI_QOFFLOCK(mp))); |
369 | xfs_qm_destroy_quotainfo(mp); | 372 | xfs_qm_destroy_quotainfo(mp); |
370 | return (0); | 373 | return (0); |
@@ -378,7 +381,7 @@ xfs_qm_scall_quotaoff( | |||
378 | XFS_PURGE_INODE(XFS_QI_UQIP(mp)); | 381 | XFS_PURGE_INODE(XFS_QI_UQIP(mp)); |
379 | XFS_QI_UQIP(mp) = NULL; | 382 | XFS_QI_UQIP(mp) = NULL; |
380 | } | 383 | } |
381 | if ((dqtype & XFS_QMOPT_GQUOTA) && XFS_QI_GQIP(mp)) { | 384 | if ((dqtype & (XFS_QMOPT_GQUOTA|XFS_QMOPT_PQUOTA)) && XFS_QI_GQIP(mp)) { |
382 | XFS_PURGE_INODE(XFS_QI_GQIP(mp)); | 385 | XFS_PURGE_INODE(XFS_QI_GQIP(mp)); |
383 | XFS_QI_GQIP(mp) = NULL; | 386 | XFS_QI_GQIP(mp) = NULL; |
384 | } | 387 | } |
@@ -411,7 +414,8 @@ xfs_qm_scall_trunc_qfiles( | |||
411 | } | 414 | } |
412 | } | 415 | } |
413 | 416 | ||
414 | if ((flags & XFS_DQ_GROUP) && mp->m_sb.sb_gquotino != NULLFSINO) { | 417 | if ((flags & (XFS_DQ_GROUP|XFS_DQ_PROJ)) && |
418 | mp->m_sb.sb_gquotino != NULLFSINO) { | ||
415 | error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 0, 0, &qip, 0); | 419 | error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, 0, 0, &qip, 0); |
416 | if (! error) { | 420 | if (! error) { |
417 | (void) xfs_truncate_file(mp, qip); | 421 | (void) xfs_truncate_file(mp, qip); |
@@ -434,7 +438,7 @@ xfs_qm_scall_quotaon( | |||
434 | uint flags) | 438 | uint flags) |
435 | { | 439 | { |
436 | int error; | 440 | int error; |
437 | unsigned long s; | 441 | unsigned long s; |
438 | uint qf; | 442 | uint qf; |
439 | uint accflags; | 443 | uint accflags; |
440 | __int64_t sbflags; | 444 | __int64_t sbflags; |
@@ -468,9 +472,13 @@ xfs_qm_scall_quotaon( | |||
468 | (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 && | 472 | (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 && |
469 | (flags & XFS_UQUOTA_ENFD)) | 473 | (flags & XFS_UQUOTA_ENFD)) |
470 | || | 474 | || |
475 | ((flags & XFS_PQUOTA_ACCT) == 0 && | ||
476 | (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 && | ||
477 | (flags & XFS_OQUOTA_ENFD)) | ||
478 | || | ||
471 | ((flags & XFS_GQUOTA_ACCT) == 0 && | 479 | ((flags & XFS_GQUOTA_ACCT) == 0 && |
472 | (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 && | 480 | (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 && |
473 | (flags & XFS_GQUOTA_ENFD))) { | 481 | (flags & XFS_OQUOTA_ENFD))) { |
474 | qdprintk("Can't enforce without acct, flags=%x sbflags=%x\n", | 482 | qdprintk("Can't enforce without acct, flags=%x sbflags=%x\n", |
475 | flags, mp->m_sb.sb_qflags); | 483 | flags, mp->m_sb.sb_qflags); |
476 | return XFS_ERROR(EINVAL); | 484 | return XFS_ERROR(EINVAL); |
@@ -504,6 +512,10 @@ xfs_qm_scall_quotaon( | |||
504 | */ | 512 | */ |
505 | if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) != | 513 | if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) != |
506 | (mp->m_qflags & XFS_UQUOTA_ACCT)) || | 514 | (mp->m_qflags & XFS_UQUOTA_ACCT)) || |
515 | ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) != | ||
516 | (mp->m_qflags & XFS_PQUOTA_ACCT)) || | ||
517 | ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) != | ||
518 | (mp->m_qflags & XFS_GQUOTA_ACCT)) || | ||
507 | (flags & XFS_ALL_QUOTA_ENFD) == 0) | 519 | (flags & XFS_ALL_QUOTA_ENFD) == 0) |
508 | return (0); | 520 | return (0); |
509 | 521 | ||
@@ -521,7 +533,6 @@ xfs_qm_scall_quotaon( | |||
521 | } | 533 | } |
522 | 534 | ||
523 | 535 | ||
524 | |||
525 | /* | 536 | /* |
526 | * Return quota status information, such as uquota-off, enforcements, etc. | 537 | * Return quota status information, such as uquota-off, enforcements, etc. |
527 | */ | 538 | */ |
@@ -776,9 +787,9 @@ xfs_qm_log_quotaoff_end( | |||
776 | xfs_qoff_logitem_t *startqoff, | 787 | xfs_qoff_logitem_t *startqoff, |
777 | uint flags) | 788 | uint flags) |
778 | { | 789 | { |
779 | xfs_trans_t *tp; | 790 | xfs_trans_t *tp; |
780 | int error; | 791 | int error; |
781 | xfs_qoff_logitem_t *qoffi; | 792 | xfs_qoff_logitem_t *qoffi; |
782 | 793 | ||
783 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF_END); | 794 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF_END); |
784 | 795 | ||
@@ -928,18 +939,26 @@ xfs_qm_export_dquot( | |||
928 | 939 | ||
929 | STATIC uint | 940 | STATIC uint |
930 | xfs_qm_import_qtype_flags( | 941 | xfs_qm_import_qtype_flags( |
931 | uint uflags) | 942 | uint uflags) |
932 | { | 943 | { |
944 | uint oflags = 0; | ||
945 | |||
933 | /* | 946 | /* |
934 | * Can't be both at the same time. | 947 | * Can't be more than one, or none. |
935 | */ | 948 | */ |
936 | if (((uflags & (XFS_GROUP_QUOTA | XFS_USER_QUOTA)) == | 949 | if (((uflags & (XFS_GROUP_QUOTA | XFS_USER_QUOTA)) == |
937 | (XFS_GROUP_QUOTA | XFS_USER_QUOTA)) || | 950 | (XFS_GROUP_QUOTA | XFS_USER_QUOTA)) || |
938 | ((uflags & (XFS_GROUP_QUOTA | XFS_USER_QUOTA)) == 0)) | 951 | ((uflags & (XFS_GROUP_QUOTA | XFS_PROJ_QUOTA)) == |
952 | (XFS_GROUP_QUOTA | XFS_PROJ_QUOTA)) || | ||
953 | ((uflags & (XFS_USER_QUOTA | XFS_PROJ_QUOTA)) == | ||
954 | (XFS_USER_QUOTA | XFS_PROJ_QUOTA)) || | ||
955 | ((uflags & (XFS_GROUP_QUOTA|XFS_USER_QUOTA|XFS_PROJ_QUOTA)) == 0)) | ||
939 | return (0); | 956 | return (0); |
940 | 957 | ||
941 | return (uflags & XFS_USER_QUOTA) ? | 958 | oflags |= (uflags & XFS_USER_QUOTA) ? XFS_DQ_USER : 0; |
942 | XFS_DQ_USER : XFS_DQ_GROUP; | 959 | oflags |= (uflags & XFS_PROJ_QUOTA) ? XFS_DQ_PROJ : 0; |
960 | oflags |= (uflags & XFS_GROUP_QUOTA) ? XFS_DQ_GROUP: 0; | ||
961 | return oflags; | ||
943 | } | 962 | } |
944 | 963 | ||
945 | STATIC uint | 964 | STATIC uint |
@@ -947,14 +966,19 @@ xfs_qm_export_qtype_flags( | |||
947 | uint flags) | 966 | uint flags) |
948 | { | 967 | { |
949 | /* | 968 | /* |
950 | * Can't be both at the same time. | 969 | * Can't be more than one, or none. |
951 | */ | 970 | */ |
952 | ASSERT((flags & (XFS_GROUP_QUOTA | XFS_USER_QUOTA)) != | 971 | ASSERT((flags & (XFS_PROJ_QUOTA | XFS_USER_QUOTA)) != |
953 | (XFS_GROUP_QUOTA | XFS_USER_QUOTA)); | 972 | (XFS_PROJ_QUOTA | XFS_USER_QUOTA)); |
954 | ASSERT((flags & (XFS_GROUP_QUOTA | XFS_USER_QUOTA)) != 0); | 973 | ASSERT((flags & (XFS_PROJ_QUOTA | XFS_GROUP_QUOTA)) != |
974 | (XFS_PROJ_QUOTA | XFS_GROUP_QUOTA)); | ||
975 | ASSERT((flags & (XFS_USER_QUOTA | XFS_GROUP_QUOTA)) != | ||
976 | (XFS_USER_QUOTA | XFS_GROUP_QUOTA)); | ||
977 | ASSERT((flags & (XFS_PROJ_QUOTA|XFS_USER_QUOTA|XFS_GROUP_QUOTA)) != 0); | ||
955 | 978 | ||
956 | return (flags & XFS_DQ_USER) ? | 979 | return (flags & XFS_DQ_USER) ? |
957 | XFS_USER_QUOTA : XFS_GROUP_QUOTA; | 980 | XFS_USER_QUOTA : (flags & XFS_DQ_PROJ) ? |
981 | XFS_PROJ_QUOTA : XFS_GROUP_QUOTA; | ||
958 | } | 982 | } |
959 | 983 | ||
960 | STATIC uint | 984 | STATIC uint |
@@ -965,12 +989,14 @@ xfs_qm_import_flags( | |||
965 | 989 | ||
966 | if (uflags & XFS_QUOTA_UDQ_ACCT) | 990 | if (uflags & XFS_QUOTA_UDQ_ACCT) |
967 | flags |= XFS_UQUOTA_ACCT; | 991 | flags |= XFS_UQUOTA_ACCT; |
992 | if (uflags & XFS_QUOTA_PDQ_ACCT) | ||
993 | flags |= XFS_PQUOTA_ACCT; | ||
968 | if (uflags & XFS_QUOTA_GDQ_ACCT) | 994 | if (uflags & XFS_QUOTA_GDQ_ACCT) |
969 | flags |= XFS_GQUOTA_ACCT; | 995 | flags |= XFS_GQUOTA_ACCT; |
970 | if (uflags & XFS_QUOTA_UDQ_ENFD) | 996 | if (uflags & XFS_QUOTA_UDQ_ENFD) |
971 | flags |= XFS_UQUOTA_ENFD; | 997 | flags |= XFS_UQUOTA_ENFD; |
972 | if (uflags & XFS_QUOTA_GDQ_ENFD) | 998 | if (uflags & (XFS_QUOTA_PDQ_ENFD|XFS_QUOTA_GDQ_ENFD)) |
973 | flags |= XFS_GQUOTA_ENFD; | 999 | flags |= XFS_OQUOTA_ENFD; |
974 | return (flags); | 1000 | return (flags); |
975 | } | 1001 | } |
976 | 1002 | ||
@@ -984,12 +1010,16 @@ xfs_qm_export_flags( | |||
984 | uflags = 0; | 1010 | uflags = 0; |
985 | if (flags & XFS_UQUOTA_ACCT) | 1011 | if (flags & XFS_UQUOTA_ACCT) |
986 | uflags |= XFS_QUOTA_UDQ_ACCT; | 1012 | uflags |= XFS_QUOTA_UDQ_ACCT; |
1013 | if (flags & XFS_PQUOTA_ACCT) | ||
1014 | uflags |= XFS_QUOTA_PDQ_ACCT; | ||
987 | if (flags & XFS_GQUOTA_ACCT) | 1015 | if (flags & XFS_GQUOTA_ACCT) |
988 | uflags |= XFS_QUOTA_GDQ_ACCT; | 1016 | uflags |= XFS_QUOTA_GDQ_ACCT; |
989 | if (flags & XFS_UQUOTA_ENFD) | 1017 | if (flags & XFS_UQUOTA_ENFD) |
990 | uflags |= XFS_QUOTA_UDQ_ENFD; | 1018 | uflags |= XFS_QUOTA_UDQ_ENFD; |
991 | if (flags & XFS_GQUOTA_ENFD) | 1019 | if (flags & (XFS_OQUOTA_ENFD)) { |
992 | uflags |= XFS_QUOTA_GDQ_ENFD; | 1020 | uflags |= (flags & XFS_GQUOTA_ACCT) ? |
1021 | XFS_QUOTA_GDQ_ENFD : XFS_QUOTA_PDQ_ENFD; | ||
1022 | } | ||
993 | return (uflags); | 1023 | return (uflags); |
994 | } | 1024 | } |
995 | 1025 | ||
@@ -1070,7 +1100,7 @@ again: | |||
1070 | xfs_qm_dqrele(ip->i_udquot); | 1100 | xfs_qm_dqrele(ip->i_udquot); |
1071 | ip->i_udquot = NULL; | 1101 | ip->i_udquot = NULL; |
1072 | } | 1102 | } |
1073 | if ((flags & XFS_GQUOTA_ACCT) && ip->i_gdquot) { | 1103 | if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && ip->i_gdquot) { |
1074 | xfs_qm_dqrele(ip->i_gdquot); | 1104 | xfs_qm_dqrele(ip->i_gdquot); |
1075 | ip->i_gdquot = NULL; | 1105 | ip->i_gdquot = NULL; |
1076 | } | 1106 | } |
@@ -1160,7 +1190,6 @@ xfs_qm_dqtest_print( | |||
1160 | { | 1190 | { |
1161 | cmn_err(CE_DEBUG, "-----------DQTEST DQUOT----------------"); | 1191 | cmn_err(CE_DEBUG, "-----------DQTEST DQUOT----------------"); |
1162 | cmn_err(CE_DEBUG, "---- dquot ID = %d", d->d_id); | 1192 | cmn_err(CE_DEBUG, "---- dquot ID = %d", d->d_id); |
1163 | cmn_err(CE_DEBUG, "---- type = %s", XFS_QM_ISUDQ(d)? "USR" : "GRP"); | ||
1164 | cmn_err(CE_DEBUG, "---- fs = 0x%p", d->q_mount); | 1193 | cmn_err(CE_DEBUG, "---- fs = 0x%p", d->q_mount); |
1165 | cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", | 1194 | cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", |
1166 | d->d_bcount, (int)d->d_bcount); | 1195 | d->d_bcount, (int)d->d_bcount); |
@@ -1231,7 +1260,7 @@ xfs_dqtest_cmp2( | |||
1231 | #ifdef QUOTADEBUG | 1260 | #ifdef QUOTADEBUG |
1232 | if (!err) { | 1261 | if (!err) { |
1233 | cmn_err(CE_DEBUG, "%d [%s] [0x%p] qchecked", | 1262 | cmn_err(CE_DEBUG, "%d [%s] [0x%p] qchecked", |
1234 | d->d_id, XFS_QM_ISUDQ(d) ? "USR" : "GRP", d->q_mount); | 1263 | d->d_id, DQFLAGTO_TYPESTR(d), d->q_mount); |
1235 | } | 1264 | } |
1236 | #endif | 1265 | #endif |
1237 | return (err); | 1266 | return (err); |
@@ -1287,6 +1316,7 @@ STATIC void | |||
1287 | xfs_qm_internalqcheck_get_dquots( | 1316 | xfs_qm_internalqcheck_get_dquots( |
1288 | xfs_mount_t *mp, | 1317 | xfs_mount_t *mp, |
1289 | xfs_dqid_t uid, | 1318 | xfs_dqid_t uid, |
1319 | xfs_dqid_t projid, | ||
1290 | xfs_dqid_t gid, | 1320 | xfs_dqid_t gid, |
1291 | xfs_dqtest_t **ud, | 1321 | xfs_dqtest_t **ud, |
1292 | xfs_dqtest_t **gd) | 1322 | xfs_dqtest_t **gd) |
@@ -1295,6 +1325,8 @@ xfs_qm_internalqcheck_get_dquots( | |||
1295 | xfs_qm_internalqcheck_dqget(mp, uid, XFS_DQ_USER, ud); | 1325 | xfs_qm_internalqcheck_dqget(mp, uid, XFS_DQ_USER, ud); |
1296 | if (XFS_IS_GQUOTA_ON(mp)) | 1326 | if (XFS_IS_GQUOTA_ON(mp)) |
1297 | xfs_qm_internalqcheck_dqget(mp, gid, XFS_DQ_GROUP, gd); | 1327 | xfs_qm_internalqcheck_dqget(mp, gid, XFS_DQ_GROUP, gd); |
1328 | else if (XFS_IS_PQUOTA_ON(mp)) | ||
1329 | xfs_qm_internalqcheck_dqget(mp, projid, XFS_DQ_PROJ, gd); | ||
1298 | } | 1330 | } |
1299 | 1331 | ||
1300 | 1332 | ||
@@ -1362,13 +1394,14 @@ xfs_qm_internalqcheck_adjust( | |||
1362 | } | 1394 | } |
1363 | xfs_qm_internalqcheck_get_dquots(mp, | 1395 | xfs_qm_internalqcheck_get_dquots(mp, |
1364 | (xfs_dqid_t) ip->i_d.di_uid, | 1396 | (xfs_dqid_t) ip->i_d.di_uid, |
1397 | (xfs_dqid_t) ip->i_d.di_projid, | ||
1365 | (xfs_dqid_t) ip->i_d.di_gid, | 1398 | (xfs_dqid_t) ip->i_d.di_gid, |
1366 | &ud, &gd); | 1399 | &ud, &gd); |
1367 | if (XFS_IS_UQUOTA_ON(mp)) { | 1400 | if (XFS_IS_UQUOTA_ON(mp)) { |
1368 | ASSERT(ud); | 1401 | ASSERT(ud); |
1369 | xfs_qm_internalqcheck_dqadjust(ip, ud); | 1402 | xfs_qm_internalqcheck_dqadjust(ip, ud); |
1370 | } | 1403 | } |
1371 | if (XFS_IS_GQUOTA_ON(mp)) { | 1404 | if (XFS_IS_OQUOTA_ON(mp)) { |
1372 | ASSERT(gd); | 1405 | ASSERT(gd); |
1373 | xfs_qm_internalqcheck_dqadjust(ip, gd); | 1406 | xfs_qm_internalqcheck_dqadjust(ip, gd); |
1374 | } | 1407 | } |