diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-02-29 13:53:55 +0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-03-14 02:18:14 +0400 |
commit | 8f639ddea0c4978ae9b4e46ea041c9e5afe0ee8d (patch) | |
tree | d2b90c868fd3ad818317e3fff8448d6940afb3d5 /fs/xfs/xfs_file.c | |
parent | f5d8d5c4bf29c9f7754d9cbe5e27c785106ba872 (diff) | |
download | linux-8f639ddea0c4978ae9b4e46ea041c9e5afe0ee8d.tar.xz |
xfs: reimplement fdatasync support
Add an in-memory only flag to say we logged timestamps only, and use it to
check if fdatasync can optimize away the log force.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 78d8b0299592..54a67dd9ac0a 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -197,8 +197,11 @@ xfs_file_fsync( * to flush the log up to the latest LSN that touched the inode. */ xfs_ilock(ip, XFS_ILOCK_SHARED); - if (xfs_ipincount(ip)) - lsn = ip->i_itemp->ili_last_lsn; + if (xfs_ipincount(ip)) { + if (!datasync || + (ip->i_itemp->ili_fields & ~XFS_ILOG_TIMESTAMP)) + lsn = ip->i_itemp->ili_last_lsn; + } xfs_iunlock(ip, XFS_ILOCK_SHARED); if (lsn) |