diff options
-rw-r--r-- | fs/xfs/xfs_itable.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_qm.c | 8 | ||||
-rw-r--r-- | fs/xfs/xfs_sb.h | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_dquot.c | 6 |
4 files changed, 12 insertions, 10 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 06d004d85bf4..bc92c5306a17 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -43,7 +43,7 @@ xfs_internal_inum( | |||
43 | { | 43 | { |
44 | return (ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || | 44 | return (ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || |
45 | (xfs_sb_version_hasquota(&mp->m_sb) && | 45 | (xfs_sb_version_hasquota(&mp->m_sb) && |
46 | (ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino))); | 46 | xfs_is_quota_inode(&mp->m_sb, ino))); |
47 | } | 47 | } |
48 | 48 | ||
49 | /* | 49 | /* |
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index b75c9bb6e71e..28a5e8ae3829 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c | |||
@@ -489,8 +489,7 @@ xfs_qm_need_dqattach( | |||
489 | return false; | 489 | return false; |
490 | if (!XFS_NOT_DQATTACHED(mp, ip)) | 490 | if (!XFS_NOT_DQATTACHED(mp, ip)) |
491 | return false; | 491 | return false; |
492 | if (ip->i_ino == mp->m_sb.sb_uquotino || | 492 | if (xfs_is_quota_inode(&mp->m_sb, ip->i_ino)) |
493 | ip->i_ino == mp->m_sb.sb_gquotino) | ||
494 | return false; | 493 | return false; |
495 | return true; | 494 | return true; |
496 | } | 495 | } |
@@ -606,8 +605,7 @@ xfs_qm_dqdetach( | |||
606 | 605 | ||
607 | trace_xfs_dquot_dqdetach(ip); | 606 | trace_xfs_dquot_dqdetach(ip); |
608 | 607 | ||
609 | ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_uquotino); | 608 | ASSERT(!xfs_is_quota_inode(&ip->i_mount->m_sb, ip->i_ino)); |
610 | ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_gquotino); | ||
611 | if (ip->i_udquot) { | 609 | if (ip->i_udquot) { |
612 | xfs_qm_dqrele(ip->i_udquot); | 610 | xfs_qm_dqrele(ip->i_udquot); |
613 | ip->i_udquot = NULL; | 611 | ip->i_udquot = NULL; |
@@ -1152,7 +1150,7 @@ xfs_qm_dqusage_adjust( | |||
1152 | * rootino must have its resources accounted for, not so with the quota | 1150 | * rootino must have its resources accounted for, not so with the quota |
1153 | * inodes. | 1151 | * inodes. |
1154 | */ | 1152 | */ |
1155 | if (ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino) { | 1153 | if (xfs_is_quota_inode(&mp->m_sb, ino)) { |
1156 | *res = BULKSTAT_RV_NOTHING; | 1154 | *res = BULKSTAT_RV_NOTHING; |
1157 | return XFS_ERROR(EINVAL); | 1155 | return XFS_ERROR(EINVAL); |
1158 | } | 1156 | } |
diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h index 2de58a85833c..78f9e70b80c7 100644 --- a/fs/xfs/xfs_sb.h +++ b/fs/xfs/xfs_sb.h | |||
@@ -618,6 +618,12 @@ xfs_sb_has_incompat_log_feature( | |||
618 | return (sbp->sb_features_log_incompat & feature) != 0; | 618 | return (sbp->sb_features_log_incompat & feature) != 0; |
619 | } | 619 | } |
620 | 620 | ||
621 | static inline bool | ||
622 | xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino) | ||
623 | { | ||
624 | return (ino == sbp->sb_uquotino || ino == sbp->sb_gquotino); | ||
625 | } | ||
626 | |||
621 | /* | 627 | /* |
622 | * end of superblock version macros | 628 | * end of superblock version macros |
623 | */ | 629 | */ |
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c index fec75d023703..3fa369c75a4d 100644 --- a/fs/xfs/xfs_trans_dquot.c +++ b/fs/xfs/xfs_trans_dquot.c | |||
@@ -157,8 +157,7 @@ xfs_trans_mod_dquot_byino( | |||
157 | 157 | ||
158 | if (!XFS_IS_QUOTA_RUNNING(mp) || | 158 | if (!XFS_IS_QUOTA_RUNNING(mp) || |
159 | !XFS_IS_QUOTA_ON(mp) || | 159 | !XFS_IS_QUOTA_ON(mp) || |
160 | ip->i_ino == mp->m_sb.sb_uquotino || | 160 | xfs_is_quota_inode(&mp->m_sb, ip->i_ino)) |
161 | ip->i_ino == mp->m_sb.sb_gquotino) | ||
162 | return; | 161 | return; |
163 | 162 | ||
164 | if (tp->t_dqinfo == NULL) | 163 | if (tp->t_dqinfo == NULL) |
@@ -816,8 +815,7 @@ xfs_trans_reserve_quota_nblks( | |||
816 | if (XFS_IS_PQUOTA_ON(mp)) | 815 | if (XFS_IS_PQUOTA_ON(mp)) |
817 | flags |= XFS_QMOPT_ENOSPC; | 816 | flags |= XFS_QMOPT_ENOSPC; |
818 | 817 | ||
819 | ASSERT(ip->i_ino != mp->m_sb.sb_uquotino); | 818 | ASSERT(!xfs_is_quota_inode(&mp->m_sb, ip->i_ino)); |
820 | ASSERT(ip->i_ino != mp->m_sb.sb_gquotino); | ||
821 | 819 | ||
822 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | 820 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
823 | ASSERT((flags & ~(XFS_QMOPT_FORCE_RES | XFS_QMOPT_ENOSPC)) == | 821 | ASSERT((flags & ~(XFS_QMOPT_FORCE_RES | XFS_QMOPT_ENOSPC)) == |