aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index d0b499418a7d..c7d684f02f89 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -908,7 +908,8 @@ xfs_ioctl_setattr(
908 struct xfs_mount *mp = ip->i_mount; 908 struct xfs_mount *mp = ip->i_mount;
909 struct xfs_trans *tp; 909 struct xfs_trans *tp;
910 unsigned int lock_flags = 0; 910 unsigned int lock_flags = 0;
911 struct xfs_dquot *udqp = NULL, *gdqp = NULL; 911 struct xfs_dquot *udqp = NULL;
912 struct xfs_dquot *gdqp = NULL;
912 struct xfs_dquot *olddquot = NULL; 913 struct xfs_dquot *olddquot = NULL;
913 int code; 914 int code;
914 915
@@ -928,7 +929,7 @@ xfs_ioctl_setattr(
928 * because the i_*dquot fields will get updated anyway. 929 * because the i_*dquot fields will get updated anyway.
929 */ 930 */
930 if (XFS_IS_QUOTA_ON(mp) && (mask & FSX_PROJID)) { 931 if (XFS_IS_QUOTA_ON(mp) && (mask & FSX_PROJID)) {
931 code = XFS_QM_DQVOPALLOC(mp, ip, ip->i_d.di_uid, 932 code = xfs_qm_vop_dqalloc(ip, ip->i_d.di_uid,
932 ip->i_d.di_gid, fa->fsx_projid, 933 ip->i_d.di_gid, fa->fsx_projid,
933 XFS_QMOPT_PQUOTA, &udqp, &gdqp); 934 XFS_QMOPT_PQUOTA, &udqp, &gdqp);
934 if (code) 935 if (code)
@@ -963,10 +964,11 @@ xfs_ioctl_setattr(
963 * Do a quota reservation only if projid is actually going to change. 964 * Do a quota reservation only if projid is actually going to change.
964 */ 965 */
965 if (mask & FSX_PROJID) { 966 if (mask & FSX_PROJID) {
966 if (XFS_IS_PQUOTA_ON(mp) && 967 if (XFS_IS_QUOTA_RUNNING(mp) &&
968 XFS_IS_PQUOTA_ON(mp) &&
967 ip->i_d.di_projid != fa->fsx_projid) { 969 ip->i_d.di_projid != fa->fsx_projid) {
968 ASSERT(tp); 970 ASSERT(tp);
969 code = XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, udqp, gdqp, 971 code = xfs_qm_vop_chown_reserve(tp, ip, udqp, gdqp,
970 capable(CAP_FOWNER) ? 972 capable(CAP_FOWNER) ?
971 XFS_QMOPT_FORCE_RES : 0); 973 XFS_QMOPT_FORCE_RES : 0);
972 if (code) /* out of quota */ 974 if (code) /* out of quota */
@@ -1068,8 +1070,8 @@ xfs_ioctl_setattr(
1068 * in the transaction. 1070 * in the transaction.
1069 */ 1071 */
1070 if (ip->i_d.di_projid != fa->fsx_projid) { 1072 if (ip->i_d.di_projid != fa->fsx_projid) {
1071 if (XFS_IS_PQUOTA_ON(mp)) { 1073 if (XFS_IS_QUOTA_RUNNING(mp) && XFS_IS_PQUOTA_ON(mp)) {
1072 olddquot = XFS_QM_DQVOPCHOWN(mp, tp, ip, 1074 olddquot = xfs_qm_vop_chown(tp, ip,
1073 &ip->i_gdquot, gdqp); 1075 &ip->i_gdquot, gdqp);
1074 } 1076 }
1075 ip->i_d.di_projid = fa->fsx_projid; 1077 ip->i_d.di_projid = fa->fsx_projid;
@@ -1115,9 +1117,9 @@ xfs_ioctl_setattr(
1115 /* 1117 /*
1116 * Release any dquot(s) the inode had kept before chown. 1118 * Release any dquot(s) the inode had kept before chown.
1117 */ 1119 */
1118 XFS_QM_DQRELE(mp, olddquot); 1120 xfs_qm_dqrele(olddquot);
1119 XFS_QM_DQRELE(mp, udqp); 1121 xfs_qm_dqrele(udqp);
1120 XFS_QM_DQRELE(mp, gdqp); 1122 xfs_qm_dqrele(gdqp);
1121 1123
1122 if (code) 1124 if (code)
1123 return code; 1125 return code;
@@ -1131,8 +1133,8 @@ xfs_ioctl_setattr(
1131 return 0; 1133 return 0;
1132 1134
1133 error_return: 1135 error_return:
1134 XFS_QM_DQRELE(mp, udqp); 1136 xfs_qm_dqrele(udqp);
1135 XFS_QM_DQRELE(mp, gdqp); 1137 xfs_qm_dqrele(gdqp);
1136 xfs_trans_cancel(tp, 0); 1138 xfs_trans_cancel(tp, 0);
1137 if (lock_flags) 1139 if (lock_flags)
1138 xfs_iunlock(ip, lock_flags); 1140 xfs_iunlock(ip, lock_flags);