aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/balloc.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-09-09 18:56:51 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-09-09 18:56:51 -0400
commit5704265188ffe4290ed73b3cb685206c3ed8209d (patch)
tree6bc51bea59625b2a7c8e4b74bbb66884371f74dd /fs/ext4/balloc.c
parent0aa060000e83ca3d09ddc446a7174fb0820d99bc (diff)
ext4: convert s_{dirty,free}blocks_counter to s_{dirty,free}clusters_counter
Convert the percpu counters s_dirtyblocks_counter and s_freeblocks_counter in struct ext4_super_info to be s_dirtyclusters_counter and s_freeclusters_counter. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r--fs/ext4/balloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 89abf1f7b253..9080a857cda9 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -414,16 +414,16 @@ static int ext4_has_free_blocks(struct ext4_sb_info *sbi,
414 s64 nblocks, unsigned int flags) 414 s64 nblocks, unsigned int flags)
415{ 415{
416 s64 free_blocks, dirty_blocks, root_blocks; 416 s64 free_blocks, dirty_blocks, root_blocks;
417 struct percpu_counter *fbc = &sbi->s_freeblocks_counter; 417 struct percpu_counter *fcc = &sbi->s_freeclusters_counter;
418 struct percpu_counter *dbc = &sbi->s_dirtyblocks_counter; 418 struct percpu_counter *dbc = &sbi->s_dirtyclusters_counter;
419 419
420 free_blocks = percpu_counter_read_positive(fbc); 420 free_blocks = percpu_counter_read_positive(fcc);
421 dirty_blocks = percpu_counter_read_positive(dbc); 421 dirty_blocks = percpu_counter_read_positive(dbc);
422 root_blocks = ext4_r_blocks_count(sbi->s_es); 422 root_blocks = ext4_r_blocks_count(sbi->s_es);
423 423
424 if (free_blocks - (nblocks + root_blocks + dirty_blocks) < 424 if (free_blocks - (nblocks + root_blocks + dirty_blocks) <
425 EXT4_FREEBLOCKS_WATERMARK) { 425 EXT4_FREEBLOCKS_WATERMARK) {
426 free_blocks = percpu_counter_sum_positive(fbc); 426 free_blocks = EXT4_C2B(sbi, percpu_counter_sum_positive(fcc));
427 dirty_blocks = percpu_counter_sum_positive(dbc); 427 dirty_blocks = percpu_counter_sum_positive(dbc);
428 } 428 }
429 /* Check whether we have space after 429 /* Check whether we have space after
@@ -449,7 +449,7 @@ int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
449 s64 nblocks, unsigned int flags) 449 s64 nblocks, unsigned int flags)
450{ 450{
451 if (ext4_has_free_blocks(sbi, nblocks, flags)) { 451 if (ext4_has_free_blocks(sbi, nblocks, flags)) {
452 percpu_counter_add(&sbi->s_dirtyblocks_counter, nblocks); 452 percpu_counter_add(&sbi->s_dirtyclusters_counter, nblocks);
453 return 0; 453 return 0;
454 } else 454 } else
455 return -ENOSPC; 455 return -ENOSPC;