diff options
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r-- | fs/ocfs2/aops.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 530b1ff599c0..ed937fa9e4e3 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -1242,6 +1242,7 @@ static int ocfs2_write_cluster(struct address_space *mapping, | |||
1242 | int ret, i, new, should_zero = 0; | 1242 | int ret, i, new, should_zero = 0; |
1243 | u64 v_blkno, p_blkno; | 1243 | u64 v_blkno, p_blkno; |
1244 | struct inode *inode = mapping->host; | 1244 | struct inode *inode = mapping->host; |
1245 | struct ocfs2_extent_tree et; | ||
1245 | 1246 | ||
1246 | new = phys == 0 ? 1 : 0; | 1247 | new = phys == 0 ? 1 : 0; |
1247 | if (new || unwritten) | 1248 | if (new || unwritten) |
@@ -1276,10 +1277,11 @@ static int ocfs2_write_cluster(struct address_space *mapping, | |||
1276 | goto out; | 1277 | goto out; |
1277 | } | 1278 | } |
1278 | } else if (unwritten) { | 1279 | } else if (unwritten) { |
1279 | ret = ocfs2_mark_extent_written(inode, wc->w_di_bh, | 1280 | ocfs2_get_dinode_extent_tree(&et, inode, wc->w_di_bh); |
1281 | ret = ocfs2_mark_extent_written(inode, &et, | ||
1280 | wc->w_handle, cpos, 1, phys, | 1282 | wc->w_handle, cpos, 1, phys, |
1281 | meta_ac, &wc->w_dealloc, | 1283 | meta_ac, &wc->w_dealloc); |
1282 | OCFS2_DINODE_EXTENT, NULL); | 1284 | ocfs2_put_extent_tree(&et); |
1283 | if (ret < 0) { | 1285 | if (ret < 0) { |
1284 | mlog_errno(ret); | 1286 | mlog_errno(ret); |
1285 | goto out; | 1287 | goto out; |
@@ -1666,6 +1668,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping, | |||
1666 | struct ocfs2_alloc_context *data_ac = NULL; | 1668 | struct ocfs2_alloc_context *data_ac = NULL; |
1667 | struct ocfs2_alloc_context *meta_ac = NULL; | 1669 | struct ocfs2_alloc_context *meta_ac = NULL; |
1668 | handle_t *handle; | 1670 | handle_t *handle; |
1671 | struct ocfs2_extent_tree et; | ||
1669 | 1672 | ||
1670 | ret = ocfs2_alloc_write_ctxt(&wc, osb, pos, len, di_bh); | 1673 | ret = ocfs2_alloc_write_ctxt(&wc, osb, pos, len, di_bh); |
1671 | if (ret) { | 1674 | if (ret) { |
@@ -1719,10 +1722,11 @@ int ocfs2_write_begin_nolock(struct address_space *mapping, | |||
1719 | (long long)i_size_read(inode), le32_to_cpu(di->i_clusters), | 1722 | (long long)i_size_read(inode), le32_to_cpu(di->i_clusters), |
1720 | clusters_to_alloc, extents_to_split); | 1723 | clusters_to_alloc, extents_to_split); |
1721 | 1724 | ||
1722 | ret = ocfs2_lock_allocators(inode, wc->w_di_bh, &di->id2.i_list, | 1725 | ocfs2_get_dinode_extent_tree(&et, inode, wc->w_di_bh); |
1726 | ret = ocfs2_lock_allocators(inode, &et, | ||
1723 | clusters_to_alloc, extents_to_split, | 1727 | clusters_to_alloc, extents_to_split, |
1724 | &data_ac, &meta_ac, | 1728 | &data_ac, &meta_ac); |
1725 | OCFS2_DINODE_EXTENT, NULL); | 1729 | ocfs2_put_extent_tree(&et); |
1726 | if (ret) { | 1730 | if (ret) { |
1727 | mlog_errno(ret); | 1731 | mlog_errno(ret); |
1728 | goto out; | 1732 | goto out; |