tree-wide: fix assorted typos all over the place
[safe/jmp/linux-2.6] / fs / ocfs2 / alloc.c
index b8fc95d..7c7198a 100644 (file)
@@ -2326,10 +2326,18 @@ static int ocfs2_extend_rotate_transaction(handle_t *handle, int subtree_depth,
                                           int op_credits,
                                           struct ocfs2_path *path)
 {
+       int ret;
        int credits = (path->p_tree_depth - subtree_depth) * 2 + 1 + op_credits;
 
-       if (handle->h_buffer_credits < credits)
-               return ocfs2_extend_trans(handle, credits);
+       if (handle->h_buffer_credits < credits) {
+               ret = ocfs2_extend_trans(handle,
+                                        credits - handle->h_buffer_credits);
+               if (ret)
+                       return ret;
+
+               if (unlikely(handle->h_buffer_credits < credits))
+                       return ocfs2_extend_trans(handle, credits);
+       }
 
        return 0;
 }
@@ -2390,7 +2398,7 @@ static int ocfs2_leftmost_rec_contains(struct ocfs2_extent_list *el, u32 cpos)
  *
  * The array is assumed to be large enough to hold an entire path (tree depth).
  *
- * Upon succesful return from this function:
+ * Upon successful return from this function:
  *
  * - The 'right_path' array will contain a path to the leaf block
  *   whose range contains e_cpos.
@@ -6974,7 +6982,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
                                        ocfs2_blocks_to_clusters(osb->sb,
                                                                 delete_blk),
                                        clusters_to_del, meta_ac,
-                                       &tc->tc_dealloc);
+                                       &tc->tc_dealloc, 1);
                else
                        status = ocfs2_truncate_log_append(osb, handle,
                                                           delete_blk,