aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_buf.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-12 05:59:40 -0500
committerAlex Elder <aelder@sgi.com>2010-05-19 10:58:13 -0400
commit8c38366f99f83a7fa441e0c0669fefc18615e005 (patch)
tree05789fdea7c34b1b6f29151b6a13bd49f3c6fec9 /fs/xfs/linux-2.6/xfs_buf.c
parentdf308bcfec27e0c6bc83715dfd417caff5c33f19 (diff)
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/xfs/linux-2.6/xfs_buf.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c17
1 files changed, 6 insertions, 11 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(
1007 struct xfs_mount *mp, 1007 struct xfs_mount *mp,
1008 struct xfs_buf *bp) 1008 struct xfs_buf *bp)
1009{ 1009{
1010 int iowait = (bp->b_flags & XBF_ASYNC) == 0; 1010 int error;
1011 int error = 0;
1012 1011
1013 bp->b_strat = xfs_bdstrat_cb; 1012 bp->b_strat = xfs_bdstrat_cb;
1014 bp->b_mount = mp; 1013 bp->b_mount = mp;
1015 bp->b_flags |= XBF_WRITE; 1014 bp->b_flags |= XBF_WRITE;
1016 if (!iowait) 1015 bp->b_flags &= ~(XBF_ASYNC | XBF_READ);
1017 bp->b_flags |= _XBF_RUN_QUEUES;
1018 1016
1019 xfs_buf_delwri_dequeue(bp); 1017 xfs_buf_delwri_dequeue(bp);
1020 xfs_buf_iostrategy(bp); 1018 xfs_buf_iostrategy(bp);
1021 1019
1022 if (iowait) { 1020 error = xfs_buf_iowait(bp);
1023 error = xfs_buf_iowait(bp); 1021 if (error)
1024 if (error) 1022 xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
1025 xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR); 1023 xfs_buf_relse(bp);
1026 xfs_buf_relse(bp);
1027 }
1028
1029 return error; 1024 return error;
1030} 1025}
1031 1026