Patchwork [2/5] mke2fs: the -g option will now specify the clusters per block group

login
register
mail settings
Submitter Theodore Ts'o
Date Jan. 15, 2013, 12:37 a.m.
Message ID <1358210232-30578-2-git-send-email-tytso@mit.edu>
Download mbox | patch
Permalink /patch/211960/
State Accepted
Headers show

Comments

Theodore Ts'o - Jan. 15, 2013, 12:37 a.m.
If bigalloc is enabled, then -g will specify the clusters per block
group.  (If bigalloc is not enabled, then a cluster == a block, so the
meaning of -g is not changed.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 misc/mke2fs.c | 9 +++++++++
 1 file changed, 9 insertions(+)
Eric Sandeen - Jan. 15, 2013, 3:10 p.m.
On 1/14/13 6:37 PM, Theodore Ts'o wrote:
> If bigalloc is enabled, then -g will specify the clusters per block
> group.  (If bigalloc is not enabled, then a cluster == a block, so the
> meaning of -g is not changed.)

This should be clearly documented in the man page as well, I think.

-Eric

> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> ---
>  misc/mke2fs.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index 75d0e48..5cb49b3 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -1962,6 +1962,15 @@ profile_error:
>  		}
>  	}
>  
> +	/*
> +	 * If the bigalloc feature is enabled, then the -g option will
> +	 * specify the number of clusters per group.
> +	 */
> +	if (fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC) {
> +		fs_param.s_clusters_per_group = fs_param.s_blocks_per_group;
> +		fs_param.s_blocks_per_group = 0;
> +	}
> +
>  	if (inode_size == 0)
>  		inode_size = get_int_from_profile(fs_types, "inode_size", 0);
>  	if (!flex_bg_size && (fs_param.s_feature_incompat &
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zheng Liu - Jan. 15, 2013, 3:22 p.m.
On Mon, Jan 14, 2013 at 07:37:09PM -0500, Theodore Ts'o wrote:
> If bigalloc is enabled, then -g will specify the clusters per block
> group.  (If bigalloc is not enabled, then a cluster == a block, so the
> meaning of -g is not changed.)
> 
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Regards,
                                                - Zheng
> ---
>  misc/mke2fs.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index 75d0e48..5cb49b3 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -1962,6 +1962,15 @@ profile_error:
>  		}
>  	}
>  
> +	/*
> +	 * If the bigalloc feature is enabled, then the -g option will
> +	 * specify the number of clusters per group.
> +	 */
> +	if (fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC) {
> +		fs_param.s_clusters_per_group = fs_param.s_blocks_per_group;
> +		fs_param.s_blocks_per_group = 0;
> +	}
> +
>  	if (inode_size == 0)
>  		inode_size = get_int_from_profile(fs_types, "inode_size", 0);
>  	if (!flex_bg_size && (fs_param.s_feature_incompat &
> -- 
> 1.7.12.rc0.22.gcdd159b
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o - Jan. 15, 2013, 7:05 p.m.
On Tue, Jan 15, 2013 at 09:10:41AM -0600, Eric Sandeen wrote:
> On 1/14/13 6:37 PM, Theodore Ts'o wrote:
> > If bigalloc is enabled, then -g will specify the clusters per block
> > group.  (If bigalloc is not enabled, then a cluster == a block, so the
> > meaning of -g is not changed.)
> 
> This should be clearly documented in the man page as well, I think.

Yes, I'm going to include this change as a part of the Zheng's man
page clean up.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 75d0e48..5cb49b3 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1962,6 +1962,15 @@  profile_error:
 		}
 	}
 
+	/*
+	 * If the bigalloc feature is enabled, then the -g option will
+	 * specify the number of clusters per group.
+	 */
+	if (fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_BIGALLOC) {
+		fs_param.s_clusters_per_group = fs_param.s_blocks_per_group;
+		fs_param.s_blocks_per_group = 0;
+	}
+
 	if (inode_size == 0)
 		inode_size = get_int_from_profile(fs_types, "inode_size", 0);
 	if (!flex_bg_size && (fs_param.s_feature_incompat &