aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 4d982dc8b86..ec7bbb5645b 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -626,9 +626,7 @@ xfs_map_at_offset(
626 ASSERT(imap->br_startblock != HOLESTARTBLOCK); 626 ASSERT(imap->br_startblock != HOLESTARTBLOCK);
627 ASSERT(imap->br_startblock != DELAYSTARTBLOCK); 627 ASSERT(imap->br_startblock != DELAYSTARTBLOCK);
628 628
629 lock_buffer(bh);
630 xfs_map_buffer(inode, bh, imap, offset); 629 xfs_map_buffer(inode, bh, imap, offset);
631 bh->b_bdev = xfs_find_bdev_for_inode(inode);
632 set_buffer_mapped(bh); 630 set_buffer_mapped(bh);
633 clear_buffer_delay(bh); 631 clear_buffer_delay(bh);
634 clear_buffer_unwritten(bh); 632 clear_buffer_unwritten(bh);
@@ -751,12 +749,8 @@ xfs_convert_page(
751 continue; 749 continue;
752 } 750 }
753 751
754 ASSERT(imap->br_startblock != HOLESTARTBLOCK); 752 lock_buffer(bh);
755 ASSERT(imap->br_startblock != DELAYSTARTBLOCK); 753 if (type != IO_OVERWRITE)
756
757 if (type == IO_OVERWRITE)
758 lock_buffer(bh);
759 else
760 xfs_map_at_offset(inode, bh, imap, offset); 754 xfs_map_at_offset(inode, bh, imap, offset);
761 xfs_add_to_ioend(inode, bh, offset, type, 755 xfs_add_to_ioend(inode, bh, offset, type,
762 ioendp, done); 756 ioendp, done);
@@ -1041,9 +1035,8 @@ xfs_vm_writepage(
1041 imap_valid = xfs_imap_valid(inode, &imap, offset); 1035 imap_valid = xfs_imap_valid(inode, &imap, offset);
1042 } 1036 }
1043 if (imap_valid) { 1037 if (imap_valid) {
1044 if (type == IO_OVERWRITE) 1038 lock_buffer(bh);
1045 lock_buffer(bh); 1039 if (type != IO_OVERWRITE)
1046 else
1047 xfs_map_at_offset(inode, bh, &imap, offset); 1040 xfs_map_at_offset(inode, bh, &imap, offset);
1048 xfs_add_to_ioend(inode, bh, offset, type, &ioend, 1041 xfs_add_to_ioend(inode, bh, offset, type, &ioend,
1049 new_ioend); 1042 new_ioend);