* [PATCH] ext4: improve ext4_fill_flex_info() a bit
@ 2008-07-24 1:30 Li Zefan
2008-07-24 17:09 ` Jose R. Santos
0 siblings, 1 reply; 3+ messages in thread
From: Li Zefan @ 2008-07-24 1:30 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: linux-ext4
- use kzalloc() instead of kmalloc() + memset()
- improve a printk info
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
fs/ext4/super.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 1cb371d..33eab31 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1506,14 +1506,13 @@ static int ext4_fill_flex_info(struct super_block *sb)
flex_group_count = (sbi->s_groups_count + groups_per_flex - 1) /
groups_per_flex;
- sbi->s_flex_groups = kmalloc(flex_group_count *
+ sbi->s_flex_groups = kzalloc(flex_group_count *
sizeof(struct flex_groups), GFP_KERNEL);
if (sbi->s_flex_groups == NULL) {
- printk(KERN_ERR "EXT4-fs: not enough memory\n");
+ printk(KERN_ERR "EXT4-fs: not enough memory for "
+ "%lu flex groups\n", flex_group_count);
goto failed;
}
- memset(sbi->s_flex_groups, 0, flex_group_count *
- sizeof(struct flex_groups));
gdp = ext4_get_group_desc(sb, 1, &bh);
block_bitmap = ext4_block_bitmap(sb, gdp) - 1;
--
1.5.4.rc3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: improve ext4_fill_flex_info() a bit
2008-07-24 1:30 [PATCH] ext4: improve ext4_fill_flex_info() a bit Li Zefan
@ 2008-07-24 17:09 ` Jose R. Santos
2008-07-24 18:25 ` Theodore Tso
0 siblings, 1 reply; 3+ messages in thread
From: Jose R. Santos @ 2008-07-24 17:09 UTC (permalink / raw)
To: Li Zefan; +Cc: Theodore Ts'o, linux-ext4
On Thu, 24 Jul 2008 09:30:20 +0800
Li Zefan <lizf@cn.fujitsu.com> wrote:
> - use kzalloc() instead of kmalloc() + memset()
> - improve a printk info
Nicer - Thanks
Acked-by: Jose R. Santos <jrs@us.ibm.com>
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> ---
> fs/ext4/super.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 1cb371d..33eab31 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1506,14 +1506,13 @@ static int ext4_fill_flex_info(struct super_block *sb)
>
> flex_group_count = (sbi->s_groups_count + groups_per_flex - 1) /
> groups_per_flex;
> - sbi->s_flex_groups = kmalloc(flex_group_count *
> + sbi->s_flex_groups = kzalloc(flex_group_count *
> sizeof(struct flex_groups), GFP_KERNEL);
> if (sbi->s_flex_groups == NULL) {
> - printk(KERN_ERR "EXT4-fs: not enough memory\n");
> + printk(KERN_ERR "EXT4-fs: not enough memory for "
> + "%lu flex groups\n", flex_group_count);
> goto failed;
> }
> - memset(sbi->s_flex_groups, 0, flex_group_count *
> - sizeof(struct flex_groups));
>
> gdp = ext4_get_group_desc(sb, 1, &bh);
> block_bitmap = ext4_block_bitmap(sb, gdp) - 1;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: improve ext4_fill_flex_info() a bit
2008-07-24 17:09 ` Jose R. Santos
@ 2008-07-24 18:25 ` Theodore Tso
0 siblings, 0 replies; 3+ messages in thread
From: Theodore Tso @ 2008-07-24 18:25 UTC (permalink / raw)
To: Jose R. Santos; +Cc: Li Zefan, linux-ext4
On Thu, Jul 24, 2008 at 12:09:38PM -0500, Jose R. Santos wrote:
> On Thu, 24 Jul 2008 09:30:20 +0800
> Li Zefan <lizf@cn.fujitsu.com> wrote:
>
> > - use kzalloc() instead of kmalloc() + memset()
> > - improve a printk info
>
> Nicer - Thanks
>
> Acked-by: Jose R. Santos <jrs@us.ibm.com>
I've already merged this into the patch queue earlier today.
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-24 18:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-24 1:30 [PATCH] ext4: improve ext4_fill_flex_info() a bit Li Zefan
2008-07-24 17:09 ` Jose R. Santos
2008-07-24 18:25 ` Theodore Tso
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).