19 #include <linux/capability.h>
66 uint inactivate_flags;
74 if ((mp->m_qflags & flags) == 0)
93 mp->m_qflags &= ~(
flags);
95 spin_lock(&mp->m_sb_lock);
96 mp->m_sb.sb_qflags = mp->m_qflags;
97 spin_unlock(&mp->m_sb_lock);
106 inactivate_flags = 0;
131 if ((mp->m_qflags & flags) == 0)
154 mp->m_qflags &= ~inactivate_flags;
173 mp->m_qflags &= ~flags;
195 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
202 if (((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET1) ||
203 ((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET2)) {
228 struct xfs_mount *
mp,
231 struct xfs_inode *
ip;
232 struct xfs_trans *tp;
267 ASSERT(ip->i_d.di_nextents == 0);
284 int error = 0, error2 = 0;
286 if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0) {
287 xfs_debug(mp,
"%s: flags=%x m_qflags=%x\n",
288 __func__, flags, mp->m_qflags);
297 return error ? error : error2;
323 xfs_debug(mp,
"%s: zero flags, m_qflags=%x\n",
324 __func__, mp->m_qflags);
337 (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 &&
341 (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 &&
343 (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 &&
346 "%s: Can't enforce without acct, flags=%x sbflags=%x\n",
347 __func__, flags, mp->m_sb.sb_qflags);
353 if ((mp->m_qflags & flags) == flags)
360 spin_lock(&mp->m_sb_lock);
361 qf = mp->m_sb.sb_qflags;
362 mp->m_sb.sb_qflags = qf |
flags;
363 spin_unlock(&mp->m_sb_lock);
368 if ((qf & flags) == flags && sbflags == 0)
377 if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) !=
378 (mp->m_qflags & XFS_UQUOTA_ACCT)) ||
379 ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) !=
380 (mp->m_qflags & XFS_PQUOTA_ACCT)) ||
381 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) !=
382 (mp->m_qflags & XFS_GQUOTA_ACCT)) ||
392 mutex_lock(&mp->m_quotainfo->qi_quotaofflock);
405 struct xfs_mount *
mp,
409 struct xfs_inode *uip, *gip;
410 boolean_t tempuqip, tempgqip;
413 tempuqip = tempgqip = B_FALSE;
417 if (!xfs_sb_version_hasquota(&mp->m_sb)) {
433 if (!uip && mp->m_sb.sb_uquotino !=
NULLFSINO) {
438 if (!gip && mp->m_sb.sb_gquotino !=
NULLFSINO) {
466 #define XFS_DQ_MASK \
467 (FS_DQ_LIMIT_MASK | FS_DQ_TIMER_MASK | FS_DQ_WARNS_MASK)
527 if (hard == 0 || hard >= soft) {
535 xfs_debug(mp,
"blkhard %Ld < blksoft %Ld\n", hard, soft);
543 if (hard == 0 || hard >= soft) {
551 xfs_debug(mp,
"rtbhard %Ld < rtbsoft %Ld\n", hard, soft);
560 if (hard == 0 || hard >= soft) {
568 xfs_debug(mp,
"ihard %Ld < isoft %Ld\n", hard, soft);
655 xfs_trans_set_sync(tp);
675 mp->m_sb.sb_sectsize + 128,
685 spin_lock(&mp->m_sb_lock);
686 oldsbqflag = mp->m_sb.sb_qflags;
687 mp->m_sb.sb_qflags = (mp->m_qflags & ~(
flags)) & XFS_MOUNT_QUOTA_ALL;
688 spin_unlock(&mp->m_sb_lock);
697 xfs_trans_set_sync(tp);
707 spin_lock(&mp->m_sb_lock);
708 mp->m_sb.sb_qflags = oldsbqflag;
709 spin_unlock(&mp->m_sb_lock);
718 struct xfs_mount *
mp,
744 memset(dst, 0,
sizeof(*dst));
846 struct xfs_inode *
ip,
851 if (ip == ip->i_mount->m_quotainfo->qi_uquotaip ||
852 ip == ip->i_mount->m_quotainfo->qi_gquotaip) {
880 struct xfs_mount *
mp,