git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
fs
/
ext2
/
balloc.c
diff --git
a/fs/ext2/balloc.c
b/fs/ext2/balloc.c
index
f5a6b33
..
5fbe1ca
100644
(file)
--- a/
fs/ext2/balloc.c
+++ b/
fs/ext2/balloc.c
@@
-16,6
+16,8
@@
#include <linux/quotaops.h>
#include <linux/sched.h>
#include <linux/buffer_head.h>
#include <linux/quotaops.h>
#include <linux/sched.h>
#include <linux/buffer_head.h>
+#include <linux/vs_base.h>
+#include <linux/vs_dlimit.h>
/*
* balloc.c contains the blocks allocation and deallocation routines
/*
* balloc.c contains the blocks allocation and deallocation routines
@@
-88,8
+90,8
@@
read_block_bitmap(struct super_block *sb, unsigned int block_group)
if (!bh)
ext2_error (sb, "read_block_bitmap",
"Cannot read block bitmap - "
if (!bh)
ext2_error (sb, "read_block_bitmap",
"Cannot read block bitmap - "
- "block_group = %d, block_bitmap = %
l
u",
- block_group,
(unsigned long) desc->bg_block_bitmap
);
+ "block_group = %d, block_bitmap = %u",
+ block_group,
le32_to_cpu(desc->bg_block_bitmap)
);
error_out:
return bh;
}
error_out:
return bh;
}
@@
-108,6
+110,8
@@
static int reserve_blocks(struct super_block *sb, int count)
free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
root_blocks = le32_to_cpu(es->s_r_blocks_count);
free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
root_blocks = le32_to_cpu(es->s_r_blocks_count);
+ DLIMIT_ADJUST_BLOCK(sb, vx_current_xid(), &free_blocks, &root_blocks);
+
if (free_blocks < count)
count = free_blocks;
if (free_blocks < count)
count = free_blocks;
@@
-258,6
+262,7
@@
do_more:
}
error_return:
brelse(bitmap_bh);
}
error_return:
brelse(bitmap_bh);
+ DLIMIT_FREE_BLOCK(sb, inode->i_xid, freed);
release_blocks(sb, freed);
DQUOT_FREE_BLOCK(inode, freed);
}
release_blocks(sb, freed);
DQUOT_FREE_BLOCK(inode, freed);
}
@@
-361,6
+366,10
@@
int ext2_new_block(struct inode *inode, unsigned long goal,
*err = -ENOSPC;
goto out_dquot;
}
*err = -ENOSPC;
goto out_dquot;
}
+ if (DLIMIT_ALLOC_BLOCK(sb, inode->i_xid, es_alloc)) {
+ *err = -ENOSPC;
+ goto out_dlimit;
+ }
ext2_debug ("goal=%lu.\n", goal);
ext2_debug ("goal=%lu.\n", goal);
@@
-508,6
+517,8
@@
got_block:
*err = 0;
out_release:
group_release_blocks(sb, group_no, desc, gdp_bh, group_alloc);
*err = 0;
out_release:
group_release_blocks(sb, group_no, desc, gdp_bh, group_alloc);
+ DLIMIT_FREE_BLOCK(sb, inode->i_xid, es_alloc);
+out_dlimit:
release_blocks(sb, es_alloc);
out_dquot:
DQUOT_FREE_BLOCK(inode, dq_alloc);
release_blocks(sb, es_alloc);
out_dquot:
DQUOT_FREE_BLOCK(inode, dq_alloc);