aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/balloc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-05 16:20:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-05 16:20:53 -0500
commite213e26ab3988c516c06eba4dcd030ac052f6dc9 (patch)
tree6e26fbdbb842b387697d73daf6e70cf718269a77 /fs/udf/balloc.c
parentc812a51d11bbe983f4c24e32b59b265705ddd3c2 (diff)
parentefd8f0e6f6c1faa041f228d7113bd3a9db802d49 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (33 commits) quota: stop using QUOTA_OK / NO_QUOTA dquot: cleanup dquot initialize routine dquot: move dquot initialization responsibility into the filesystem dquot: cleanup dquot drop routine dquot: move dquot drop responsibility into the filesystem dquot: cleanup dquot transfer routine dquot: move dquot transfer responsibility into the filesystem dquot: cleanup inode allocation / freeing routines dquot: cleanup space allocation / freeing routines ext3: add writepage sanity checks ext3: Truncate allocated blocks if direct IO write fails to update i_size quota: Properly invalidate caches even for filesystems with blocksize < pagesize quota: generalize quota transfer interface quota: sb_quota state flags cleanup jbd: Delay discarding buffers in journal_unmap_buffer ext3: quota_write cross block boundary behaviour quota: drop permission checks from xfs_fs_set_xstate/xfs_fs_set_xquota quota: split out compat_sys_quotactl support from quota.c quota: split out netlink notification support from quota.c quota: remove invalid optimization from quota_sync_all ... Fixed trivial conflicts in fs/namei.c and fs/ufs/inode.c
Diffstat (limited to 'fs/udf/balloc.c')
-rw-r--r--fs/udf/balloc.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index b2d96f45c12b..ccc3ad7242d4 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -208,7 +208,7 @@ static void udf_bitmap_free_blocks(struct super_block *sb,
208 ((char *)bh->b_data)[(bit + i) >> 3]); 208 ((char *)bh->b_data)[(bit + i) >> 3]);
209 } else { 209 } else {
210 if (inode) 210 if (inode)
211 vfs_dq_free_block(inode, 1); 211 dquot_free_block(inode, 1);
212 udf_add_free_space(sb, sbi->s_partition, 1); 212 udf_add_free_space(sb, sbi->s_partition, 1);
213 } 213 }
214 } 214 }
@@ -260,11 +260,11 @@ static int udf_bitmap_prealloc_blocks(struct super_block *sb,
260 while (bit < (sb->s_blocksize << 3) && block_count > 0) { 260 while (bit < (sb->s_blocksize << 3) && block_count > 0) {
261 if (!udf_test_bit(bit, bh->b_data)) 261 if (!udf_test_bit(bit, bh->b_data))
262 goto out; 262 goto out;
263 else if (vfs_dq_prealloc_block(inode, 1)) 263 else if (dquot_prealloc_block(inode, 1))
264 goto out; 264 goto out;
265 else if (!udf_clear_bit(bit, bh->b_data)) { 265 else if (!udf_clear_bit(bit, bh->b_data)) {
266 udf_debug("bit already cleared for block %d\n", bit); 266 udf_debug("bit already cleared for block %d\n", bit);
267 vfs_dq_free_block(inode, 1); 267 dquot_free_block(inode, 1);
268 goto out; 268 goto out;
269 } 269 }
270 block_count--; 270 block_count--;
@@ -390,10 +390,14 @@ got_block:
390 /* 390 /*
391 * Check quota for allocation of this block. 391 * Check quota for allocation of this block.
392 */ 392 */
393 if (inode && vfs_dq_alloc_block(inode, 1)) { 393 if (inode) {
394 mutex_unlock(&sbi->s_alloc_mutex); 394 int ret = dquot_alloc_block(inode, 1);
395 *err = -EDQUOT; 395
396 return 0; 396 if (ret) {
397 mutex_unlock(&sbi->s_alloc_mutex);
398 *err = ret;
399 return 0;
400 }
397 } 401 }
398 402
399 newblock = bit + (block_group << (sb->s_blocksize_bits + 3)) - 403 newblock = bit + (block_group << (sb->s_blocksize_bits + 3)) -
@@ -449,7 +453,7 @@ static void udf_table_free_blocks(struct super_block *sb,
449 /* We do this up front - There are some error conditions that 453 /* We do this up front - There are some error conditions that
450 could occure, but.. oh well */ 454 could occure, but.. oh well */
451 if (inode) 455 if (inode)
452 vfs_dq_free_block(inode, count); 456 dquot_free_block(inode, count);
453 udf_add_free_space(sb, sbi->s_partition, count); 457 udf_add_free_space(sb, sbi->s_partition, count);
454 458
455 start = bloc->logicalBlockNum + offset; 459 start = bloc->logicalBlockNum + offset;
@@ -694,7 +698,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb,
694 epos.offset -= adsize; 698 epos.offset -= adsize;
695 699
696 alloc_count = (elen >> sb->s_blocksize_bits); 700 alloc_count = (elen >> sb->s_blocksize_bits);
697 if (inode && vfs_dq_prealloc_block(inode, 701 if (inode && dquot_prealloc_block(inode,
698 alloc_count > block_count ? block_count : alloc_count)) 702 alloc_count > block_count ? block_count : alloc_count))
699 alloc_count = 0; 703 alloc_count = 0;
700 else if (alloc_count > block_count) { 704 else if (alloc_count > block_count) {
@@ -797,12 +801,13 @@ static int udf_table_new_block(struct super_block *sb,
797 newblock = goal_eloc.logicalBlockNum; 801 newblock = goal_eloc.logicalBlockNum;
798 goal_eloc.logicalBlockNum++; 802 goal_eloc.logicalBlockNum++;
799 goal_elen -= sb->s_blocksize; 803 goal_elen -= sb->s_blocksize;
800 804 if (inode) {
801 if (inode && vfs_dq_alloc_block(inode, 1)) { 805 *err = dquot_alloc_block(inode, 1);
802 brelse(goal_epos.bh); 806 if (*err) {
803 mutex_unlock(&sbi->s_alloc_mutex); 807 brelse(goal_epos.bh);
804 *err = -EDQUOT; 808 mutex_unlock(&sbi->s_alloc_mutex);
805 return 0; 809 return 0;
810 }
806 } 811 }
807 812
808 if (goal_elen) 813 if (goal_elen)