]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/udf/balloc.c
Pull pvops into release branch
[linux-2.6-omap-h63xx.git] / fs / udf / balloc.c
index f855dcbbdfb854e1704566ae0cebd187c656c45f..2bb788a2acb16bf24ab25a708390e58842f06116 100644 (file)
@@ -149,8 +149,7 @@ static bool udf_add_free_space(struct udf_sb_info *sbi,
                return false;
 
        lvid = (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data;
-       lvid->freeSpaceTable[partition] = cpu_to_le32(le32_to_cpu(
-                                       lvid->freeSpaceTable[partition]) + cnt);
+       le32_add_cpu(&lvid->freeSpaceTable[partition], cnt);
        return true;
 }
 
@@ -207,7 +206,7 @@ static void udf_bitmap_free_blocks(struct super_block *sb,
                                        ((char *)bh->b_data)[(bit + i) >> 3]);
                        } else {
                                if (inode)
-                                       DQUOT_FREE_BLOCK(inode, 1);
+                                       vfs_dq_free_block(inode, 1);
                                udf_add_free_space(sbi, sbi->s_partition, 1);
                        }
                }
@@ -262,11 +261,11 @@ static int udf_bitmap_prealloc_blocks(struct super_block *sb,
                while (bit < (sb->s_blocksize << 3) && block_count > 0) {
                        if (!udf_test_bit(bit, bh->b_data))
                                goto out;
-                       else if (DQUOT_PREALLOC_BLOCK(inode, 1))
+                       else if (vfs_dq_prealloc_block(inode, 1))
                                goto out;
                        else if (!udf_clear_bit(bit, bh->b_data)) {
                                udf_debug("bit already cleared for block %d\n", bit);
-                               DQUOT_FREE_BLOCK(inode, 1);
+                               vfs_dq_free_block(inode, 1);
                                goto out;
                        }
                        block_count--;
@@ -394,7 +393,7 @@ got_block:
        /*
         * Check quota for allocation of this block.
         */
-       if (inode && DQUOT_ALLOC_BLOCK(inode, 1)) {
+       if (inode && vfs_dq_alloc_block(inode, 1)) {
                mutex_unlock(&sbi->s_alloc_mutex);
                *err = -EDQUOT;
                return 0;
@@ -453,7 +452,7 @@ static void udf_table_free_blocks(struct super_block *sb,
        /* We do this up front - There are some error conditions that
           could occure, but.. oh well */
        if (inode)
-               DQUOT_FREE_BLOCK(inode, count);
+               vfs_dq_free_block(inode, count);
        if (udf_add_free_space(sbi, sbi->s_partition, count))
                mark_buffer_dirty(sbi->s_lvid_bh);
 
@@ -589,10 +588,8 @@ static void udf_table_free_blocks(struct super_block *sb,
                                        sptr = oepos.bh->b_data + epos.offset;
                                        aed = (struct allocExtDesc *)
                                                oepos.bh->b_data;
-                                       aed->lengthAllocDescs =
-                                               cpu_to_le32(le32_to_cpu(
-                                                       aed->lengthAllocDescs) +
-                                                               adsize);
+                                       le32_add_cpu(&aed->lengthAllocDescs,
+                                                       adsize);
                                } else {
                                        sptr = iinfo->i_ext.i_data +
                                                                epos.offset;
@@ -645,9 +642,7 @@ static void udf_table_free_blocks(struct super_block *sb,
                                mark_inode_dirty(table);
                        } else {
                                aed = (struct allocExtDesc *)epos.bh->b_data;
-                               aed->lengthAllocDescs =
-                                       cpu_to_le32(le32_to_cpu(
-                                           aed->lengthAllocDescs) + adsize);
+                               le32_add_cpu(&aed->lengthAllocDescs, adsize);
                                udf_update_tag(epos.bh->b_data, epos.offset);
                                mark_buffer_dirty(epos.bh);
                        }
@@ -705,7 +700,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb,
                epos.offset -= adsize;
 
                alloc_count = (elen >> sb->s_blocksize_bits);
-               if (inode && DQUOT_PREALLOC_BLOCK(inode,
+               if (inode && vfs_dq_prealloc_block(inode,
                        alloc_count > block_count ? block_count : alloc_count))
                        alloc_count = 0;
                else if (alloc_count > block_count) {
@@ -811,7 +806,7 @@ static int udf_table_new_block(struct super_block *sb,
        goal_eloc.logicalBlockNum++;
        goal_elen -= sb->s_blocksize;
 
-       if (inode && DQUOT_ALLOC_BLOCK(inode, 1)) {
+       if (inode && vfs_dq_alloc_block(inode, 1)) {
                brelse(goal_epos.bh);
                mutex_unlock(&sbi->s_alloc_mutex);
                *err = -EDQUOT;