forked from Minki/linux
xfs: kill the unused XFS_QMOPT_* flush flags V2
dquots are never flushed asynchronously. Remove the flag and the async write support from the flush function. Make the default flush a delwri flush to make the inode flush code, which leaves the XFS_QMOPT_SYNC the only flag remaining. Convert that to use SYNC_WAIT instead, just like the inode flush code. V2: - just pass flush flags straight through Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
7d6a7bde52
commit
20026d9201
@ -1187,7 +1187,7 @@ xfs_qm_dqflush(
|
|||||||
* block, nada.
|
* block, nada.
|
||||||
*/
|
*/
|
||||||
if (!XFS_DQ_IS_DIRTY(dqp) ||
|
if (!XFS_DQ_IS_DIRTY(dqp) ||
|
||||||
(!(flags & XFS_QMOPT_SYNC) && atomic_read(&dqp->q_pincount) > 0)) {
|
(!(flags & SYNC_WAIT) && atomic_read(&dqp->q_pincount) > 0)) {
|
||||||
xfs_dqfunlock(dqp);
|
xfs_dqfunlock(dqp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1251,18 +1251,17 @@ xfs_qm_dqflush(
|
|||||||
xfs_log_force(mp, 0);
|
xfs_log_force(mp, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & XFS_QMOPT_DELWRI) {
|
if (flags & SYNC_WAIT)
|
||||||
xfs_bdwrite(mp, bp);
|
|
||||||
} else {
|
|
||||||
error = xfs_bwrite(mp, bp);
|
error = xfs_bwrite(mp, bp);
|
||||||
}
|
else
|
||||||
|
xfs_bdwrite(mp, bp);
|
||||||
|
|
||||||
trace_xfs_dqflush_done(dqp);
|
trace_xfs_dqflush_done(dqp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dqp is still locked, but caller is free to unlock it now.
|
* dqp is still locked, but caller is free to unlock it now.
|
||||||
*/
|
*/
|
||||||
return (error);
|
return error;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1443,7 +1442,7 @@ xfs_qm_dqpurge(
|
|||||||
* We don't care about getting disk errors here. We need
|
* We don't care about getting disk errors here. We need
|
||||||
* to purge this dquot anyway, so we go ahead regardless.
|
* to purge this dquot anyway, so we go ahead regardless.
|
||||||
*/
|
*/
|
||||||
error = xfs_qm_dqflush(dqp, XFS_QMOPT_SYNC);
|
error = xfs_qm_dqflush(dqp, SYNC_WAIT);
|
||||||
if (error)
|
if (error)
|
||||||
xfs_fs_cmn_err(CE_WARN, mp,
|
xfs_fs_cmn_err(CE_WARN, mp,
|
||||||
"xfs_qm_dqpurge: dquot %p flush failed", dqp);
|
"xfs_qm_dqpurge: dquot %p flush failed", dqp);
|
||||||
|
@ -153,7 +153,7 @@ xfs_qm_dquot_logitem_push(
|
|||||||
* lock without sleeping, then there must not have been
|
* lock without sleeping, then there must not have been
|
||||||
* anyone in the process of flushing the dquot.
|
* anyone in the process of flushing the dquot.
|
||||||
*/
|
*/
|
||||||
error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI);
|
error = xfs_qm_dqflush(dqp, 0);
|
||||||
if (error)
|
if (error)
|
||||||
xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
|
xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
|
||||||
"xfs_qm_dquot_logitem_push: push error %d on dqp %p",
|
"xfs_qm_dquot_logitem_push: push error %d on dqp %p",
|
||||||
|
@ -450,7 +450,7 @@ xfs_qm_unmount_quotas(
|
|||||||
STATIC int
|
STATIC int
|
||||||
xfs_qm_dqflush_all(
|
xfs_qm_dqflush_all(
|
||||||
xfs_mount_t *mp,
|
xfs_mount_t *mp,
|
||||||
int flags)
|
int sync_mode)
|
||||||
{
|
{
|
||||||
int recl;
|
int recl;
|
||||||
xfs_dquot_t *dqp;
|
xfs_dquot_t *dqp;
|
||||||
@ -486,7 +486,7 @@ again:
|
|||||||
* across a disk write.
|
* across a disk write.
|
||||||
*/
|
*/
|
||||||
xfs_qm_mplist_unlock(mp);
|
xfs_qm_mplist_unlock(mp);
|
||||||
error = xfs_qm_dqflush(dqp, flags);
|
error = xfs_qm_dqflush(dqp, sync_mode);
|
||||||
xfs_dqunlock(dqp);
|
xfs_dqunlock(dqp);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
@ -926,13 +926,11 @@ xfs_qm_sync(
|
|||||||
{
|
{
|
||||||
int recl, restarts;
|
int recl, restarts;
|
||||||
xfs_dquot_t *dqp;
|
xfs_dquot_t *dqp;
|
||||||
uint flush_flags;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (!XFS_IS_QUOTA_RUNNING(mp) || !XFS_IS_QUOTA_ON(mp))
|
if (!XFS_IS_QUOTA_RUNNING(mp) || !XFS_IS_QUOTA_ON(mp))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
flush_flags = (flags & SYNC_WAIT) ? XFS_QMOPT_SYNC : XFS_QMOPT_DELWRI;
|
|
||||||
restarts = 0;
|
restarts = 0;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
@ -992,7 +990,7 @@ xfs_qm_sync(
|
|||||||
* across a disk write
|
* across a disk write
|
||||||
*/
|
*/
|
||||||
xfs_qm_mplist_unlock(mp);
|
xfs_qm_mplist_unlock(mp);
|
||||||
error = xfs_qm_dqflush(dqp, flush_flags);
|
error = xfs_qm_dqflush(dqp, flags);
|
||||||
xfs_dqunlock(dqp);
|
xfs_dqunlock(dqp);
|
||||||
if (error && XFS_FORCED_SHUTDOWN(mp))
|
if (error && XFS_FORCED_SHUTDOWN(mp))
|
||||||
return 0; /* Need to prevent umount failure */
|
return 0; /* Need to prevent umount failure */
|
||||||
@ -1796,7 +1794,7 @@ xfs_qm_quotacheck(
|
|||||||
* successfully.
|
* successfully.
|
||||||
*/
|
*/
|
||||||
if (!error)
|
if (!error)
|
||||||
error = xfs_qm_dqflush_all(mp, XFS_QMOPT_DELWRI);
|
error = xfs_qm_dqflush_all(mp, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We can get this error if we couldn't do a dquot allocation inside
|
* We can get this error if we couldn't do a dquot allocation inside
|
||||||
@ -2018,7 +2016,7 @@ xfs_qm_shake_freelist(
|
|||||||
* We flush it delayed write, so don't bother
|
* We flush it delayed write, so don't bother
|
||||||
* releasing the mplock.
|
* releasing the mplock.
|
||||||
*/
|
*/
|
||||||
error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI);
|
error = xfs_qm_dqflush(dqp, 0);
|
||||||
if (error) {
|
if (error) {
|
||||||
xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
|
xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
|
||||||
"xfs_qm_dqflush_all: dquot %p flush failed", dqp);
|
"xfs_qm_dqflush_all: dquot %p flush failed", dqp);
|
||||||
@ -2201,7 +2199,7 @@ xfs_qm_dqreclaim_one(void)
|
|||||||
* We flush it delayed write, so don't bother
|
* We flush it delayed write, so don't bother
|
||||||
* releasing the freelist lock.
|
* releasing the freelist lock.
|
||||||
*/
|
*/
|
||||||
error = xfs_qm_dqflush(dqp, XFS_QMOPT_DELWRI);
|
error = xfs_qm_dqflush(dqp, 0);
|
||||||
if (error) {
|
if (error) {
|
||||||
xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
|
xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
|
||||||
"xfs_qm_dqreclaim: dquot %p flush failed", dqp);
|
"xfs_qm_dqreclaim: dquot %p flush failed", dqp);
|
||||||
|
@ -222,16 +222,10 @@ typedef struct xfs_qoff_logformat {
|
|||||||
#define XFS_QMOPT_DELRTBCOUNT 0x0400000
|
#define XFS_QMOPT_DELRTBCOUNT 0x0400000
|
||||||
#define XFS_QMOPT_RES_INOS 0x0800000
|
#define XFS_QMOPT_RES_INOS 0x0800000
|
||||||
|
|
||||||
/*
|
|
||||||
* flags for dqflush and dqflush_all.
|
|
||||||
*/
|
|
||||||
#define XFS_QMOPT_SYNC 0x1000000
|
|
||||||
#define XFS_QMOPT_DELWRI 0x4000000
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flags for dqalloc.
|
* flags for dqalloc.
|
||||||
*/
|
*/
|
||||||
#define XFS_QMOPT_INHERIT 0x8000000
|
#define XFS_QMOPT_INHERIT 0x1000000
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flags to xfs_trans_mod_dquot.
|
* flags to xfs_trans_mod_dquot.
|
||||||
|
Loading…
Reference in New Issue
Block a user