From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 21/23] ext4: rename ext4_claim_free_blocks() to ext4_claim_free_clusters()
Date: Wed, 6 Jul 2011 12:36:04 -0400 [thread overview]
Message-ID: <1309970166-11770-22-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1309970166-11770-1-git-send-email-tytso@mit.edu>
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 | 8 ++++----
fs/ext4/ext4.h | 4 ++--
fs/ext4/inode.c | 2 +-
fs/ext4/mballoc.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 3d07c35..af0c535 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -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;
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index b18c6d5..8d2e34f 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1758,8 +1758,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,
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 1cbad80..4a68531 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1038,7 +1038,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();
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 33cdc81..ace05a4 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4265,7 +4265,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();
--
1.7.4.1.22.gec8e1.dirty
next prev parent reply other threads:[~2011-07-06 16:36 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 16:35 [PATCH 00/23] New spin of the bigalloc patches Theodore Ts'o
2011-07-06 16:35 ` [PATCH 01/23] ext4: read-only support for bigalloc file systems Theodore Ts'o
2011-07-06 16:35 ` [PATCH 02/23] ext4: enforce bigalloc restrictions (e.g., no online resizing, etc.) Theodore Ts'o
2011-09-28 12:55 ` [02/23] " Ted Ts'o
2011-07-06 16:35 ` [PATCH 03/23] ext4: convert instances of EXT4_BLOCKS_PER_GROUP to EXT4_CLUSTERS_PER_GROUP Theodore Ts'o
2011-07-06 16:35 ` [PATCH 04/23] ext4: factor out block group accounting into functions Theodore Ts'o
2011-07-06 16:35 ` [PATCH 05/23] ext4: split out ext4_free_blocks_after_init() Theodore Ts'o
2011-07-06 16:35 ` [PATCH 06/23] ext4: bigalloc changes to block bitmap initialization functions Theodore Ts'o
2011-07-06 16:35 ` [PATCH 07/23] ext4: convert block group-relative offsets to use clusters Theodore Ts'o
2011-07-06 16:35 ` [PATCH 08/23] ext4: teach mballoc preallocation code about bigalloc clusters Theodore Ts'o
2011-07-06 16:35 ` [PATCH 09/23] ext4: teach ext4_free_blocks() about bigalloc and clusters Theodore Ts'o
2011-07-06 16:35 ` [PATCH 10/23] ext4: teach ext4_ext_map_blocks() about the bigalloc feature Theodore Ts'o
2011-07-06 16:35 ` [PATCH 11/23] ext4: teach ext4_ext_truncate() " Theodore Ts'o
2011-07-06 16:35 ` [PATCH 12/23] ext4: convert s_{dirty,free}blocks_counter to s_{dirty,free}clusters_counter Theodore Ts'o
2011-07-06 22:59 ` Andreas Dilger
2011-07-08 22:41 ` Ted Ts'o
2011-07-06 16:35 ` [PATCH 13/23] ext4: convert the free_blocks field in s_flex_groups to be free_clusters Theodore Ts'o
2011-07-06 16:35 ` [PATCH 14/23] ext4: teach ext4_statfs() to deal with clusters if bigalloc is enabled Theodore Ts'o
2011-07-06 22:58 ` Andreas Dilger
2011-07-08 22:40 ` Ted Ts'o
2011-07-06 16:35 ` [PATCH 15/23] ext4: tune mballoc's default group prealloc size for bigalloc file systems Theodore Ts'o
2011-07-06 16:35 ` [PATCH 16/23] ext4: Fix bigalloc quota accounting and i_blocks value Theodore Ts'o
2011-07-06 16:36 ` [PATCH 17/23] ext4: enable mounting bigalloc as read/write Theodore Ts'o
2011-07-06 16:36 ` [PATCH 18/23] ext4: Rename ext4_free_blks_{count,set}() to refer to clusters Theodore Ts'o
2011-07-06 23:06 ` Andreas Dilger
2011-07-08 22:42 ` Ted Ts'o
2011-07-06 16:36 ` [PATCH 19/23] ext4: rename ext4_count_free_blocks() to ext4_count_free_clusters() Theodore Ts'o
2011-07-06 16:36 ` [PATCH 20/23] ext4: rename ext4_free_blocks_after_init() to ext4_free_clusters_after_init() Theodore Ts'o
2011-07-06 16:36 ` Theodore Ts'o [this message]
2011-07-06 16:36 ` [PATCH 22/23] ext4: rename ext4_has_free_blocks() to ext4_has_free_clusters() Theodore Ts'o
2011-07-06 16:36 ` [PATCH 23/23] ext4: add some tracepoints in ext4/extents.c Theodore Ts'o
2011-07-06 18:12 ` Eric Gouriou
2011-07-08 23:20 ` Ted Ts'o
2011-07-08 23:02 ` bigalloc performance stats (was Re: [PATCH 00/23] New spin of the bigalloc patches) Ted Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309970166-11770-22-git-send-email-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).