summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig2010-03-12 11:59:40 +0100
committerAlex Elder2010-05-19 16:58:13 +0200
commit8c38366f99f83a7fa441e0c0669fefc18615e005 (patch)
tree05789fdea7c34b1b6f29151b6a13bd49f3c6fec9 /fs
parentxfs: remove periodic superblock writeback (diff)
downloadkernel-qcow2-linux-8c38366f99f83a7fa441e0c0669fefc18615e005.tar.gz
kernel-qcow2-linux-8c38366f99f83a7fa441e0c0669fefc18615e005.tar.xz
kernel-qcow2-linux-8c38366f99f83a7fa441e0c0669fefc18615e005.zip
xfs: enforce synchronous writes in xfs_bwrite
xfs_bwrite is used with the intention of synchronously writing out buffers, but currently it does not actually clear the async flag if that's left from previous writes but instead implements async behaviour if it finds it. Remove the code handling asynchronous writes as we've got rid of those entirely outside of the log and delwri buffers, and make sure that we clear the async and read flags before writing the buffer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c17
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c1
2 files changed, 6 insertions, 12 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index f7ecc44cbbd3..f01de3c55c43 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1007,25 +1007,20 @@ xfs_bwrite(
struct xfs_mount *mp,
struct xfs_buf *bp)
{
- int iowait = (bp->b_flags & XBF_ASYNC) == 0;
- int error = 0;
+ int error;
bp->b_strat = xfs_bdstrat_cb;
bp->b_mount = mp;
bp->b_flags |= XBF_WRITE;
- if (!iowait)
- bp->b_flags |= _XBF_RUN_QUEUES;
+ bp->b_flags &= ~(XBF_ASYNC | XBF_READ);
xfs_buf_delwri_dequeue(bp);
xfs_buf_iostrategy(bp);
- if (iowait) {
- error = xfs_buf_iowait(bp);
- if (error)
- xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
- xfs_buf_relse(bp);
- }
-
+ error = xfs_buf_iowait(bp);
+ if (error)
+ xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
+ xfs_buf_relse(bp);
return error;
}
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index 728db015f39c..3884e20bc14e 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -372,7 +372,6 @@ xfs_sync_fsdata(
if (XFS_BUF_ISPINNED(bp))
xfs_log_force(mp, 0);
- XFS_BUF_UNASYNC(bp);
return xfs_bwrite(mp, bp);
}