diff options
Diffstat (limited to 'fs/ext2/balloc.c')
-rw-r--r-- | fs/ext2/balloc.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 7f8d2e5a7ea6..3cf038c055d7 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include "ext2.h" | 14 | #include "ext2.h" |
15 | #include <linux/quotaops.h> | 15 | #include <linux/quotaops.h> |
16 | #include <linux/slab.h> | ||
16 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
17 | #include <linux/buffer_head.h> | 18 | #include <linux/buffer_head.h> |
18 | #include <linux/capability.h> | 19 | #include <linux/capability.h> |
@@ -570,7 +571,7 @@ do_more: | |||
570 | error_return: | 571 | error_return: |
571 | brelse(bitmap_bh); | 572 | brelse(bitmap_bh); |
572 | release_blocks(sb, freed); | 573 | release_blocks(sb, freed); |
573 | vfs_dq_free_block(inode, freed); | 574 | dquot_free_block(inode, freed); |
574 | } | 575 | } |
575 | 576 | ||
576 | /** | 577 | /** |
@@ -1236,6 +1237,7 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal, | |||
1236 | unsigned short windowsz = 0; | 1237 | unsigned short windowsz = 0; |
1237 | unsigned long ngroups; | 1238 | unsigned long ngroups; |
1238 | unsigned long num = *count; | 1239 | unsigned long num = *count; |
1240 | int ret; | ||
1239 | 1241 | ||
1240 | *errp = -ENOSPC; | 1242 | *errp = -ENOSPC; |
1241 | sb = inode->i_sb; | 1243 | sb = inode->i_sb; |
@@ -1247,8 +1249,9 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal, | |||
1247 | /* | 1249 | /* |
1248 | * Check quota for allocation of this block. | 1250 | * Check quota for allocation of this block. |
1249 | */ | 1251 | */ |
1250 | if (vfs_dq_alloc_block(inode, num)) { | 1252 | ret = dquot_alloc_block(inode, num); |
1251 | *errp = -EDQUOT; | 1253 | if (ret) { |
1254 | *errp = ret; | ||
1252 | return 0; | 1255 | return 0; |
1253 | } | 1256 | } |
1254 | 1257 | ||
@@ -1409,7 +1412,7 @@ allocated: | |||
1409 | 1412 | ||
1410 | *errp = 0; | 1413 | *errp = 0; |
1411 | brelse(bitmap_bh); | 1414 | brelse(bitmap_bh); |
1412 | vfs_dq_free_block(inode, *count-num); | 1415 | dquot_free_block(inode, *count-num); |
1413 | *count = num; | 1416 | *count = num; |
1414 | return ret_block; | 1417 | return ret_block; |
1415 | 1418 | ||
@@ -1420,7 +1423,7 @@ out: | |||
1420 | * Undo the block allocation | 1423 | * Undo the block allocation |
1421 | */ | 1424 | */ |
1422 | if (!performed_allocation) | 1425 | if (!performed_allocation) |
1423 | vfs_dq_free_block(inode, *count); | 1426 | dquot_free_block(inode, *count); |
1424 | brelse(bitmap_bh); | 1427 | brelse(bitmap_bh); |
1425 | return 0; | 1428 | return 0; |
1426 | } | 1429 | } |