[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-ext4
Subject: [Ext2-devel] [Patch] kzalloc conversion in fs/ext2
From: Eric Sesterhenn <snakebyte () gmx ! de>
Date: 2006-02-23 22:13:20
Message-ID: 1140732800.12049.10.camel () alice
[Download RAW message or body]
hi,
this converts fs/ext2 to kzalloc() usage.
compile tested with make allyesconfig
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.16-rc4/fs/ext2/super.c.orig 2006-02-23 01:14:43.000000000 +0100
+++ linux-2.6.16-rc4/fs/ext2/super.c 2006-02-23 01:14:58.000000000 +0100
@@ -612,11 +612,10 @@ static int ext2_fill_super(struct super_
int i, j;
__le32 features;
- sbi = kmalloc(sizeof(*sbi), GFP_KERNEL);
+ sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
if (!sbi)
return -ENOMEM;
sb->s_fs_info = sbi;
- memset(sbi, 0, sizeof(*sbi));
/*
* See what the current blocksize for the device is, and
--- linux-2.6.16-rc4/fs/ext2/xattr.c.orig 2006-02-23 01:15:07.000000000 +0100
+++ linux-2.6.16-rc4/fs/ext2/xattr.c 2006-02-23 01:15:28.000000000 +0100
@@ -521,11 +521,10 @@ bad_block: ext2_error(sb, "ext2_xattr_s
}
} else {
/* Allocate a buffer where we construct the new block. */
- header = kmalloc(sb->s_blocksize, GFP_KERNEL);
+ header = kzalloc(sb->s_blocksize, GFP_KERNEL);
error = -ENOMEM;
if (header == NULL)
goto cleanup;
- memset(header, 0, sb->s_blocksize);
end = (char *)header + sb->s_blocksize;
header->h_magic = cpu_to_le32(EXT2_XATTR_MAGIC);
header->h_blocks = header->h_refcount = cpu_to_le32(1);
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Ext2-devel mailing list
Ext2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ext2-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic