]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ocfs2/aops.c
ocfs2: Prefix the extent tree operations structure.
[karo-tx-linux.git] / fs / ocfs2 / aops.c
index a53da1466277abd843b0117f89df9850423ba92b..530b1ff599c0be7c17002e9cff716c48c75cfcee 100644 (file)
@@ -1255,10 +1255,10 @@ static int ocfs2_write_cluster(struct address_space *mapping,
                 * any additional semaphores or cluster locks.
                 */
                tmp_pos = cpos;
-               ret = ocfs2_do_extend_allocation(OCFS2_SB(inode->i_sb), inode,
-                                                &tmp_pos, 1, 0, wc->w_di_bh,
-                                                wc->w_handle, data_ac,
-                                                meta_ac, NULL);
+               ret = ocfs2_add_inode_data(OCFS2_SB(inode->i_sb), inode,
+                                          &tmp_pos, 1, 0, wc->w_di_bh,
+                                          wc->w_handle, data_ac,
+                                          meta_ac, NULL);
                /*
                 * This shouldn't happen because we must have already
                 * calculated the correct meta data allocation required. The
@@ -1278,7 +1278,8 @@ static int ocfs2_write_cluster(struct address_space *mapping,
        } else if (unwritten) {
                ret = ocfs2_mark_extent_written(inode, wc->w_di_bh,
                                                wc->w_handle, cpos, 1, phys,
-                                               meta_ac, &wc->w_dealloc);
+                                               meta_ac, &wc->w_dealloc,
+                                               OCFS2_DINODE_EXTENT, NULL);
                if (ret < 0) {
                        mlog_errno(ret);
                        goto out;
@@ -1712,14 +1713,23 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
                 * ocfs2_lock_allocators(). It greatly over-estimates
                 * the work to be done.
                 */
-               ret = ocfs2_lock_allocators(inode, di, clusters_to_alloc,
-                                           extents_to_split, &data_ac, &meta_ac);
+               mlog(0, "extend inode %llu, i_size = %lld, di->i_clusters = %u,"
+                    " clusters_to_add = %u, extents_to_split = %u\n",
+                    (unsigned long long)OCFS2_I(inode)->ip_blkno,
+                    (long long)i_size_read(inode), le32_to_cpu(di->i_clusters),
+                    clusters_to_alloc, extents_to_split);
+
+               ret = ocfs2_lock_allocators(inode, wc->w_di_bh, &di->id2.i_list,
+                                           clusters_to_alloc, extents_to_split,
+                                           &data_ac, &meta_ac,
+                                           OCFS2_DINODE_EXTENT, NULL);
                if (ret) {
                        mlog_errno(ret);
                        goto out;
                }
 
-               credits = ocfs2_calc_extend_credits(inode->i_sb, di,
+               credits = ocfs2_calc_extend_credits(inode->i_sb,
+                                                   &di->id2.i_list,
                                                    clusters_to_alloc);
 
        }