Commit 5b3030e39049212c975665cdb3eeabcfaf7c94ca

Authored by Eric Sesterhenn
Committed by Dave Kleikamp
1 parent d9e902668e

JFS: kzalloc conversion

this converts fs/jfs to kzalloc() usage.
compile tested with make allyesconfig

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>

Showing 3 changed files with 5 additions and 10 deletions Side-by-side Diff

... ... @@ -1105,11 +1105,10 @@
1105 1105 }
1106 1106 }
1107 1107  
1108   - if (!(log = kmalloc(sizeof(struct jfs_log), GFP_KERNEL))) {
  1108 + if (!(log = kzalloc(sizeof(struct jfs_log), GFP_KERNEL))) {
1109 1109 up(&jfs_log_sem);
1110 1110 return -ENOMEM;
1111 1111 }
1112   - memset(log, 0, sizeof(struct jfs_log));
1113 1112 INIT_LIST_HEAD(&log->sb_list);
1114 1113 init_waitqueue_head(&log->syncwait);
1115 1114  
1116 1115  
... ... @@ -1181,9 +1180,8 @@
1181 1180 struct jfs_log *log;
1182 1181 int rc;
1183 1182  
1184   - if (!(log = kmalloc(sizeof(struct jfs_log), GFP_KERNEL)))
  1183 + if (!(log = kzalloc(sizeof(struct jfs_log), GFP_KERNEL)))
1185 1184 return -ENOMEM;
1186   - memset(log, 0, sizeof(struct jfs_log));
1187 1185 INIT_LIST_HEAD(&log->sb_list);
1188 1186 init_waitqueue_head(&log->syncwait);
1189 1187  
1190 1188  
... ... @@ -1216,12 +1214,11 @@
1216 1214  
1217 1215 down(&jfs_log_sem);
1218 1216 if (!dummy_log) {
1219   - dummy_log = kmalloc(sizeof(struct jfs_log), GFP_KERNEL);
  1217 + dummy_log = kzalloc(sizeof(struct jfs_log), GFP_KERNEL);
1220 1218 if (!dummy_log) {
1221 1219 up(&jfs_log_sem);
1222 1220 return -ENOMEM;
1223 1221 }
1224   - memset(dummy_log, 0, sizeof(struct jfs_log));
1225 1222 INIT_LIST_HEAD(&dummy_log->sb_list);
1226 1223 init_waitqueue_head(&dummy_log->syncwait);
1227 1224 dummy_log->no_integrity = 1;
fs/jfs/jfs_metapage.c
... ... @@ -104,10 +104,9 @@
104 104 if (PagePrivate(page))
105 105 a = mp_anchor(page);
106 106 else {
107   - a = kmalloc(sizeof(struct meta_anchor), GFP_NOFS);
  107 + a = kzalloc(sizeof(struct meta_anchor), GFP_NOFS);
108 108 if (!a)
109 109 return -ENOMEM;
110   - memset(a, 0, sizeof(struct meta_anchor));
111 110 set_page_private(page, (unsigned long)a);
112 111 SetPagePrivate(page);
113 112 kmap(page);
... ... @@ -395,10 +395,9 @@
395 395 if (!new_valid_dev(sb->s_bdev->bd_dev))
396 396 return -EOVERFLOW;
397 397  
398   - sbi = kmalloc(sizeof (struct jfs_sb_info), GFP_KERNEL);
  398 + sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL);
399 399 if (!sbi)
400 400 return -ENOSPC;
401   - memset(sbi, 0, sizeof (struct jfs_sb_info));
402 401 sb->s_fs_info = sbi;
403 402 sbi->sb = sb;
404 403