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>
This commit is contained in:
parent
021b65bb1e
commit
5dee54372c
|
@ -524,12 +524,12 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ext4_count_free_blocks() -- count filesystem free blocks
|
* ext4_count_free_clusters() -- count filesystem free clusters
|
||||||
* @sb: superblock
|
* @sb: superblock
|
||||||
*
|
*
|
||||||
* Adds up the number of free blocks from each block group.
|
* Adds up the number of free clusters from each block group.
|
||||||
*/
|
*/
|
||||||
ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb)
|
ext4_fsblk_t ext4_count_free_clusters(struct super_block *sb)
|
||||||
{
|
{
|
||||||
ext4_fsblk_t desc_count;
|
ext4_fsblk_t desc_count;
|
||||||
struct ext4_group_desc *gdp;
|
struct ext4_group_desc *gdp;
|
||||||
|
@ -562,8 +562,9 @@ ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb)
|
||||||
bitmap_count += x;
|
bitmap_count += x;
|
||||||
}
|
}
|
||||||
brelse(bitmap_bh);
|
brelse(bitmap_bh);
|
||||||
printk(KERN_DEBUG "ext4_count_free_blocks: stored = %llu"
|
printk(KERN_DEBUG "ext4_count_free_clusters: stored = %llu"
|
||||||
", computed = %llu, %llu\n", ext4_free_blocks_count(es),
|
", computed = %llu, %llu\n",
|
||||||
|
EXT4_B2C(sbi, ext4_free_blocks_count(es)),
|
||||||
desc_count, bitmap_count);
|
desc_count, bitmap_count);
|
||||||
return bitmap_count;
|
return bitmap_count;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1775,7 +1775,7 @@ extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
|
||||||
int *errp);
|
int *errp);
|
||||||
extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
|
extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
|
||||||
s64 nblocks, unsigned int flags);
|
s64 nblocks, unsigned int flags);
|
||||||
extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *);
|
extern ext4_fsblk_t ext4_count_free_clusters(struct super_block *);
|
||||||
extern void ext4_check_blocks_bitmap(struct super_block *);
|
extern void ext4_check_blocks_bitmap(struct super_block *);
|
||||||
extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
|
extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
|
||||||
ext4_group_t block_group,
|
ext4_group_t block_group,
|
||||||
|
|
|
@ -1365,7 +1365,8 @@ static void ext4_print_free_blocks(struct inode *inode)
|
||||||
{
|
{
|
||||||
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
|
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
|
||||||
printk(KERN_CRIT "Total free blocks count %lld\n",
|
printk(KERN_CRIT "Total free blocks count %lld\n",
|
||||||
ext4_count_free_blocks(inode->i_sb));
|
EXT4_C2B(EXT4_SB(inode->i_sb),
|
||||||
|
ext4_count_free_clusters(inode->i_sb)));
|
||||||
printk(KERN_CRIT "Free/Dirty block details\n");
|
printk(KERN_CRIT "Free/Dirty block details\n");
|
||||||
printk(KERN_CRIT "free_blocks=%lld\n",
|
printk(KERN_CRIT "free_blocks=%lld\n",
|
||||||
(long long) EXT4_C2B(EXT4_SB(inode->i_sb),
|
(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)
|
||||||
if (err == -EAGAIN)
|
if (err == -EAGAIN)
|
||||||
goto submit_io;
|
goto submit_io;
|
||||||
|
|
||||||
if (err == -ENOSPC &&
|
if (err == -ENOSPC && ext4_count_free_clusters(sb)) {
|
||||||
ext4_count_free_blocks(sb)) {
|
|
||||||
mpd->retval = err;
|
mpd->retval = err;
|
||||||
goto submit_io;
|
goto submit_io;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2153,7 +2153,8 @@ static int ext4_check_descriptors(struct super_block *sb,
|
||||||
if (NULL != first_not_zeroed)
|
if (NULL != first_not_zeroed)
|
||||||
*first_not_zeroed = grp;
|
*first_not_zeroed = grp;
|
||||||
|
|
||||||
ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb));
|
ext4_free_blocks_count_set(sbi->s_es,
|
||||||
|
EXT4_C2B(sbi, ext4_count_free_clusters(sb)));
|
||||||
sbi->s_es->s_free_inodes_count =cpu_to_le32(ext4_count_free_inodes(sb));
|
sbi->s_es->s_free_inodes_count =cpu_to_le32(ext4_count_free_inodes(sb));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -3577,7 +3578,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
sbi->s_err_report.data = (unsigned long) sb;
|
sbi->s_err_report.data = (unsigned long) sb;
|
||||||
|
|
||||||
err = percpu_counter_init(&sbi->s_freeclusters_counter,
|
err = percpu_counter_init(&sbi->s_freeclusters_counter,
|
||||||
ext4_count_free_blocks(sb));
|
ext4_count_free_clusters(sb));
|
||||||
if (!err) {
|
if (!err) {
|
||||||
err = percpu_counter_init(&sbi->s_freeinodes_counter,
|
err = percpu_counter_init(&sbi->s_freeinodes_counter,
|
||||||
ext4_count_free_inodes(sb));
|
ext4_count_free_inodes(sb));
|
||||||
|
@ -3703,7 +3704,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
* need to update the global counters.
|
* need to update the global counters.
|
||||||
*/
|
*/
|
||||||
percpu_counter_set(&sbi->s_freeclusters_counter,
|
percpu_counter_set(&sbi->s_freeclusters_counter,
|
||||||
ext4_count_free_blocks(sb));
|
ext4_count_free_clusters(sb));
|
||||||
percpu_counter_set(&sbi->s_freeinodes_counter,
|
percpu_counter_set(&sbi->s_freeinodes_counter,
|
||||||
ext4_count_free_inodes(sb));
|
ext4_count_free_inodes(sb));
|
||||||
percpu_counter_set(&sbi->s_dirs_counter,
|
percpu_counter_set(&sbi->s_dirs_counter,
|
||||||
|
|
Loading…
Reference in a new issue