aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-09-09 19:10:51 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-09-09 19:10:51 -0400
commit5dee54372c1ea15ab482b959634cda8c01b042bd (patch)
tree512da0144f6a9f86b5817569d0521b60cddee4c9 /fs
parent021b65bb1e4e4b625c80bbb82651e5e155721ef3 (diff)
ext4: rename ext4_count_free_blocks() to ext4_count_free_clusters()
This function really counts the free clusters reported in the block group descriptors, so rename it to reduce confusion. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/balloc.c11
-rw-r--r--fs/ext4/ext4.h2
-rw-r--r--fs/ext4/inode.c6
-rw-r--r--fs/ext4/super.c7
4 files changed, 14 insertions, 12 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 84dc3d62b40c..4f303809e076 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -524,12 +524,12 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
524} 524}
525 525
526/** 526/**
527 * ext4_count_free_blocks() -- count filesystem free blocks 527 * ext4_count_free_clusters() -- count filesystem free clusters
528 * @sb: superblock 528 * @sb: superblock
529 * 529 *
530 * Adds up the number of free blocks from each block group. 530 * Adds up the number of free clusters from each block group.
531 */ 531 */
532ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb) 532ext4_fsblk_t ext4_count_free_clusters(struct super_block *sb)
533{ 533{
534 ext4_fsblk_t desc_count; 534 ext4_fsblk_t desc_count;
535 struct ext4_group_desc *gdp; 535 struct ext4_group_desc *gdp;
@@ -562,8 +562,9 @@ ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb)
562 bitmap_count += x; 562 bitmap_count += x;
563 } 563 }
564 brelse(bitmap_bh); 564 brelse(bitmap_bh);
565 printk(KERN_DEBUG "ext4_count_free_blocks: stored = %llu" 565 printk(KERN_DEBUG "ext4_count_free_clusters: stored = %llu"
566 ", computed = %llu, %llu\n", ext4_free_blocks_count(es), 566 ", computed = %llu, %llu\n",
567 EXT4_B2C(sbi, ext4_free_blocks_count(es)),
567 desc_count, bitmap_count); 568 desc_count, bitmap_count);
568 return bitmap_count; 569 return bitmap_count;
569#else 570#else
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index db279c362017..f6963cd7f709 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1775,7 +1775,7 @@ extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
1775 int *errp); 1775 int *errp);
1776extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, 1776extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
1777 s64 nblocks, unsigned int flags); 1777 s64 nblocks, unsigned int flags);
1778extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *); 1778extern ext4_fsblk_t ext4_count_free_clusters(struct super_block *);
1779extern void ext4_check_blocks_bitmap(struct super_block *); 1779extern void ext4_check_blocks_bitmap(struct super_block *);
1780extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, 1780extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
1781 ext4_group_t block_group, 1781 ext4_group_t block_group,
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d1c17e47c1c6..f9198d7875cc 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1365,7 +1365,8 @@ static void ext4_print_free_blocks(struct inode *inode)
1365{ 1365{
1366 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); 1366 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
1367 printk(KERN_CRIT "Total free blocks count %lld\n", 1367 printk(KERN_CRIT "Total free blocks count %lld\n",
1368 ext4_count_free_blocks(inode->i_sb)); 1368 EXT4_C2B(EXT4_SB(inode->i_sb),
1369 ext4_count_free_clusters(inode->i_sb)));
1369 printk(KERN_CRIT "Free/Dirty block details\n"); 1370 printk(KERN_CRIT "Free/Dirty block details\n");
1370 printk(KERN_CRIT "free_blocks=%lld\n", 1371 printk(KERN_CRIT "free_blocks=%lld\n",
1371 (long long) EXT4_C2B(EXT4_SB(inode->i_sb), 1372 (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
@@ -1451,8 +1452,7 @@ static void mpage_da_map_and_submit(struct mpage_da_data *mpd)
1451 if (err == -EAGAIN) 1452 if (err == -EAGAIN)
1452 goto submit_io; 1453 goto submit_io;
1453 1454
1454 if (err == -ENOSPC && 1455 if (err == -ENOSPC && ext4_count_free_clusters(sb)) {
1455 ext4_count_free_blocks(sb)) {
1456 mpd->retval = err; 1456 mpd->retval = err;
1457 goto submit_io; 1457 goto submit_io;
1458 } 1458 }
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 30cf0e1bd89c..07f3de341452 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2153,7 +2153,8 @@ static int ext4_check_descriptors(struct super_block *sb,
2153 if (NULL != first_not_zeroed) 2153 if (NULL != first_not_zeroed)
2154 *first_not_zeroed = grp; 2154 *first_not_zeroed = grp;
2155 2155
2156 ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb)); 2156 ext4_free_blocks_count_set(sbi->s_es,
2157 EXT4_C2B(sbi, ext4_count_free_clusters(sb)));
2157 sbi->s_es->s_free_inodes_count =cpu_to_le32(ext4_count_free_inodes(sb)); 2158 sbi->s_es->s_free_inodes_count =cpu_to_le32(ext4_count_free_inodes(sb));
2158 return 1; 2159 return 1;
2159} 2160}
@@ -3577,7 +3578,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3577 sbi->s_err_report.data = (unsigned long) sb; 3578 sbi->s_err_report.data = (unsigned long) sb;
3578 3579
3579 err = percpu_counter_init(&sbi->s_freeclusters_counter, 3580 err = percpu_counter_init(&sbi->s_freeclusters_counter,
3580 ext4_count_free_blocks(sb)); 3581 ext4_count_free_clusters(sb));
3581 if (!err) { 3582 if (!err) {
3582 err = percpu_counter_init(&sbi->s_freeinodes_counter, 3583 err = percpu_counter_init(&sbi->s_freeinodes_counter,
3583 ext4_count_free_inodes(sb)); 3584 ext4_count_free_inodes(sb));
@@ -3703,7 +3704,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3703 * need to update the global counters. 3704 * need to update the global counters.
3704 */ 3705 */
3705 percpu_counter_set(&sbi->s_freeclusters_counter, 3706 percpu_counter_set(&sbi->s_freeclusters_counter,
3706 ext4_count_free_blocks(sb)); 3707 ext4_count_free_clusters(sb));
3707 percpu_counter_set(&sbi->s_freeinodes_counter, 3708 percpu_counter_set(&sbi->s_freeinodes_counter,
3708 ext4_count_free_inodes(sb)); 3709 ext4_count_free_inodes(sb));
3709 percpu_counter_set(&sbi->s_dirs_counter, 3710 percpu_counter_set(&sbi->s_dirs_counter,