ocfs2: Update i_blocks in reflink operations.
[safe/jmp/linux-2.6] / fs / ocfs2 / alloc.c
index 5661db1..9f8bd91 100644 (file)
@@ -1050,7 +1050,8 @@ static int ocfs2_create_new_meta_bhs(handle_t *handle,
                        strcpy(eb->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE);
                        eb->h_blkno = cpu_to_le64(first_blkno);
                        eb->h_fs_generation = cpu_to_le32(osb->fs_generation);
-                       eb->h_suballoc_slot = cpu_to_le16(osb->slot_num);
+                       eb->h_suballoc_slot =
+                               cpu_to_le16(meta_ac->ac_alloc_slot);
                        eb->h_suballoc_bit = cpu_to_le16(suballoc_bit_start);
                        eb->h_list.l_count =
                                cpu_to_le16(ocfs2_extent_recs_per_eb(osb->sb));
@@ -2398,7 +2399,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.
@@ -5712,7 +5713,7 @@ int ocfs2_remove_btree_range(struct inode *inode,
                goto out;
        }
 
-       vfs_dq_free_space_nodirty(inode,
+       dquot_free_space_nodirty(inode,
                                  ocfs2_clusters_to_bytes(inode->i_sb, len));
 
        ret = ocfs2_remove_extent(handle, et, cpos, len, meta_ac, dealloc);
@@ -6037,7 +6038,7 @@ static void ocfs2_truncate_log_worker(struct work_struct *work)
        if (status < 0)
                mlog_errno(status);
        else
-               ocfs2_init_inode_steal_slot(osb);
+               ocfs2_init_steal_slots(osb);
 
        mlog_exit(status);
 }
@@ -6935,7 +6936,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
                goto bail;
        }
 
-       vfs_dq_free_space_nodirty(inode,
+       dquot_free_space_nodirty(inode,
                        ocfs2_clusters_to_bytes(osb->sb, clusters_to_del));
        spin_lock(&OCFS2_I(inode)->ip_lock);
        OCFS2_I(inode)->ip_clusters = le32_to_cpu(fe->i_clusters) -
@@ -7190,8 +7191,8 @@ int ocfs2_zero_range_for_truncate(struct inode *inode, handle_t *handle,
         * wait on them - the truncate_inode_pages() call later will
         * do that for us.
         */
-       ret = do_sync_mapping_range(inode->i_mapping, range_start,
-                                   range_end - 1, SYNC_FILE_RANGE_WRITE);
+       ret = filemap_fdatawrite_range(inode->i_mapping, range_start,
+                                      range_end - 1);
        if (ret)
                mlog_errno(ret);
 
@@ -7300,11 +7301,10 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
                unsigned int page_end;
                u64 phys;
 
-               if (vfs_dq_alloc_space_nodirty(inode,
-                                      ocfs2_clusters_to_bytes(osb->sb, 1))) {
-                       ret = -EDQUOT;
+               ret = dquot_alloc_space_nodirty(inode,
+                                      ocfs2_clusters_to_bytes(osb->sb, 1));
+               if (ret)
                        goto out_commit;
-               }
                did_quota = 1;
 
                ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, &bit_off,
@@ -7380,7 +7380,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
 
 out_commit:
        if (ret < 0 && did_quota)
-               vfs_dq_free_space_nodirty(inode,
+               dquot_free_space_nodirty(inode,
                                          ocfs2_clusters_to_bytes(osb->sb, 1));
 
        ocfs2_commit_trans(osb, handle);