aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index ca67ae92c23..1ace78bfbea 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1051,6 +1051,8 @@ xfs_vm_writepage(
1051 type = IO_NEW; 1051 type = IO_NEW;
1052 1052
1053 do { 1053 do {
1054 int new_ioend = 0;
1055
1054 if (offset >= end_offset) 1056 if (offset >= end_offset)
1055 break; 1057 break;
1056 if (!buffer_uptodate(bh)) 1058 if (!buffer_uptodate(bh))
@@ -1071,8 +1073,6 @@ xfs_vm_writepage(
1071 imap_valid = xfs_imap_valid(inode, &imap, offset); 1073 imap_valid = xfs_imap_valid(inode, &imap, offset);
1072 1074
1073 if (buffer_unwritten(bh) || buffer_delay(bh)) { 1075 if (buffer_unwritten(bh) || buffer_delay(bh)) {
1074 int new_ioend = 0;
1075
1076 if (buffer_unwritten(bh)) { 1076 if (buffer_unwritten(bh)) {
1077 if (type != IO_UNWRITTEN) { 1077 if (type != IO_UNWRITTEN) {
1078 type = IO_UNWRITTEN; 1078 type = IO_UNWRITTEN;
@@ -1124,6 +1124,7 @@ xfs_vm_writepage(
1124 imap_valid = 0; 1124 imap_valid = 0;
1125 } 1125 }
1126 if (!imap_valid) { 1126 if (!imap_valid) {
1127 new_ioend = 1;
1127 size = xfs_probe_cluster(inode, page, bh, head); 1128 size = xfs_probe_cluster(inode, page, bh, head);
1128 err = xfs_map_blocks(inode, offset, size, 1129 err = xfs_map_blocks(inode, offset, size,
1129 &imap, flags); 1130 &imap, flags);
@@ -1142,14 +1143,12 @@ xfs_vm_writepage(
1142 * that we are writing into for the first time. 1143 * that we are writing into for the first time.
1143 */ 1144 */
1144 type = IO_NEW; 1145 type = IO_NEW;
1145 if (trylock_buffer(bh)) { 1146 if (imap_valid) {
1146 if (imap_valid) 1147 all_bh = 1;
1147 all_bh = 1; 1148 lock_buffer(bh);
1148 xfs_add_to_ioend(inode, bh, offset, type, 1149 xfs_add_to_ioend(inode, bh, offset, type,
1149 &ioend, !imap_valid); 1150 &ioend, new_ioend);
1150 count++; 1151 count++;
1151 } else {
1152 imap_valid = 0;
1153 } 1152 }
1154 } else if (PageUptodate(page)) { 1153 } else if (PageUptodate(page)) {
1155 ASSERT(buffer_mapped(bh)); 1154 ASSERT(buffer_mapped(bh));