From f538d4da8d521746ca5ebf8c1a8105eb49bfb45e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 2 Nov 2005 10:26:59 +1100 Subject: [XFS] write barrier support Issue all log sync operations as ordered writes. In addition flush the disk cache on fsync if the sync cached operation didn't sync the log to disk (this requires some additional bookeping in the transaction and log code). If the device doesn't claim to support barriers, the filesystem has an extern log volume or the trial superblock write with barriers enabled failed we disable barriers and print a warning. We should probably fail the mount completely, but that could lead to nasty boot failures for the root filesystem. Not enabled by default yet, needs more destructive testing first. SGI-PV: 912426 SGI-Modid: xfs-linux:xfs-kern:198723a Signed-off-by: Christoph Hellwig Signed-off-by: Nathan Scott --- fs/xfs/xfs_trans.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'fs/xfs/xfs_trans.c') diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 92efe272b83d..5e33891b8049 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -661,10 +661,11 @@ xfs_trans_unreserve_and_mod_sb( */ /*ARGSUSED*/ int -xfs_trans_commit( +_xfs_trans_commit( xfs_trans_t *tp, uint flags, - xfs_lsn_t *commit_lsn_p) + xfs_lsn_t *commit_lsn_p, + int *log_flushed) { xfs_log_iovec_t *log_vector; int nvec; @@ -893,9 +894,11 @@ shut_us_down: * log out now and wait for it. */ if (sync) { - if (!error) - error = xfs_log_force(mp, commit_lsn, - XFS_LOG_FORCE | XFS_LOG_SYNC); + if (!error) { + error = _xfs_log_force(mp, commit_lsn, + XFS_LOG_FORCE | XFS_LOG_SYNC, + log_flushed); + } XFS_STATS_INC(xs_trans_sync); } else { XFS_STATS_INC(xs_trans_async); -- cgit v1.2.2