ext4: rename ext4_claim_free_blocks() to ext4_claim_free_clusters()
authorTheodore Ts'o <tytso@mit.edu>
Fri, 9 Sep 2011 23:14:51 +0000 (19:14 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 9 Sep 2011 23:14:51 +0000 (19:14 -0400)
This function really claims a number of free clusters, not blocks, so
rename it so it's clearer what's going on.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/balloc.c
fs/ext4/ext4.h
fs/ext4/inode.c
fs/ext4/mballoc.c

index 3d07c35c70892318bb7409b4853c0ffeabc664ee..af0c5357e35a4a4dbbd2f68973f6c75ffb0cfba5 100644 (file)
@@ -445,11 +445,11 @@ static int ext4_has_free_blocks(struct ext4_sb_info *sbi,
        return 0;
 }
 
-int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
-                          s64 nblocks, unsigned int flags)
+int ext4_claim_free_clusters(struct ext4_sb_info *sbi,
+                            s64 nclusters, unsigned int flags)
 {
-       if (ext4_has_free_blocks(sbi, nblocks, flags)) {
-               percpu_counter_add(&sbi->s_dirtyclusters_counter, nblocks);
+       if (ext4_has_free_blocks(sbi, nclusters, flags)) {
+               percpu_counter_add(&sbi->s_dirtyclusters_counter, nclusters);
                return 0;
        } else
                return -ENOSPC;
index 1473c06e4c94f23a9e7b61488bb9e313ecbc64f5..f97638634e3499f5caf2e1e4bf07750779fb5150 100644 (file)
@@ -1773,8 +1773,8 @@ extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
                                         unsigned int flags,
                                         unsigned long *count,
                                         int *errp);
-extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
-                                 s64 nblocks, unsigned int flags);
+extern int ext4_claim_free_clusters(struct ext4_sb_info *sbi,
+                                   s64 nclusters, unsigned int flags);
 extern ext4_fsblk_t ext4_count_free_clusters(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,
index f9198d7875cc167be413b892014e3e104df98b4b..557c34ffa05bf5d908be09f55562f28ac0c4a607 100644 (file)
@@ -1071,7 +1071,7 @@ repeat:
         * We do still charge estimated metadata to the sb though;
         * we cannot afford to run out of free blocks.
         */
-       if (ext4_claim_free_blocks(sbi, md_needed + 1, 0)) {
+       if (ext4_claim_free_clusters(sbi, md_needed + 1, 0)) {
                dquot_release_reservation_block(inode, EXT4_C2B(sbi, 1));
                if (ext4_should_retry_alloc(inode->i_sb, &retries)) {
                        yield();
index 90a3ed7c565c2b1c7db61e0adc9a6812c67ee42a..1c83161090f805417e3607d47d76bad8cfd62b33 100644 (file)
@@ -4297,7 +4297,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
                 * and verify allocation doesn't exceed the quota limits.
                 */
                while (ar->len &&
-                       ext4_claim_free_blocks(sbi, ar->len, ar->flags)) {
+                       ext4_claim_free_clusters(sbi, ar->len, ar->flags)) {
 
                        /* let others to free the space */
                        yield();