diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-19 14:40:13 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-19 14:40:13 -0400 |
| commit | a78feb7c8a0687913f9869c05811054595a42a76 (patch) | |
| tree | b89ceba977943e58475e28cf6acd6377a8d84320 /fs/xfs/xfs_vnodeops.c | |
| parent | 91fe7d7cdd7ebb0b6c01f201a23824ab5b466ada (diff) | |
| parent | b394e43e995d08821588a22561c6a71a63b4ff27 (diff) | |
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
[XFS] Avoid replaying inode buffer initialisation log items if on-disk version is newer.
[XFS] Ensure file size updates have been completed before writing inode to disk.
[XFS] On-demand reaping of the MRU cache
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
| -rw-r--r-- | fs/xfs/xfs_vnodeops.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 1a5ad8cd97b0..603459229904 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
| @@ -1082,6 +1082,9 @@ xfs_fsync( | |||
| 1082 | if (XFS_FORCED_SHUTDOWN(ip->i_mount)) | 1082 | if (XFS_FORCED_SHUTDOWN(ip->i_mount)) |
| 1083 | return XFS_ERROR(EIO); | 1083 | return XFS_ERROR(EIO); |
| 1084 | 1084 | ||
| 1085 | if (flag & FSYNC_DATA) | ||
| 1086 | filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping); | ||
| 1087 | |||
| 1085 | /* | 1088 | /* |
| 1086 | * We always need to make sure that the required inode state | 1089 | * We always need to make sure that the required inode state |
| 1087 | * is safe on disk. The vnode might be clean but because | 1090 | * is safe on disk. The vnode might be clean but because |
| @@ -3769,12 +3772,16 @@ xfs_inode_flush( | |||
| 3769 | sync_lsn = log->l_last_sync_lsn; | 3772 | sync_lsn = log->l_last_sync_lsn; |
| 3770 | GRANT_UNLOCK(log, s); | 3773 | GRANT_UNLOCK(log, s); |
| 3771 | 3774 | ||
| 3772 | if ((XFS_LSN_CMP(iip->ili_last_lsn, sync_lsn) <= 0)) | 3775 | if ((XFS_LSN_CMP(iip->ili_last_lsn, sync_lsn) > 0)) { |
| 3773 | return 0; | 3776 | if (flags & FLUSH_SYNC) |
| 3777 | log_flags |= XFS_LOG_SYNC; | ||
| 3778 | error = xfs_log_force(mp, iip->ili_last_lsn, log_flags); | ||
| 3779 | if (error) | ||
| 3780 | return error; | ||
| 3781 | } | ||
| 3774 | 3782 | ||
| 3775 | if (flags & FLUSH_SYNC) | 3783 | if (ip->i_update_core == 0) |
| 3776 | log_flags |= XFS_LOG_SYNC; | 3784 | return 0; |
| 3777 | return xfs_log_force(mp, iip->ili_last_lsn, log_flags); | ||
| 3778 | } | 3785 | } |
| 3779 | } | 3786 | } |
| 3780 | 3787 | ||
| @@ -3788,9 +3795,6 @@ xfs_inode_flush( | |||
| 3788 | if (flags & FLUSH_INODE) { | 3795 | if (flags & FLUSH_INODE) { |
| 3789 | int flush_flags; | 3796 | int flush_flags; |
| 3790 | 3797 | ||
| 3791 | if (xfs_ipincount(ip)) | ||
| 3792 | return EAGAIN; | ||
| 3793 | |||
| 3794 | if (flags & FLUSH_SYNC) { | 3798 | if (flags & FLUSH_SYNC) { |
| 3795 | xfs_ilock(ip, XFS_ILOCK_SHARED); | 3799 | xfs_ilock(ip, XFS_ILOCK_SHARED); |
| 3796 | xfs_iflock(ip); | 3800 | xfs_iflock(ip); |
