aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c52
1 files changed, 22 insertions, 30 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index b8ad17e730b6..9a72c05b6177 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1025,7 +1025,6 @@ xfs_log_inode(
1025 */ 1025 */
1026 xfs_trans_ijoin(tp, ip); 1026 xfs_trans_ijoin(tp, ip);
1027 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 1027 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1028 xfs_trans_set_sync(tp);
1029 error = xfs_trans_commit(tp, 0); 1028 error = xfs_trans_commit(tp, 0);
1030 xfs_ilock_demote(ip, XFS_ILOCK_EXCL); 1029 xfs_ilock_demote(ip, XFS_ILOCK_EXCL);
1031 1030
@@ -1048,20 +1047,11 @@ xfs_fs_write_inode(
1048 1047
1049 if (wbc->sync_mode == WB_SYNC_ALL) { 1048 if (wbc->sync_mode == WB_SYNC_ALL) {
1050 /* 1049 /*
1051 * Make sure the inode has hit stable storage. By using the 1050 * Make sure the inode has made it it into the log. Instead
1052 * log and the fsync transactions we reduce the IOs we have 1051 * of forcing it all the way to stable storage using a
1053 * to do here from two (log and inode) to just the log. 1052 * synchronous transaction we let the log force inside the
1054 * 1053 * ->sync_fs call do that for thus, which reduces the number
1055 * Note: We still need to do a delwri write of the inode after 1054 * of synchronous log foces dramatically.
1056 * this to flush it to the backing buffer so that bulkstat
1057 * works properly if this is the first time the inode has been
1058 * written. Because we hold the ilock atomically over the
1059 * transaction commit and the inode flush we are guaranteed
1060 * that the inode is not pinned when it returns. If the flush
1061 * lock is already held, then the inode has already been
1062 * flushed once and we don't need to flush it again. Hence
1063 * the code will only flush the inode if it isn't already
1064 * being flushed.
1065 */ 1055 */
1066 xfs_ioend_wait(ip); 1056 xfs_ioend_wait(ip);
1067 xfs_ilock(ip, XFS_ILOCK_SHARED); 1057 xfs_ilock(ip, XFS_ILOCK_SHARED);
@@ -1075,27 +1065,29 @@ xfs_fs_write_inode(
1075 * We make this non-blocking if the inode is contended, return 1065 * We make this non-blocking if the inode is contended, return
1076 * EAGAIN to indicate to the caller that they did not succeed. 1066 * EAGAIN to indicate to the caller that they did not succeed.
1077 * This prevents the flush path from blocking on inodes inside 1067 * This prevents the flush path from blocking on inodes inside
1078 * another operation right now, they get caught later by xfs_sync. 1068 * another operation right now, they get caught later by
1069 * xfs_sync.
1079 */ 1070 */
1080 if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) 1071 if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED))
1081 goto out; 1072 goto out;
1082 }
1083 1073
1084 if (xfs_ipincount(ip) || !xfs_iflock_nowait(ip)) 1074 if (xfs_ipincount(ip) || !xfs_iflock_nowait(ip))
1085 goto out_unlock; 1075 goto out_unlock;
1086 1076
1087 /* 1077 /*
1088 * Now we have the flush lock and the inode is not pinned, we can check 1078 * Now we have the flush lock and the inode is not pinned, we
1089 * if the inode is really clean as we know that there are no pending 1079 * can check if the inode is really clean as we know that
1090 * transaction completions, it is not waiting on the delayed write 1080 * there are no pending transaction completions, it is not
1091 * queue and there is no IO in progress. 1081 * waiting on the delayed write queue and there is no IO in
1092 */ 1082 * progress.
1093 if (xfs_inode_clean(ip)) { 1083 */
1094 xfs_ifunlock(ip); 1084 if (xfs_inode_clean(ip)) {
1095 error = 0; 1085 xfs_ifunlock(ip);
1096 goto out_unlock; 1086 error = 0;
1087 goto out_unlock;
1088 }
1089 error = xfs_iflush(ip, 0);
1097 } 1090 }
1098 error = xfs_iflush(ip, 0);
1099 1091
1100 out_unlock: 1092 out_unlock:
1101 xfs_iunlock(ip, XFS_ILOCK_SHARED); 1093 xfs_iunlock(ip, XFS_ILOCK_SHARED);