aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-02-05 04:57:55 -0500
committerAlex Elder <aelder@sgi.com>2010-02-12 14:45:14 -0500
commit180040b89ee2aed88c0a0b1fcf7ada9a512b12e3 (patch)
treeddc3f6aead139aad5d5c5e0e786fb0b91090505a /fs/xfs
parent87185517de81101da5afbc82cefdeed6eeaa38fb (diff)
xfs: optimize log flushing in xfs_fsync
If we have a pinned inode it must have a log item attached to it. Usually that log item will have ili_last_lsn already set, in which case we only need to flush the log up to that LSN instead of doing a full log force. This gives speedups of about 5% in some fsync heavy workloads. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_vnodeops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 43241e289800..ddd2c5d1b854 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -629,8 +629,14 @@ xfs_fsync(
629 */ 629 */
630 xfs_iunlock(ip, XFS_ILOCK_SHARED); 630 xfs_iunlock(ip, XFS_ILOCK_SHARED);
631 if (xfs_ipincount(ip)) { 631 if (xfs_ipincount(ip)) {
632 error = _xfs_log_force(ip->i_mount, XFS_LOG_SYNC, 632 if (ip->i_itemp->ili_last_lsn) {
633 &log_flushed); 633 error = _xfs_log_force_lsn(ip->i_mount,
634 ip->i_itemp->ili_last_lsn,
635 XFS_LOG_SYNC, &log_flushed);
636 } else {
637 error = _xfs_log_force(ip->i_mount,
638 XFS_LOG_SYNC, &log_flushed);
639 }
634 } 640 }
635 } else { 641 } else {
636 /* 642 /*