summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan Burman <burman.yan@gmail.com>2006-12-07 05:39:01 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 17:39:41 +0100
commit01afb2134ed079fa4551b4d26f62423df6790c09 (patch)
treec2846354f3f3ef8e1248e80f94f23ce7e13a1b6e
parent[PATCH] dz: Fixes to make it work (diff)
downloadlinux-01afb2134ed079fa4551b4d26f62423df6790c09.tar.xz
linux-01afb2134ed079fa4551b4d26f62423df6790c09.zip
[PATCH] reiser: replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc Signed-off-by: Yan Burman <burman.yan@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/reiserfs/file.c3
-rw-r--r--fs/reiserfs/inode.c7
-rw-r--r--fs/reiserfs/super.c3
3 files changed, 4 insertions, 9 deletions
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index 6526498949d8..970ecd9dbe69 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -317,12 +317,11 @@ static int reiserfs_allocate_blocks_for_region(struct reiserfs_transaction_handl
/* area filled with zeroes, to supply as list of zero blocknumbers
We allocate it outside of loop just in case loop would spin for
several iterations. */
- char *zeros = kmalloc(to_paste * UNFM_P_SIZE, GFP_ATOMIC); // We cannot insert more than MAX_ITEM_LEN bytes anyway.
+ char *zeros = kzalloc(to_paste * UNFM_P_SIZE, GFP_ATOMIC); // We cannot insert more than MAX_ITEM_LEN bytes anyway.
if (!zeros) {
res = -ENOMEM;
goto error_exit_free_blocks;
}
- memset(zeros, 0, to_paste * UNFM_P_SIZE);
do {
to_paste =
min_t(__u64, hole_size,
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index a625688de454..254239e6f9e3 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -929,15 +929,12 @@ int reiserfs_get_block(struct inode *inode, sector_t block,
if (blocks_needed == 1) {
un = &unf_single;
} else {
- un = kmalloc(min(blocks_needed, max_to_insert) * UNFM_P_SIZE, GFP_ATOMIC); // We need to avoid scheduling.
+ un = kzalloc(min(blocks_needed, max_to_insert) * UNFM_P_SIZE, GFP_ATOMIC); // We need to avoid scheduling.
if (!un) {
un = &unf_single;
blocks_needed = 1;
max_to_insert = 0;
- } else
- memset(un, 0,
- UNFM_P_SIZE * min(blocks_needed,
- max_to_insert));
+ }
}
if (blocks_needed <= max_to_insert) {
/* we are going to add target block to the file. Use allocated
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 745bc714ba91..7fb5fb036f90 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1549,13 +1549,12 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
struct reiserfs_sb_info *sbi;
int errval = -EINVAL;
- sbi = kmalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL);
+ sbi = kzalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL);
if (!sbi) {
errval = -ENOMEM;
goto error;
}
s->s_fs_info = sbi;
- memset(sbi, 0, sizeof(struct reiserfs_sb_info));
/* Set default values for options: non-aggressive tails, RO on errors */
REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_SMALLTAIL);
REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ERROR_RO);