aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_aops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_aops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 7b54461695e2..143ffc851c9d 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -56,8 +56,6 @@ xfs_count_page_state(
56 do { 56 do {
57 if (buffer_uptodate(bh) && !buffer_mapped(bh)) 57 if (buffer_uptodate(bh) && !buffer_mapped(bh))
58 (*unmapped) = 1; 58 (*unmapped) = 1;
59 else if (buffer_unwritten(bh) && !buffer_delay(bh))
60 clear_buffer_unwritten(bh);
61 else if (buffer_unwritten(bh)) 59 else if (buffer_unwritten(bh))
62 (*unwritten) = 1; 60 (*unwritten) = 1;
63 else if (buffer_delay(bh)) 61 else if (buffer_delay(bh))
@@ -249,7 +247,7 @@ xfs_map_blocks(
249 return -error; 247 return -error;
250} 248}
251 249
252STATIC inline int 250STATIC_INLINE int
253xfs_iomap_valid( 251xfs_iomap_valid(
254 xfs_iomap_t *iomapp, 252 xfs_iomap_t *iomapp,
255 loff_t offset) 253 loff_t offset)
@@ -1272,7 +1270,6 @@ __xfs_get_blocks(
1272 if (direct) 1270 if (direct)
1273 bh_result->b_private = inode; 1271 bh_result->b_private = inode;
1274 set_buffer_unwritten(bh_result); 1272 set_buffer_unwritten(bh_result);
1275 set_buffer_delay(bh_result);
1276 } 1273 }
1277 } 1274 }
1278 1275
@@ -1283,13 +1280,18 @@ __xfs_get_blocks(
1283 bh_result->b_bdev = iomap.iomap_target->bt_bdev; 1280 bh_result->b_bdev = iomap.iomap_target->bt_bdev;
1284 1281
1285 /* 1282 /*
1286 * If we previously allocated a block out beyond eof and we are 1283 * If we previously allocated a block out beyond eof and we are now
1287 * now coming back to use it then we will need to flag it as new 1284 * coming back to use it then we will need to flag it as new even if it
1288 * even if it has a disk address. 1285 * has a disk address.
1286 *
1287 * With sub-block writes into unwritten extents we also need to mark
1288 * the buffer as new so that the unwritten parts of the buffer gets
1289 * correctly zeroed.
1289 */ 1290 */
1290 if (create && 1291 if (create &&
1291 ((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) || 1292 ((!buffer_mapped(bh_result) && !buffer_uptodate(bh_result)) ||
1292 (offset >= i_size_read(inode)) || (iomap.iomap_flags & IOMAP_NEW))) 1293 (offset >= i_size_read(inode)) ||
1294 (iomap.iomap_flags & (IOMAP_NEW|IOMAP_UNWRITTEN))))
1293 set_buffer_new(bh_result); 1295 set_buffer_new(bh_result);
1294 1296
1295 if (iomap.iomap_flags & IOMAP_DELAY) { 1297 if (iomap.iomap_flags & IOMAP_DELAY) {