Push BKL down into ->remount_fs()
[safe/jmp/linux-2.6] / fs / ext2 / balloc.c
index 6dac7ba..7f8d2e5 100644 (file)
@@ -570,7 +570,7 @@ do_more:
 error_return:
        brelse(bitmap_bh);
        release_blocks(sb, freed);
-       DQUOT_FREE_BLOCK(inode, freed);
+       vfs_dq_free_block(inode, freed);
 }
 
 /**
@@ -1193,7 +1193,7 @@ static int ext2_has_free_blocks(struct ext2_sb_info *sbi)
        free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
        root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
        if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) &&
-               sbi->s_resuid != current->fsuid &&
+               sbi->s_resuid != current_fsuid() &&
                (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
                return 0;
        }
@@ -1247,7 +1247,7 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
        /*
         * Check quota for allocation of this block.
         */
-       if (DQUOT_ALLOC_BLOCK(inode, num)) {
+       if (vfs_dq_alloc_block(inode, num)) {
                *errp = -EDQUOT;
                return 0;
        }
@@ -1409,7 +1409,7 @@ allocated:
 
        *errp = 0;
        brelse(bitmap_bh);
-       DQUOT_FREE_BLOCK(inode, *count-num);
+       vfs_dq_free_block(inode, *count-num);
        *count = num;
        return ret_block;
 
@@ -1420,7 +1420,7 @@ out:
         * Undo the block allocation
         */
        if (!performed_allocation)
-               DQUOT_FREE_BLOCK(inode, *count);
+               vfs_dq_free_block(inode, *count);
        brelse(bitmap_bh);
        return 0;
 }