aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/quota/xfs_dquot.c13
-rw-r--r--fs/xfs/quota/xfs_dquot_item.c2
-rw-r--r--fs/xfs/quota/xfs_qm.c14
-rw-r--r--fs/xfs/xfs_quota.h8
4 files changed, 14 insertions, 23 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
index 1620a56b067e..5f79dd78626b 100644
--- a/fs/xfs/quota/xfs_dquot.c
+++ b/fs/xfs/quota/xfs_dquot.c
@@ -1187,7 +1187,7 @@ xfs_qm_dqflush(
1187 * block, nada. 1187 * block, nada.
1188 */ 1188 */
1189 if (!XFS_DQ_IS_DIRTY(dqp) || 1189 if (!XFS_DQ_IS_DIRTY(dqp) ||
1190 (!(flags & XFS_QMOPT_SYNC) && atomic_read(&dqp->q_pincount) > 0)) { 1190 (!(flags & SYNC_WAIT) && atomic_read(&dqp->q_pincount) > 0)) {
1191 xfs_dqfunlock(dqp); 1191 xfs_dqfunlock(dqp);
1192 return 0; 1192 return 0;
1193 } 1193 }
@@ -1251,18 +1251,17 @@ xfs_qm_dqflush(
1251 xfs_log_force(mp, 0); 1251 xfs_log_force(mp, 0);
1252 } 1252 }
1253 1253
1254 if (flags & XFS_QMOPT_DELWRI) { 1254 if (flags & SYNC_WAIT)
1255 xfs_bdwrite(mp, bp);
1256 } else {
1257 error = xfs_bwrite(mp, bp); 1255 error = xfs_bwrite(mp, bp);
1258 } 1256 else
1257 xfs_bdwrite(mp, bp);
1259 1258
1260 trace_xfs_dqflush_done(dqp); 1259 trace_xfs_dqflush_done(dqp);
1261 1260
1262 /* 1261 /*
1263 * dqp is still locked, but caller is free to unlock it now. 1262 * dqp is still locked, but caller is free to unlock it now.
1264 */ 1263 */
1265 return (error); 1264 return error;
1266 1265
1267} 1266}
1268 1267
@@ -1443,7 +1442,7 @@ xfs_qm_dqpurge(
1443 * We don't care about getting disk errors here. We need 1442 * We don't care about getting disk errors here. We need
1444 * to purge this dquot anyway, so we go ahead regardless. 1443 * to purge this dquot anyway, so we go ahead regardless.
1445 */ 1444 */
1446 error = xfs_qm_dqflush(dqp, XFS_QMOPT_SYNC); 1445 error = xfs_qm_dqflush(dqp, SYNC_WAIT);
1447 if (error) 1446 if (error)
1448 xfs_fs_cmn_err(CE_WARN, mp, 1447 xfs_fs_cmn_err(CE_WARN, mp,
1449 "xfs_qm_dqpurge: dquot %p flush failed", dqp); 1448 "xfs_qm_dqpurge: dquot %p flush failed", dqp);
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c
index dda0fb045c8a..4e4ee9a57194 100644
--- a/fs/xfs/quota/xfs_dquot_item.c
+++ b/fs/xfs/quota/xfs_dquot_item.c
@@ -153,7 +153,7 @@ xfs_qm_dquot_logitem_push(
153 * lock without sleeping, then there must not have been 153 * lock without sleeping, then there must not have been
154 * anyone in the process of flushing the dquot. 154 * anyone in the process of flushing the dquot.
155 */ 155 */
156 error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI); 156 error = xfs_qm_dqflush(dqp, 0);
157 if (error) 157 if (error)
158 xfs_fs_cmn_err(CE_WARN, dqp->q_mount, 158 xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
159 "xfs_qm_dquot_logitem_push: push error %d on dqp %p", 159 "xfs_qm_dquot_logitem_push: push error %d on dqp %p",
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 11cfd8245c7c..8699e51cb45e 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -450,7 +450,7 @@ xfs_qm_unmount_quotas(
450STATIC int 450STATIC int
451xfs_qm_dqflush_all( 451xfs_qm_dqflush_all(
452 xfs_mount_t *mp, 452 xfs_mount_t *mp,
453 int flags) 453 int sync_mode)
454{ 454{
455 int recl; 455 int recl;
456 xfs_dquot_t *dqp; 456 xfs_dquot_t *dqp;
@@ -486,7 +486,7 @@ again:
486 * across a disk write. 486 * across a disk write.
487 */ 487 */
488 xfs_qm_mplist_unlock(mp); 488 xfs_qm_mplist_unlock(mp);
489 error = xfs_qm_dqflush(dqp, flags); 489 error = xfs_qm_dqflush(dqp, sync_mode);
490 xfs_dqunlock(dqp); 490 xfs_dqunlock(dqp);
491 if (error) 491 if (error)
492 return error; 492 return error;
@@ -926,13 +926,11 @@ xfs_qm_sync(
926{ 926{
927 int recl, restarts; 927 int recl, restarts;
928 xfs_dquot_t *dqp; 928 xfs_dquot_t *dqp;
929 uint flush_flags;
930 int error; 929 int error;
931 930
932 if (!XFS_IS_QUOTA_RUNNING(mp) || !XFS_IS_QUOTA_ON(mp)) 931 if (!XFS_IS_QUOTA_RUNNING(mp) || !XFS_IS_QUOTA_ON(mp))
933 return 0; 932 return 0;
934 933
935 flush_flags = (flags & SYNC_WAIT) ? XFS_QMOPT_SYNC : XFS_QMOPT_DELWRI;
936 restarts = 0; 934 restarts = 0;
937 935
938 again: 936 again:
@@ -992,7 +990,7 @@ xfs_qm_sync(
992 * across a disk write 990 * across a disk write
993 */ 991 */
994 xfs_qm_mplist_unlock(mp); 992 xfs_qm_mplist_unlock(mp);
995 error = xfs_qm_dqflush(dqp, flush_flags); 993 error = xfs_qm_dqflush(dqp, flags);
996 xfs_dqunlock(dqp); 994 xfs_dqunlock(dqp);
997 if (error && XFS_FORCED_SHUTDOWN(mp)) 995 if (error && XFS_FORCED_SHUTDOWN(mp))
998 return 0; /* Need to prevent umount failure */ 996 return 0; /* Need to prevent umount failure */
@@ -1796,7 +1794,7 @@ xfs_qm_quotacheck(
1796 * successfully. 1794 * successfully.
1797 */ 1795 */
1798 if (!error) 1796 if (!error)
1799 error = xfs_qm_dqflush_all(mp, XFS_QMOPT_DELWRI); 1797 error = xfs_qm_dqflush_all(mp, 0);
1800 1798
1801 /* 1799 /*
1802 * We can get this error if we couldn't do a dquot allocation inside 1800 * We can get this error if we couldn't do a dquot allocation inside
@@ -2018,7 +2016,7 @@ xfs_qm_shake_freelist(
2018 * We flush it delayed write, so don't bother 2016 * We flush it delayed write, so don't bother
2019 * releasing the mplock. 2017 * releasing the mplock.
2020 */ 2018 */
2021 error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI); 2019 error = xfs_qm_dqflush(dqp, 0);
2022 if (error) { 2020 if (error) {
2023 xfs_fs_cmn_err(CE_WARN, dqp->q_mount, 2021 xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
2024 "xfs_qm_dqflush_all: dquot %p flush failed", dqp); 2022 "xfs_qm_dqflush_all: dquot %p flush failed", dqp);
@@ -2201,7 +2199,7 @@ xfs_qm_dqreclaim_one(void)
2201 * We flush it delayed write, so don't bother 2199 * We flush it delayed write, so don't bother
2202 * releasing the freelist lock. 2200 * releasing the freelist lock.
2203 */ 2201 */
2204 error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI); 2202 error = xfs_qm_dqflush(dqp, 0);
2205 if (error) { 2203 if (error) {
2206 xfs_fs_cmn_err(CE_WARN, dqp->q_mount, 2204 xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
2207 "xfs_qm_dqreclaim: dquot %p flush failed", dqp); 2205 "xfs_qm_dqreclaim: dquot %p flush failed", dqp);
diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h
index 21d11d9f48f2..fdcab3f81dde 100644
--- a/fs/xfs/xfs_quota.h
+++ b/fs/xfs/xfs_quota.h
@@ -223,15 +223,9 @@ typedef struct xfs_qoff_logformat {
223#define XFS_QMOPT_RES_INOS 0x0800000 223#define XFS_QMOPT_RES_INOS 0x0800000
224 224
225/* 225/*
226 * flags for dqflush and dqflush_all.
227 */
228#define XFS_QMOPT_SYNC 0x1000000
229#define XFS_QMOPT_DELWRI 0x4000000
230
231/*
232 * flags for dqalloc. 226 * flags for dqalloc.
233 */ 227 */
234#define XFS_QMOPT_INHERIT 0x8000000 228#define XFS_QMOPT_INHERIT 0x1000000
235 229
236/* 230/*
237 * flags to xfs_trans_mod_dquot. 231 * flags to xfs_trans_mod_dquot.