diff options
Diffstat (limited to 'fs/xfs/quota/xfs_dquot.c')
-rw-r--r-- | fs/xfs/quota/xfs_dquot.c | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index d7c7eea09fc2..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 | } |
@@ -1248,23 +1248,20 @@ xfs_qm_dqflush( | |||
1248 | */ | 1248 | */ |
1249 | if (XFS_BUF_ISPINNED(bp)) { | 1249 | if (XFS_BUF_ISPINNED(bp)) { |
1250 | trace_xfs_dqflush_force(dqp); | 1250 | trace_xfs_dqflush_force(dqp); |
1251 | xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); | 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 if (flags & XFS_QMOPT_ASYNC) { | ||
1257 | error = xfs_bawrite(mp, bp); | ||
1258 | } else { | ||
1259 | error = xfs_bwrite(mp, bp); | 1255 | error = xfs_bwrite(mp, bp); |
1260 | } | 1256 | else |
1257 | xfs_bdwrite(mp, bp); | ||
1261 | 1258 | ||
1262 | trace_xfs_dqflush_done(dqp); | 1259 | trace_xfs_dqflush_done(dqp); |
1263 | 1260 | ||
1264 | /* | 1261 | /* |
1265 | * 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. |
1266 | */ | 1263 | */ |
1267 | return (error); | 1264 | return error; |
1268 | 1265 | ||
1269 | } | 1266 | } |
1270 | 1267 | ||
@@ -1445,7 +1442,7 @@ xfs_qm_dqpurge( | |||
1445 | * We don't care about getting disk errors here. We need | 1442 | * We don't care about getting disk errors here. We need |
1446 | * to purge this dquot anyway, so we go ahead regardless. | 1443 | * to purge this dquot anyway, so we go ahead regardless. |
1447 | */ | 1444 | */ |
1448 | error = xfs_qm_dqflush(dqp, XFS_QMOPT_SYNC); | 1445 | error = xfs_qm_dqflush(dqp, SYNC_WAIT); |
1449 | if (error) | 1446 | if (error) |
1450 | xfs_fs_cmn_err(CE_WARN, mp, | 1447 | xfs_fs_cmn_err(CE_WARN, mp, |
1451 | "xfs_qm_dqpurge: dquot %p flush failed", dqp); | 1448 | "xfs_qm_dqpurge: dquot %p flush failed", dqp); |
@@ -1529,25 +1526,17 @@ xfs_qm_dqflock_pushbuf_wait( | |||
1529 | * the flush lock when the I/O completes. | 1526 | * the flush lock when the I/O completes. |
1530 | */ | 1527 | */ |
1531 | bp = xfs_incore(dqp->q_mount->m_ddev_targp, dqp->q_blkno, | 1528 | bp = xfs_incore(dqp->q_mount->m_ddev_targp, dqp->q_blkno, |
1532 | XFS_QI_DQCHUNKLEN(dqp->q_mount), | 1529 | XFS_QI_DQCHUNKLEN(dqp->q_mount), XBF_TRYLOCK); |
1533 | XFS_INCORE_TRYLOCK); | 1530 | if (!bp) |
1534 | if (bp != NULL) { | 1531 | goto out_lock; |
1535 | if (XFS_BUF_ISDELAYWRITE(bp)) { | 1532 | |
1536 | int error; | 1533 | if (XFS_BUF_ISDELAYWRITE(bp)) { |
1537 | if (XFS_BUF_ISPINNED(bp)) { | 1534 | if (XFS_BUF_ISPINNED(bp)) |
1538 | xfs_log_force(dqp->q_mount, | 1535 | xfs_log_force(dqp->q_mount, 0); |
1539 | (xfs_lsn_t)0, | 1536 | xfs_buf_delwri_promote(bp); |
1540 | XFS_LOG_FORCE); | 1537 | wake_up_process(bp->b_target->bt_task); |
1541 | } | ||
1542 | error = xfs_bawrite(dqp->q_mount, bp); | ||
1543 | if (error) | ||
1544 | xfs_fs_cmn_err(CE_WARN, dqp->q_mount, | ||
1545 | "xfs_qm_dqflock_pushbuf_wait: " | ||
1546 | "pushbuf error %d on dqp %p, bp %p", | ||
1547 | error, dqp, bp); | ||
1548 | } else { | ||
1549 | xfs_buf_relse(bp); | ||
1550 | } | ||
1551 | } | 1538 | } |
1539 | xfs_buf_relse(bp); | ||
1540 | out_lock: | ||
1552 | xfs_dqflock(dqp); | 1541 | xfs_dqflock(dqp); |
1553 | } | 1542 | } |