ocfs2: try to reuse extent block in dealloc without meta_alloc
[linux-2.6-block.git] / fs / ocfs2 / aops.c
index 256986aca8df66b34746b86d70a49af4977157ed..e8e205bf2e41402b8007cba21cd84b62827a4f72 100644 (file)
@@ -2332,6 +2332,12 @@ static int ocfs2_dio_end_io_write(struct inode *inode,
 
        ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh);
 
+       /* Attach dealloc with extent tree in case that we may reuse extents
+        * which are already unlinked from current extent tree due to extent
+        * rotation and merging.
+        */
+       et.et_dealloc = &dealloc;
+
        ret = ocfs2_lock_allocators(inode, &et, 0, dwc->dw_zero_count*2,
                                    &data_ac, &meta_ac);
        if (ret) {